On 22/07/2010 10:42, Yue Guo wrote: > Hello, everyone, > > Currently I'm working on a project regarding to it. The main goal is to > write an smw extension to enable some metadata about the contributors of a > certain page. What I've read so far is the the following manuals: > > http://semantic-mediawiki.org/wiki/Programmer's_guide_to_SMW > <http://semantic-mediawiki.org/wiki/Programmer%27s_guide_to_SMW%20> > > http://www.mediawiki.org/wiki/Manual:Extensions > > http://semantic-mediawiki.org/doc/ > > The embarrassment is I'm completely new to smw and php and kinda lost about > where to start. An smw extension means that it uses the API listed in the > above link, which makes it tied to smw , but after all it's still a > mediawiki extension and works just as smw does, is it correct? Do I need to > master php first or is it possible to learn while working? Could any of you > gurus give me some hints or suggestions? A simple sample extension of a toy > functionality is more desired if possible. Thank you guys!
You are right about SMW extensions and MediaWiki extensions: the former is just a special kind of the latter which requires SMW to be installed. PHP does not impose many restrictions on API accessibility, so you can call almost any function in SMW or MW easily. So an "extension" in many ways is just extra source code that is used in addition to the code of MW/SMW. After learning about the basics, the best way of improving your programming skills is certainly to program. If you have a concrete goal then it is also easier to find out what you need to learn about next. There are some very small extensions for MediaWiki that you can look at for examples (see the MediaWiki SVN; an example of a rather small piece of code is the ParserFunctions extension). SMW is a rather big extension, and you do not need to read all of it. The best thing is really to start with a concrete goal in mind and to look up other people's code to get information about how certain things work, or how others have solved similar problems. The second best way to learn more about programming is to read and understand other people's code. Again, this will happen automatically when you work on something. Be aware that not all code in MW or SMW is great, and some things certainly could be improved. But reading it should give you a feeling about the code style and the important MW or PHP functions/variables/features that are used frequently. Finally, if you have written some code, or made plans for how to tackle a special problem, it makes sense to discuss this with other people. You can ask other developers for feedback either on this list or (in general cases) on the MediaWiki list and IRC channel. People on technical lists tend to be very rational and sometimes not very welcoming. Or sometimes they are just busy and not very responsive (e.g. I often cannot answer here). Do not let that disturb you. Regards, Markus ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel