Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Developer documentation: Difference between revisions

From MoodleDocs
No edit summary
Line 1: Line 1:
<p class="note">'''Note:''' New developer documentation pages should be added to the ''Development namespace'' by typing <code>Development:</code> before the new page name i.e. <code><nowiki>[[New page name]]</nowiki></code>.<br /><br />If you are a developer, you probably want to change your [[Special:Preferences|preferences]] to include the Development namespace in searches.<br /><br />A page may be added to the Developer category by typing <code><nowiki>[[Category:New page name]]</nowiki></code> at the bottom of the page.</p>
<p class="note">'''Note:''' New developer documentation pages should be added to the ''Development namespace'' by typing <code>Development:</code> before the new page name i.e. <code><nowiki>[[New page name]]</nowiki></code>.<br /><br />If you are a developer, you probably want to change your [[Special:Preferences|preferences]] to include the Development namespace in searches.<br /><br />A page may be added to the Developer category by typing <code><nowiki>[[Category:New page name]]</nowiki></code> at the bottom of the page.</p>


==How Moodle development works==
This [[Overview|overview of the Moodle development process]] may be handy in understanding how the development of Moodle occurs and how people become Moodle developers.


==Guidelines==
==Guidelines==
The following guidelines are crucial reading for anyone wanting to contribute to the Moodle code base:
The following guidelines are crucial reading for anyone wanting to contribute to the Moodle code base:
*[[Coding|Coding guidelines]] have to be followed by all Moodle developers
*[[Coding|Coding guidelines]] have to be followed by all Moodle developers
Line 8: Line 12:
*[[Interface guidelines]] aim to provide a common feel to the Moodle user interface
*[[Interface guidelines]] aim to provide a common feel to the Moodle user interface
*[[CVS (developer)|Moodle CVS for developers]] explains how to work with the Moodle code in CVS
*[[CVS (developer)|Moodle CVS for developers]] explains how to work with the Moodle code in CVS
*[[Unit tests]] explains how to run the unit tests, and how to write new test cases.
*[[Tracker]] explains the Moodle Tracker for keeping track of bugs, issues, feature requests etc
*[[Tracker]] explains the Moodle Tracker for keeping track of bugs, issues, feature requests etc
*[[Working with the Community|Working with the Community]] explains how to engage with the dev community and discuss changes
*[[Working with the Community|Working with the Community]] explains how to engage with the dev community and discuss changes
*[[Unit tests]] explains how to run the unit tests, and how to write new test cases.
==Documentation for core components==
This section is for documentation of specific components of the existing core Moodle code. Discussion of components that are under discussion or in development can be found in the [[Developer notes]] or on the [[Roadmap]].
===Core components that affect everything===


== Resources and tools ==
* lib/moodlelib.php
* lib/weblib.php for outputting stuff.
*[[XMLDB_Documentation|Database abstraction layer]] @ v[[1.7]]
*[[Roles|Roles and Capabilities system]] @ v[[1.7]] for controlling who can do what.
*[[lib/formslib.php|Forms library]] @ v[[1.8]] for creating accessible and secure HTML forms that let users edit things.


