On Monday 20 November 2006 17:01, Gregory Szorc wrote:
> I have a slight gripe about how SMW is configured. Currently, you need to
> put an installation-specific configuration file in the SMW extension
> directory. This raises the following problems:
>
> 1) If my local copy of MediaWiki is a personal Subversion repository, I
> cannot use svn:externals to include SMW in a project. Instead, I have to
> run svn export and commit the changes to my local repository.
>
> 2) Some sites employ logic in LocalSettings.php to apply settings for
> specific sites or domains (e.g. a wiki farm). Currently,
> we have to revert to trickery to get SMW to cooperate.
>
> The problem is SMW_Settings.php specifically requires
> SMW_LocalSettings.php. One solution is adding a conditional statement to
> the inclusion of SMW_LocalSettings.php. I have something like this in
> mind:
>
> if (!defined('SMW_IGNORE_SMW_SETTINGS')) {
> require('SMW_LocalSettings.php');
> }
>
> Then, if we wanted to not use SMW_LocalSettings.php in the extension
> directory, we could just place the following in LocalSettings.php:
>
> define('SMW_IGNORE_SMW_SETTINGS', true);
> require('extensions/SemanticMediaWiki/includes/SMW_Settings.php');
>
> There would also need to be some refactoring in SMW_Settings.php to make
> sure variables can be overwritten by LocalSettings.php, but this is no big
> deal. The refactoring would just be bringing SMW inline with other
> extensions that use $wgExtensionFunctions and let MediaWiki initialize the
> extension.
>
> I have commit privileges to the MediaWiki SVN and would not mind
> implementing these changes myself.
You are right, and the idea sounds good. But I would like to discuss this a
little further first (it is obvious that change is needed, but maybe we can
go for an even simpler solution):
The problem with SMW currently is that the local settings are needed in the
middle of the setup. The reasons are:
(1) you want to have defaults in place *before* the local changes are done, to
avoid extra checks when settin defaults; it would even be cleaner to have
static class members instead of globals sometimes, so you first need the
declaration of the class
(2) you need to provide a function for registering namespaces *before* it is
called in the settings
(3) you want to provide some constants (like SMW_FACTBOX_HIDDEN) *before* they
are used in the settings
(4) you want to register hooks *afterwards* based on the settings (use SMW
with or without templates)
(5) you want to allow the changed include path for later includes? (I think we
don't really want this and should return to standard include paths)
So not much is currently necessary after the settings and it seems that they
could go into the LocalSettings after the include. (4) might become redundant
if someone could build a suitable hook into MediaWiki (I think this could be
useful for many other extensions, essentially for anyone who extends the
parsing without touching the normal processing of things like <nowiki>,
<!-- -->, template inclusion, ...). While this hook is not there, we could
just require it and remove the option to not use it.
Moreover, most settings do not need to be set and are very optional, but I
fear some do not have defaults yet (which is bad anyway). I think $smwgServer
is the only thing that every wiki really needs to define, since otherwise the
URIs used in RDF feeds depend on the URL used for getting the RDF.
So the following is needed:
* move default settings to SMW_Settings or to their appropriate files
* change SMW_Settings.php to always use the template-hook, and make it check
for the existence of a variable that overwrites the namespace number used or
creating namespaces (otherwise use default)
* change docu so that no SMW_LocalSettings.php is needed anymore, but state
that the normal installation means adding the lines
require('extensions/SemanticMediaWiki/includes/SMW_Settings.php');
$smwgServer = "some.server.org";
where the server must be adjusted. Further settings can be added if needed.
Moreover, anybody must apply the patch to include the new hook (maybe we
should return an error if this did not happen -- at least some crude output
would work during saving by checking for some global in the later save hook)
* remove SMW_LocalSettingsTemplate.php from SVN
* make a new Help page on ontoworld.org that documents most relevant settings
If you like this plan, feel free to implement and commit it. Otherwise we will
do it later on (or you found a bug in my plan and we need another one ;-).
-- Markus
--
Markus Krötzsch
Institute AIFB, University of Karlsruhe, D-76128 Karlsruhe
[EMAIL PROTECTED] phone +49 (0)721 608 7362
www.aifb.uni-karlsruhe.de/WBS/ fax +49 (0)721 693 717
pgpZtNBbuUWfB.pgp
Description: PGP signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Semediawiki-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/semediawiki-user
