• You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.
  • You do not have permissions to view this page - please try logging in.

petee 2 Oct 2009 We need to define some more conventions for plugins.  I propose the following:

Configuration file

If I plugin requires a configuration file it should follow this naming schema

{plugin_name}_config.php

If possible, default values can be hard-coded but overridden by {plugin_name}_config.php

Provide a sample configuration file:  {plugin_name}_config-sample.php

 

Logging

If a plugin cannot be loaded, for example, due to a missing configuration file we should write to a log file or display a warning message in the UI.  A misconfigured plugin should not crash the entire wiki due a PHP error.

 

Database Dependencies

Database Name

If a plugin requires a database table, by default the tables should exist in the wikidb, not a separate database.  However, a plugin should be configurable so the tables can exist in a separate database.

Putting the tables in the wiki database makes migrations much easier.

Table Naming

If a plugin requires a database table(s) the tables should have a standard prefix.  For example:

plugin_{plugin_name}

The table name must not exceed 64 characters.

Database Schema

The DDL to create tables should be named the following and should exist within the root of the plugin directory:

{plugin_name}.sql
  • {plugin_name}.sql should be unix formatted (no windows line endings)
  • Do not specify ENGINE, DEFAULT CHARSET, COLLATE - These values should be inherited from the database if the table is going in wikidb or specified in the CREATE DATABASE line if being created in a separate database.
  • always use CREATE TABLE IF NOT EXISTS
  • do not specify AUTO_INCREMENT=1
  • do not rely on stored procedures
  • always attempt to make the DDL (and queries) as portable as possible.  Avoid any mysql-specific features.
Tag page
Viewing 4 of 4 comments: view all
this looks good. i'm a little reluctant to have .sql files floating around publicly, though...
Posted 10:53, 2 Oct 2009
i'm also not sure about logging. trying to sandbox plugins creates a significant perf overhead (we would essentially have to pre-parse the php), unless there's some other way of doing this i'm not aware of.
Posted 10:54, 2 Oct 2009
Regarding the logging, we can have a global to enable plugin logging to avoid the perf hit in production. Set the debugging mode/verbose mode and the plugin could emit flash messages and warnings.
Posted 11:26, 2 Oct 2009
i think pete's talking about more fundamental errors in the coding.
Posted 14:56, 2 Oct 2009
Viewing 4 of 4 comments: view all
You must login to post a comment.

Copyright © 2011 MindTouch, Inc. Powered by