Development:Developer documentation: Difference between revisions

From MoodleDocs
m (Reverted edits by Speakinginenglish (talk) to last revision by Tim Hunt)
 
(27 intermediate revisions by 7 users not shown)
Line 20: Line 20:
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:
*[[Development:Coding|Coding guidelines]] have to be followed by all Moodle developers
*[[Development:Coding|Coding guidelines]] have to be followed by all Moodle developers
*[[Moodle design goals]] spells out the basic design goals behind Moodle
*[[Moodle architecture]] gives an overview of how the Moodle code works
*[[CVS (developer)|Moodle CVS for developers]] explains how to work with the Moodle code in CVS
*[[Development:Process]] explains how changes are incorporated into Moodle
*[[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
*[[Development:Unit tests|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:Profiling PHP|Profiling PHP]] how to analyse your code to find out why it is slow.
*[[Development:Fast portable SQL]] shows SQL techniques that are fast, efficient, and known to work on all supported DBs.
*[[Development:Fast portable SQL]] shows SQL techniques that are fast, efficient, and known to work on all supported DBs.
*[[Development:Development hints and tips]] a (developing) list of general wisdom to help with your Moodle projects.
*[[Development:Development hints and tips]] a (developing) list of general wisdom to help with your Moodle projects.
Line 36: Line 37:
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 [[Development:PHPXref|PHPXref]].
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 [[Development:PHPXref|PHPXref]].


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


*[[Development:Database schema introduction|The database schema]]
*[[Development:What happens when you require config.php|What happens when you require config.php]]
*lib/moodlelib.php
*[[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
*[[Development:Using_the_file_API|File API]] @ v[[2.0]] for managing files stored by Moodle
*[[Development:Using_the_file_API|File API]] @ v[[2.0]] for managing files stored by Moodle
*[[Development:Database schema introduction|The database schema]]
*[[Development:What happens when you require config.php|What happens when you require config.php]]
*[[Development:lib/moodlelib.php|lib/moodlelib.php]]
*[[Development:lib/weblib.php|lib/weblib.php]] for outputting stuff


===Core libraries with a more specific uses===
===Core libraries with a more specific uses===
Line 76: Line 76:
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:
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:
*[[Development:Modules|Activity modules]], see also [[Development:NEWMODULE Documentation]] (work in progress)
*[[Development:Modules|Activity modules]], see also [[Development:NEWMODULE Documentation]] (work in progress)
**and [[Development:Subplugins|Sub-Plugins]] (2.0 Onwards)
*[[Development:Admin reports|Admin reports]]
*[[Development:Admin reports|Admin reports]]
*[[Development:Assignment types|Assignment types]]
*[[Development:Assignment types|Assignment types]]
*[[Development:Authentication plugins|Authentication plugins]]
*[[Development:Authentication plugins|Authentication plugins]]
*[[Development:Blocks|Blocks]]
*[[Development:Blocks|Blocks]]
*Content editors
*Content editors (2.0 onwards)
*[[Course formats]]
*[[Course formats]]
*[[Development:Course Report Plugins|Course reports]]
*[[Development:Course Report Plugins|Course reports]]
*Course importers
*Course importers (2.0 onwards)
*[[Development:Database fields|Database fields]]
*[[Development:Database fields|Database fields]]
*[[Development:Database presets|Database presets]]
*[[Development:Database presets|Database presets]]
Line 91: Line 92:
*[[Development:Gradebook export|Gradebook export]]
*[[Development:Gradebook export|Gradebook export]]
*[[Development:Gradebook import|Gradebook import]]
*[[Development:Gradebook import|Gradebook import]]
*Message senders
*Message senders (2.0 onwards)
*Mnet services
*Mnet services
*Plagiarism detection plugins
*Plagiarism detection plugins (2.0 onwards)
*[[Development:Writing_a_Portfolio_Plugin|Portfolio plugins]] (2.0 onwards)
*[[Development:Writing_a_Portfolio_Plugin|Portfolio plugins]] (2.0 onwards)
*[[Development:Question_type_plugin_how_to|Question types]]
*[[Development:Question_type_plugin_how_to|Question types]]
Line 103: Line 104:
*Themes which are different in [[Development:Themes_2.0|Moodle 2.0]], and [[Theme_basics|earlier versions]].
*Themes which are different in [[Development:Themes_2.0|Moodle 2.0]], and [[Theme_basics|earlier versions]].
*User profile fields
*User profile fields
*Web services
*[[Development:Web services (2.0 onwards)|Web services (2.0 onwards)]]
*Workshop allocators
*Workshop allocators (2.0 onwards)
*Workshop forms
*Workshop forms (2.0 onwards)
*Workshop evaluators
*Workshop evaluators (2.0 onwards)


General information that applies to all types of plugins
General information that applies to all types of plugins
Line 166: Line 167:


=== Browser add-ons ===
=== Browser add-ons ===
*[http://getfirebug.com Firebug], see [[Development:Firebug]].
*[http://getfirebug.com Firebug], see [[Firebug]] for details.
* [[Web developer extension]]
* [[Web developer extension]]
* [https://addons.mozilla.org/en-US/firefox/addon/394 ViewSourceWith] - The main goal is to view page source with external applications, but you can do a lot of other things as well.
* [https://addons.mozilla.org/en-US/firefox/addon/394 ViewSourceWith] - The main goal is to view page source with external applications, but you can do a lot of other things as well.

Latest revision as of 21:33, 26 April 2011

moodle-development-logo.jpg

This Developer section of Moodle Docs is aimed at developers who contribute to the Moodle code, plugins, themes, and so on.


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 adding the template {{CategoryDeveloper}} to the bottom of the page. - If required, you can use [[Category:Developer|Sort key]] to provide a sort key other than the default page name.

How Moodle development works

The overview of the Moodle development process explains how Moodle development occurs and how people become Moodle developers. Current plans are listed on the Roadmap.

You can also enrol in one of the Moodle Developer Courses.

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.

Core components

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.

Sometimes it is not possible to write a proper plugin for what you want to do, in which case you may have to resort to using the local customisations hook.

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

Tools

Some tools people use when working on Moodle code:

IDEs

Browser add-ons

Miscellaneous

See also: Useful Development Tools forumin the Introduction to Moodle Programming course

See also