This is a test site. Any changes will be lost!

Development:Developer documentation: Difference between revisions

From MoodleDocs
m Reverted edits by Soumya@akrostpl.com (talk); changed back to last version by Tim Hunt
 
(54 intermediate revisions by 18 users not shown)
Line 14: Line 14:
*[[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
*[[Development:Working with the Community|Working with the Community]] explains how to engage with the dev community and discuss changes
*[[Development: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.
*[[Development:Unit tests|Unit tests]] explains how to run the unit tests, and how to write new test cases.
*[[Development:Fast portable SQL]] shows SQL techniques that are fast, efficient, and known to work on all supported DBs.


==Documentation for core components==
==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]].
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 [[Development:Developer notes|developer notes]] or on the [[Roadmap|roadmap]].


The documents below give a general overview. For detailed function-by-function documentation, see the [http://phpdocs.moodle.org/ phpDocumentor] documentation that is automatically generated from the comments in the code. And don't forget that the most up-to-date and detailed description of how the code works is the code itself. Moodle code should be easy to read and understand. Use the source, Luke!
The documents below give a general overview. For detailed function-by-function documentation, see the [http://phpdocs.moodle.org/ phpDocumentor] documentation that is automatically generated from the comments in the code. And don't forget that the most up-to-date and detailed description of how the code works is the code itself, and you can [http://xref.moodle.org/nav.html?index.html browse the code online using phpXRef]. Moodle code should be easy to read and understand. Use the source, Luke!


===Core components that affect everything===
===Core components that affect everything===


*[[Development:Database schema introduction|The database schema]]
*lib/moodlelib.php  
*lib/moodlelib.php  
*[[Development:lib/weblib.php|lib/weblib.php]] for outputting stuff.
*[[Development:lib/weblib.php|lib/weblib.php]] for outputting stuff
*[[Development:JavaScript_functions|JavaScript function available on the client side]]
*[[Development:XMLDB_Documentation|Database abstraction layer]] @ v[[1.7]]
*[[Development:XMLDB_Documentation|Database abstraction layer]] @ v[[1.7]]
*[[Development:Roles|Roles and Capabilities system]] @ v[[1.7]] for controlling who can do what.
*[[Development:Roles|Roles and Capabilities system]] @ v[[1.7]] for controlling who can do what
*[[Development:lib/formslib.php|Forms library]] @ v[[1.8]] for creating accessible and secure HTML forms that let users edit things.
*[[Development: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===
===Core libraries with a more specific uses===
Line 34: Line 37:
*[[Authentication API]]
*[[Authentication API]]
*[[Cookieless Sessions]]
*[[Cookieless Sessions]]
*[[Development:Moodle Network|Moodle Network]]
*[[Email processing]]
*[[Email processing]]
*[[Development:Environment checking|Environment checking]] before install, check the user's server to ensure Moodle will work there.
*[[Development:Environment checking|Environment checking]] before install, check the user's server to ensure Moodle will work there.
*[[Development:Groups|Groups system]]
*[[Development:Grades|Gradebook]]
*[[Development:Moodle Network|Moodle Network]]
*[[Question engine]]
*[[Question engine]]
*[[Stats package]]
*[[Stats package]]
*[[UTF-8 migration|Migration to UTF-8]] @ v[[:Category:Moodle 1.6|1.6]]
*[[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.
*[http://developer.yahoo.com/yui YUI JavaScript library] - YUI was selected as the official AJAX library for Moodle.
*[[Development:lib/graphlib|lib/graphlib]]
*[[Development:Admin settings|Admin settings]]


===Modules included in the standard distribution===
===Modules included in the standard distribution===


*[[Development:Lesson Specification|Lesson Specification]]
*[[Quiz developer docs|Quiz module]]
*[[Quiz developer docs|Quiz module]]
*[[SCORM schema|SCORM module 1.5 schema]]
*[[SCORM schema|SCORM module 1.5 schema]]
Line 58: Line 66:
*[[Development:Blocks|Blocks]]
*[[Development:Blocks|Blocks]]
*[[Course formats]]
*[[Course formats]]
*[[Development:Course reports|Course reports]]
*[[Development:Course Report Plugins|Course reports]]
*[[Development:Database fields|Database fields]]
*[[Development:Database fields|Database fields]]
*[[Development:Database presets|Database presets]]
*[[Development:Database presets|Database presets]]
*[[Development:Enrolment plugins|Enrolment plugins]]
*[[Development:Enrolment plugins|Enrolment plugins]]
*[[Development:Filters|Filters]]
*[[Development:Filters|Filters]]
*[[Development:Grade export/import|Grade export/import]]
*[[Development:Gradebook plugins|Gradebook plugins]]
*[[Development:Grade report|Grade report]]
**[[Development:Gradebook_Report_Tutorial|Gradebook report]]
*[[Development:Question engine|Question engine]]
**[[Development:Gradebook export|Gradebook export]]
**[[Development:Gradebook import|Gradebook import]]
*[[Development:Writing_a_Portfolio_Plugin|Portfolio Plugins]]
*[[Development:Question_type_plugin_how_to|Question types]]
*[[Development:Question import/export formats|Question import/export formats]]
*[[Development:Question import/export formats|Question import/export formats]]
*[[Quiz reports]]
*[[Development:How to write a quiz report plugin|Quiz reports]]
*[[Development:Repository plugins|Repository plugins]]
*[[Development:Resource types|Resource types]]
*[[Development:Resource types|Resource types]]
*[[Development:SSO plugins|SSO plugins]]
*[[Development:Search engine adapters|Search engine adapters]]
*[[Development:Course Report Plugins|Course Report Plugins]]
 
General information that applies to all types of plugins
*[[Development:Places to search for lang strings|Where to put language strings for your plugin]]
*[[Development:Installing and upgrading plugin database tables|Defining the database tables for your plugin]]


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].
Please see the [[Development:Guidelines for contributed code|Guidelines for contributed code]] for an overview of how to contribute to the Moodle code.


===Change core code===
===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|tracker]], and attach your change as a [[Development:How_to_create_a_patch|patch]]. It is also a good idea to discuss your ideas in the forums first.
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 [[Development:How_to_create_a_patch|patch]]. It is also a good idea to discuss your ideas in the forums first.  See [[Development:Overview#Major_Development]] for more details.


===Ways to contribute that do not involve PHP programming===
===Ways to contribute that do not involve PHP programming===
Line 90: Line 105:
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 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.
Once ideas begin to crystallize on the forums they can be summarized in this wiki, either as part of the [[Roadmap|roadmap]] or in the form of [[Development:Developer notes|developer notes]]. These pages then form the basis for further discussion in the forums.


*[[Roadmap]]
*[[Roadmap]]
*[[Development:Developer notes|Developer notes]]
*[[Development:Developer notes|Developer notes]]
*[[Student projects]]
*[[Student projects]]
*[[Developer conferences]]
*[[Developer meetings]]


== Resources and tools ==
== Resources and tools ==
Line 105: Line 120:
*[[Unmerged files]] - changes on the stable branch in CVS that have not been merged to HEAD
*[[Unmerged files]] - changes on the stable branch in CVS that have not been merged to HEAD
*Browse the code online:
*Browse the code online:
**[http://moodle.cvs.sourceforge.net/moodle/moodle/ the code with a complete change history from CVS]
**[http://cvs.moodle.org/moodle/ the code with a complete change history from CVS]
**[http://xref.moodle.org/index.html the code, with links generated by PHPXref]
**[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
*[http://phpdocs.moodle.org/ Moodle PHP doc reference] - compiled from the comment attached to each class and function in the code
Line 115: Line 130:
**[[Development: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.
**[[Development: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.
**[[Development:vim|Setting up Vim for Moodle development]]
**[[Development:vim|Setting up Vim for Moodle development]]
**[[Development:Setting_up_Netbeans|Setting up Netbeans for Moodle development]] - Netbeans Early Acces for PHP is a great out-of-the-box editor.
**[[Development:ctags|Ctags]] - Using a tags file to navigate code
**[[Development:ctags|Ctags]] - Using a tags file to navigate code
**[[W3C_validation|W3C HTML validator]] - Moodle has built in support to make using it easier.
**Firebug plugin for Firefox.
*[[Development:Windows Installer|Windows Installer]] - Windows Installer documentation for developer.


==See also==
==See also==
Line 125: Line 144:
[[es:Documentación para Desarrolladores]]
[[es:Documentación para Desarrolladores]]
[[fr:Documentation développeur]]
[[fr:Documentation développeur]]
[[pt:Desenvolvimento:Documentação para programadores]]
[[zh:开发者文档]]
[[zh:开发者文档]]
[[ja:開発者ドキュメント]]
[[ja:開発者ドキュメント]]
[[fi:Ohjelmoijan opas]]

Latest revision as of 10:58, 26 December 2008

Note: New developer documentation pages should be added to the Development namespace by typing Development: before the new page name i.e. [[Development: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:Developer|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.

The documents below give a general overview. For detailed function-by-function documentation, see the phpDocumentor documentation that is automatically generated from the comments in the code. And don't forget that the most up-to-date and detailed description of how the code works is the code itself, and you can browse the code online using phpXRef. Moodle code should be easy to read and understand. Use the source, Luke!

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:

General information that applies to all types of plugins

Please see the Guidelines for contributed code for an overview of how to contribute to the Moodle code.

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. See Development:Overview#Major_Development for more details.

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