*[[Developer FAQ]] - frequently asked questions, especially useful for newcomers to Moodle
===Core libraries with a more specific uses===
*[http://tracker.moodle.org/ Moodle tracker] - bug reports, feature requests and other tracked issues
*[http://moodle.org/mod/forum/view.php?id=55 General developer forum]
*[http://moodle.cvs.sourceforge.net/moodle/moodle/ CVS code] - browse the Moodle code via the web
*[http://xref.moodle.org/index.html Cross reference] - phpxref output for browsing Moodle source code
*[http://phpdocs.moodle.org/ Moodle PHP doc reference] - automatically generated documentation
*[[Database Schema|Database Schema]] - for recent releases
*[http://moodle.org/course/view.php?id=5#4 Development news and discussion] section of Using Moodle course
*[http://developer.yahoo.com/yui YUI documentation] - YUI is the official AJAX library in moodle.
*[[Setting_up_Eclipse|Setting up Eclipse for Moodle development]] - Eclipse is a great editor to use for php development, if you can work out how to set it up.
* [[vim|Setting up Vim for Moodle development]]
*[[Unmerged files]] - changes on the stable branch in CVS that have not been merged to HEAD
*[[Firefox tracker search]] - How to setup a firefox quicksearch to easily navigate to moodle bugs
*[[ctags|Ctags]] - Using a tags file to navigate code


==How Moodle development works==
*[[Authentication API]]
*[[Cookieless Sessions]]
*[[Moodle Network|Moodle Network]]
*[[Email processing]]
*[[Environment checking|Environment checking]] before install, check the user's server to ensure Moodle will work there.
*[[Question engine]]
*[[Stats package]]
*[[UTF-8 migration|Migration to UTF-8]] @ v[[:Category:Moodle 1.6|1.6]]
*[http://developer.yahoo.com/yui YUI JavaScript library] - YUI was selected as the official AJAX library for Moodle.


This [[Overview|overview of the Moodle development process]] may be handy in understanding how the development of Moodle occurs and how people become Moodle developers.
===Modules included in the standard distribution===


*[[Quiz developer docs|Quiz module]]
*[[SCORM schema|SCORM module 1.5 schema]]


==How you can contribute==
==How you can contribute==


The M in Moodle stands for 'Modular'. There are many different types of components that you can contribute that can be plugged into Moodle to provide additional functionality. When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 database of Moodle modules and plugins]. The following types of plugins currently exist (in alphabetical order):
===Make a new plugin===
 
The M in Moodle stands for modular, and the easiest, most maintainable way to add new functionality to Moodle is by using one of the many plugin APIs. There are many types of plugin you can write:
*[[Modules|Activity modules]]
*[[Modules|Activity modules]]
*[[Admin reports|Admin reports]]
*[[Admin reports|Admin reports]]
Line 56: Line 69:
*[[SSO plugins|SSO plugins]]
*[[SSO plugins|SSO plugins]]


There are also ways you can contribute that don't involve PHP programming:
When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 Moodle modules and plugins database].
*[[Themes]]
 
*[[Translation]]
===Change core code===
*[[MoodleDocs:Guidelines for contributors|Documentation]]
 
Some types of change can only be made by editing the core Moodle code. Such changes are much harder to maintain than plugins. If you want your core change to be considered for inclusion in the official Moodle release, you need to create an issue in the [[Tracker|tracker]], and attach your change as a [[How_to_create_a_patch|patch]]. It is also a good idea to discuss your ideas in the forums first.
 
===Ways to contribute that do not involve PHP programming===
 
*[[Themes|Create Moodle themes]]
*[[Translation|Translate Moodle into other languages]]
*[[MoodleDocs:Guidelines for contributors|Help document Moodle]]
*[[Database schemas|Database schemas]]
*[[Database schemas|Database schemas]]
*[[Tests|Join the testing effort]], which involves [[Tracker|participating in the bug tracker]]


You can also help a lot by
==Plans for the future==
*[[Tests|Testing]]
*[[Tracker|Participating in the bug tracker]]


==Plans for the future==
Ideas for and details of planned future features of Moodle are initially discussed on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course at moodle.org. That developer discussions are intermixed with user discussions in the same forums may seem strange at first but is one of the reasons for the success of Moodle. It is important that both end-users and developers discuss the future features together.
Ideas for and details of planned future features of Moodle are initially discussed on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course at moodle.org. That developer discussions are intermixed with user discussions in the same forums may seem strange at first but is one of the reasons for the success of Moodle. It is important that both end-users and developers discuss the future features together.


Once ideas begin to crystalize on the forums they can be summarized in this wiki, either as part of the [[Roadmap]] or in the form of [[Developer notes]]. These pages then form the basis for further discussion in the forums.
Once ideas begin to crystallize on the forums they can be summarized in this wiki, either as part of the [[Roadmap]] or in the form of [[Developer notes]]. These pages then form the basis for further discussion in the forums.
 
*[[Roadmap]]
*[[Roadmap]]
*[[Developer notes]]
*[[Developer notes]]
Line 75: Line 94:
*[[Developer conference|Developer conferences]]
*[[Developer conference|Developer conferences]]


==Documentation for core components==
== Resources and tools ==
This section is for documentation of specific components of the existing core Moodle code. Discussion of components that are under discussion or in development can be found in the [[Developer notes]] or on the [[Roadmap]].


===Core components that affect everything===
*[[Developer FAQ]] - frequently asked questions, especially useful for newcomers to Moodle
*[http://tracker.moodle.org/ Moodle tracker] - bug reports, feature requests and other tracked issues
**[[Firefox tracker search]] - How to setup a firefox quicksearch to easily navigate to moodle bugs
*[[Unmerged files]] - changes on the stable branch in CVS that have not been merged to HEAD
*Browse the code online:
**[http://moodle.cvs.sourceforge.net/moodle/moodle/ the code with a complete change history from CVS]
**[http://xref.moodle.org/index.html the code, with links generated by PHPXref]
*[http://phpdocs.moodle.org/ Moodle PHP doc reference] - compiled from the comment attached to each class and function in the code
*[[Database Schema|Database Schema]] - for recent releases
*[http://moodle.org/course/view.php?id=5#4 Development news and discussion] section of Using Moodle course
**especially the [http://moodle.org/mod/forum/view.php?id=55 General developer forum]
*Some tools people use when working on Moodle code:
**[[Setting_up_Eclipse|Setting up Eclipse for Moodle development]] - Eclipse is a great editor to use for php development, if you can work out how to set it up.
**[[vim|Setting up Vim for Moodle development]]
**[[ctags|Ctags]] - Using a tags file to navigate code


* lib/moodlelib.php
==See also==
* lib/weblib.php for outputting stuff.
*[[XMLDB_Documentation|Database abstraction layer]] @ v[[1.7]]
*[[Roles|Roles and Capabilities system]] @ v[[1.7]] for controlling who can do what.
*[[lib/formslib.php|Forms library]] @ v[[1.8]] for creating accessible and secure HTML forms that let users edit things.


===Core libraries with a more specific uses===
*[[Authentication API]]
*[[Cookieless Sessions]]
*[[Moodle Network|Moodle Network]]
*[[Email processing]]
*[[Environment checking|Environment checking]] before install, check the user's server to ensure Moodle will work there.
*[[Question engine]]
*[[Stats package]]
*[[UTF-8 migration|Migration to UTF-8]] @ v[[:Category:Moodle 1.6|1.6]]
===Modules included in the standard distribution===
*[[Quiz developer docs|Quiz module]]
*[[SCORM schema|SCORM module 1.5 schema]]
==Documentation for contributed code==
Many Moodle users contribute code for the benefit of other Moodle users. This can take the form of new activity modules, blocks, themes, resource plug-ins, assignment plug-ins, question type plug-ins, question import/export formats, quiz report plug-ins, course formats, ... This code is initially posted on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course and then often goes into the [http://moodle.cvs.sourceforge.net/moodle/contrib/ contrib area] of the Moodle [[CVS]] repository. When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 database of Moodle modules and plugins]. Developer documentation for these components should be listed here.
==See also==
*[http://security.moodle.org/ Moodle Security Centre]
*[http://security.moodle.org/ Moodle Security Centre]
*[http://moodle.com/partners/ Moodle Partners] - providers of custom Moodle development services
*[http://moodle.com/partners/ Moodle Partners] - providers of custom Moodle development services

Revision as of 11:19, 3 October 2007

Note: New developer documentation pages should be added to the Development namespace by typing Development: before the new page name i.e. [[New page name]].

If you are a developer, you probably want to change your preferences to include the Development namespace in searches.

A page may be added to the Developer category by typing [[Category:New page name]] at the bottom of the page.

How Moodle development works

This overview of the Moodle development process may be handy in understanding how the development of Moodle occurs and how people become Moodle developers.

Guidelines

The following guidelines are crucial reading for anyone wanting to contribute to the Moodle code base:

Documentation for core components

This section is for documentation of specific components of the existing core Moodle code. Discussion of components that are under discussion or in development can be found in the Developer notes or on the Roadmap.

Core components that affect everything

Core libraries with a more specific uses

Modules included in the standard distribution

How you can contribute

Make a new plugin

The M in Moodle stands for modular, and the easiest, most maintainable way to add new functionality to Moodle is by using one of the many plugin APIs. There are many types of plugin you can write:

When you have developed a new component please publish it in the Moodle modules and plugins database.

Change core code

Some types of change can only be made by editing the core Moodle code. Such changes are much harder to maintain than plugins. If you want your core change to be considered for inclusion in the official Moodle release, you need to create an issue in the tracker, and attach your change as a patch. It is also a good idea to discuss your ideas in the forums first.

Ways to contribute that do not involve PHP programming

Plans for the future

Ideas for and details of planned future features of Moodle are initially discussed on the forums in the Using Moodle course at moodle.org. That developer discussions are intermixed with user discussions in the same forums may seem strange at first but is one of the reasons for the success of Moodle. It is important that both end-users and developers discuss the future features together.

Once ideas begin to crystallize on the forums they can be summarized in this wiki, either as part of the Roadmap or in the form of Developer notes. These pages then form the basis for further discussion in the forums.

Resources and tools

See also

zh:开发者文档