Important: changed constant names

View: New views
1 Messages — Rating Filter:   Alert me  

Important: changed constant names

by Markus Krötzsch-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Extension developers:

I have just changed the internal names of a few SMW constants, so some mild
search and replace is required if your code should happen to use these names.
The reason for the change is that I have moved constants into class
declarations so as to enable autoloading which is generally faster and more
secure. For example, SMW_STRCOND_PRE now is SMWStringCondition::STRCOND_PRE.
The full list of renamings is as follows:

SMW_STRCOND_PRE  ->  SMWStringCondition::STRCOND_PRE
SMW_STRCOND_MID  ->  SMWStringCondition::STRCOND_MID
SMW_STRCOND_POST ->  SMWStringCondition::STRCOND_POST

SMW_PRINT_CATS   ->  SMWPrintRequest::PRINT_CATS
SMW_PRINT_THIS   ->  SMWPrintRequest::PRINT_THIS
SMW_PRINT_PROP   ->  SMWPrintRequest::PRINT_PROP
SMW_PRINT_CCAT   ->  SMWPrintRequest::PRINT_CCAT

If you use these constants, you may either replace their uses in your code
(making the extension compatible to SMW SVN and all future releases), or
retain compatibility to older SMW's by defining the constants in your code if
they are not declared yet. But I assume that it is ok if new releases of SMW
extensions require new versions of SMW as well (why update an SMW extension
but not SMW?).

Some more such changes might follow to turn global constants into local ones
that are autoloaded.

Cheers,

Markus


--
Markus Krötzsch
Semantic MediaWiki    http://semantic-mediawiki.org
http://korrekt.org    markus@...


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

signature.asc (196 bytes) Download Attachment