Note:

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

User:Jordan delacruz: Difference between revisions

From MoodleDocs
m (New page: right|400px This Developer section of Moodle Docs is aimed at developers who contribute to the Moodle code, plugins, themes, ...)
 
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[image:moodle-development-logo.jpg|right|400px]]
== my page ==


This [[:Category:Developer|Developer]] section of Moodle Docs is aimed at developers who contribute to the Moodle code, plugins, themes, and so on.
[http://www.moodle/jordandelacruz]--[[User:jordan delacruz|jordan delacruz]] 05:21, 24 April 2010 (UTC)


* If you manage a Moodle site, [[Administrator documentation]] may suit your needs better.
[[image:moodle-development-logo.jpg|right|400px]]
* If you teach using Moodle, try [[Teacher documentation]].
<br />
<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>[[Development:New page name]]</nowiki></code>. 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 adding the template <code><nowiki>{{CategoryDeveloper}}</nowiki></code> to the bottom of the page. - If required, you can use <code><nowiki>[[Category:Developer|Sort key]]</nowiki></code> to provide a sort key other than the default page name.</p>


==How Moodle development works==
==How Moodle development works==


The [[Development:Overview|overview of the Moodle development process]] explains how Moodle development occurs and how people become Moodle developers. Current plans are listed on the [[Roadmap]].
The [[Overview|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 [http://dev.moodle.org Moodle Developer Courses].
You can also enrol in one of the [http://dev.moodle.org Moodle Developer Courses].
Line 19: Line 14:


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
*[[Coding|Coding guidelines]] have to be followed by all Moodle developers
*[[Moodle design goals]] spells out the basic design goals behind Moodle
*[[:en:Moodle design goals|Moodle design goals]] spells out the basic design goals behind Moodle
*[[Interface guidelines]] aim to provide a common feel to the Moodle user interface
*[[:en:Interface guidelines|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 for developers|Moodle CVS for developers]] explains how to work with the Moodle code in CVS
*[[Tracker]] explains the Moodle Tracker for keeping track of bugs, issues, feature requests etc
*[[:en:Tracker|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
*[[:en: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.
*[[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.
*[[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 [[Development:Developer notes|developer notes]] or on the [[Roadmap|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 [[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.  
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 [[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 [[PHPXref|PHPXref]].


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


*[[Development:Database schema introduction|The database schema]]
*[[Database schema introduction|The database schema]]
*[[Development:What happens when you require config.php|What happens when you require config.php]]
*[[What happens when you require config.php|What happens when you require config.php]]
*lib/moodlelib.php  
*lib/moodlelib.php  
*[[Development:lib/weblib.php|lib/weblib.php]] for outputting stuff
*[[lib/weblib.php|lib/weblib.php]] for outputting stuff
*[[Development:JavaScript_functions|JavaScript function available on the client side]]
*[[JavaScript_functions|JavaScript function available on the client side]]
*[[Development:XMLDB_Documentation|Database abstraction layer]] @ v[[1.7]]
*[[XMLDB_Documentation|Database abstraction layer]] @ v[[1.7]]
*[[Development:Roles|Roles and Capabilities system]] @ v[[1.7]] for controlling who can do what
*[[:en: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
*[[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
*[[Using_the_file_API|File API]] @ v[[2.0]] for managing files stored by Moodle


===Core libraries with a more specific uses===
===Core libraries with a more specific uses===


*[[Authentication API]]
*[[:en:Authentication API|Authentication API]]
*[[Cookieless Sessions]]
*[[:en:Cookieless Sessions|Cookieless Sessions]]
*[[Email processing]]
*[[:en:Email processing|Email processing]]
*[[Development:Environment checking|Environment checking]] before install, check the user's server to ensure Moodle will work there.
*[[Environment checking|Environment checking]] before install, check the user's server to ensure Moodle will work there.
*[[Development:Groups|Groups system]]
*[[Groups|Groups system]]
*[[Development:Grades|Gradebook]]
*[[Grades|Gradebook]]
*[[Development:Moodle Network|Moodle Network]]
*[[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]]
*[[lib/graphlib|lib/graphlib]]
*[[Development:Admin settings|Admin settings]]
*[[Admin settings|Admin settings]]


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


*[[Development:Lesson Specification|Lesson Specification]]
*[[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 75: Line 70:


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)
*[[Modules|Activity modules]], see also [[NEWMODULE Documentation]] (work in progress)
*[[Development:Admin reports|Admin reports]]
*[[Admin reports|Admin reports]]
*[[Development:Assignment types|Assignment types]]
*[[Assignment types|Assignment types]]
*[[Development:Authentication plugins|Authentication plugins]]
*[[Authentication plugins|Authentication plugins]]
*[[Development:Blocks|Blocks]]
*[[Blocks|Blocks]]
*[[Course formats]]
*[[:en:Course formats|Course formats]]
*[[Development:Course Report Plugins|Course reports]]
*[[Course Report Plugins|Course reports]]
*[[Development:Database fields|Database fields]]
*[[Database fields|Database fields]]
*[[Development:Database presets|Database presets]]
*[[:en:Database presets|Database presets]]
*[[Development:Enrolment plugins|Enrolment plugins]]
*[[Enrolment plugins|Enrolment plugins]]
*[[Development:Filters|Filters]]
*[[Filters|Filters]]
*[[Development:Gradebook plugins|Gradebook plugins]] (1.9 onwards)
*[[:en:Gradebook plugins|Gradebook plugins]] (1.9 onwards)
**[[Development:Gradebook_Report_Tutorial|Gradebook report]]
**[[Gradebook_Report_Tutorial|Gradebook report]]
**[[Development:Gradebook export|Gradebook export]]
**[[Gradebook export|Gradebook export]]
**[[Development:Gradebook import|Gradebook import]]
**[[Gradebook import|Gradebook import]]
*[[Development:Writing_a_Portfolio_Plugin|Portfolio plugins]] (2.0 onwards)
*[[Writing_a_Portfolio_Plugin|Portfolio plugins]] (2.0 onwards)
*[[Development:Question_type_plugin_how_to|Question types]]
*[[Question_type_plugin_how_to|Question types]]
*[[Development:Question import/export formats|Question import/export formats]]
*[[Question import/export formats|Question import/export formats]]
*[[Development:How to write a quiz report plugin|Quiz reports]]
*[[How to write a quiz report plugin|Quiz reports]]
*[[Development:Repository plugins|Repository plugins]] (2.0 onwards)
*[[Repository plugins|Repository plugins]] (2.0 onwards)
*[[Development:Resource types|Resource types]]
*[[Resource types|Resource types]]
*[[Development:Search engine adapters|Search engine adapters]]
*[[Search engine adapters|Search engine adapters]]


General information that applies to all types of 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]]
*[[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]]
*[[Installing and upgrading plugin database tables|Defining the database tables for your plugin]]


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


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


===Ways to contribute that do not involve PHP programming===
===Ways to contribute that do not involve PHP programming===


*[[Themes|Create Moodle themes]]
*[[:en:Themes|Create Moodle themes]]
*[[Translation|Translate Moodle into other languages]]
*[[:en:Translation|Translate Moodle into other languages]]
*[[MoodleDocs:Guidelines for contributors|Help document Moodle]]
*[[:en:MoodleDocs:Guidelines for contributors|Help document Moodle]]
*[[Development:Tests|Join the testing effort]], which involves [[Tracker|participating in the bug tracker]]
*[[Tests|Join the testing effort]], which involves [[Tracker|participating in the bug tracker]]


==Plans for the future==
==Plans for the future==
Line 121: Line 116:
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|roadmap]] or in the form of [[Development:Developer notes|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 [[Developer notes|developer notes]]. These pages then form the basis for further discussion in the forums.


*[[Roadmap]]
*[[Roadmap]]
*[[Development:Developer notes|Developer notes]]
*[[Developer notes|Developer notes]]
*[[Student projects]]
*[[Student projects]]
*[[Developer meetings]]
*[[Developer meetings]]
Line 131: Line 126:


*[[Developer FAQ]] - frequently asked questions, especially useful for newcomers to Moodle
*[[Developer FAQ]] - frequently asked questions, especially useful for newcomers to Moodle
*[[Development:Finding_your_way_into_the_Moodle_code|Finding your way into the Moodle code]] - also aimed at newcomers
*[[Finding_your_way_into_the_Moodle_code|Finding your way into the Moodle code]] - also aimed at newcomers
*[http://tracker.moodle.org/ Moodle tracker] - bug reports, feature requests and other tracked issues
*[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
**[[Firefox tracker search]] - How to setup a firefox quicksearch to easily navigate to moodle bugs
Line 140: Line 135:
**[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 nightly from the comment attached to each class and function in the code.   
*[http://phpdocs.moodle.org/ Moodle PHP doc reference] - compiled nightly from the comment attached to each class and function in the code.   
*[[Development:Database Schema|Database Schema]] - for recent releases
*[[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://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]
**especially the [http://moodle.org/mod/forum/view.php?id=55 General developer forum]
**[[Filters used on the Moodle.org forums|cool tricks you can use in the moodle.org forums]]
**[[:en:Filters used on the Moodle.org forums|cool tricks you can use in the moodle.org forums]]


== Tools ==
== Tools ==
Line 150: Line 145:
=== IDEs ===
=== IDEs ===


* [[Development:Setting_up_Netbeans|Setting up NetBeans for Moodle development]] - NetBeans for PHP is a great out-of-the-box editor.
* [[Setting_up_Netbeans|Setting up NetBeans for Moodle development]] - NetBeans for PHP is a great out-of-the-box editor.
* [[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.
* [[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]]
* [[vim|Setting up Vim for Moodle development]]


=== Browser add-ons ===
=== Browser add-ons ===
*[http://getfirebug.com Firebug], see [[Development:Firebug]].
*[http://getfirebug.com Firebug], see [[Firebug]].
* [[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.


=== Miscellaneous ===  
=== Miscellaneous ===  
*[[Development:ctags|Ctags]] - Using a tags file to navigate code
*[[ctags|Ctags]] - Using a tags file to navigate code
*[[W3C_validation|W3C HTML validator]] - Moodle has built in support to make using it easier.
*[[W3C_validation|W3C HTML validator]] - Moodle has built in support to make using it easier.
*[[Development:Windows Installer|Windows Installer]] - Windows Installer documentation for developer.
*[[Windows Installer|Windows Installer]] - Windows Installer documentation for developer.


See also: [http://dev.moodle.org/mod/forum/view.php?id=18 Useful Development Tools forum]in the [http://dev.moodle.org/course/view.php?id=2 Introduction to Moodle Programming course]
See also: [http://dev.moodle.org/mod/forum/view.php?id=18 Useful Development Tools forum]in the [http://dev.moodle.org/course/view.php?id=2 Introduction to Moodle Programming course]
Line 170: Line 165:
*[http://moodle.org/security/ Moodle Security Announcements]
*[http://moodle.org/security/ Moodle Security Announcements]
*[http://moodle.com/partners/ Moodle Partners] - providers of custom Moodle development services
*[http://moodle.com/partners/ Moodle Partners] - providers of custom Moodle development services
[[Category:Developer]]
[[Category:Developer tools]]
[[ru:Development:Краткий обзор]]
[[es:Documentación para Desarrolladores]]
[[fr:Documentation développeur]]
[[pt:Desenvolvimento:Documentação para programadores]]
[[zh:开发者文档]]
[[ja:開発者ドキュメント]]
[[fi:Ohjelmoijan opas]]

Latest revision as of 02:41, 12 April 2013

my page

[1]--jordan delacruz 05:21, 24 April 2010 (UTC)

moodle-development-logo.jpg

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 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.

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 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