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

Development:Developer documentation: Difference between revisions

From MoodleDocs
No edit summary
m (Reverted edits by Soumya@akrostpl.com (talk); changed back to last version by Tim Hunt)
 
Line 1: Line 1:
(Redirected from Developer documentation)
<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>.<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:Developer|New page name]]</nowiki></code> at the bottom of the page.</p>
Jump to: navigation, search


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]].
==How Moodle development works==


If you are a developer, you probably want to change your preferences to include the Development namespace in searches.
This [[Development:Overview|overview of the Moodle development process]] may be handy in understanding how the development of Moodle occurs and how people become Moodle developers.


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


    * 1 How Moodle development works
The following guidelines are crucial reading for anyone wanting to contribute to the Moodle code base:
    * 2 Guidelines
*[[Development:Coding|Coding guidelines]] have to be followed by all Moodle developers
    * 3 Documentation for core components
*[[Moodle design goals]] spells out the basic design goals behind Moodle
          o 3.1 Core components that affect everything
*[[Interface guidelines]] aim to provide a common feel to the Moodle user interface
          o 3.2 Core libraries with a more specific uses
*[[CVS (developer)|Moodle CVS for developers]] explains how to work with the Moodle code in CVS
          o 3.3 Modules included in the standard distribution
*[[Tracker]] explains the Moodle Tracker for keeping track of bugs, issues, feature requests etc
    * 4 How you can contribute
*[[Development:Working with the Community|Working with the Community]] explains how to engage with the dev community and discuss changes
          o 4.1 Make a new plugin
*[[Development:Unit tests|Unit tests]] explains how to run the unit tests, and how to write new test cases.
          o 4.2 Change core code
*[[Development:Fast portable SQL]] shows SQL techniques that are fast, efficient, and known to work on all supported DBs.
          o 4.3 Ways to contribute that do not involve PHP programming
    * 5 Plans for the future
    * 6 Resources and tools
    * 7 See also


[edit] How Moodle development works
==Documentation for core components==


This overview of the Moodle development process may be handy in understanding how the development of Moodle occurs and how people become Moodle developers.
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]].
[edit] Guidelines


The following guidelines are crucial reading for anyone wanting to contribute to the Moodle code base:
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!


    * Coding guidelines have to be followed by all Moodle developers
===Core components that affect everything===
    * Moodle design goals spells out the basic design goals behind Moodle
    * Interface guidelines aim to provide a common feel to the Moodle user interface
    * 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
    * 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:Fast portable SQL shows SQL techniques that are fast, efficient, and known to work on all supported DBs.


[edit] Documentation for core components
*[[Development:Database schema introduction|The database schema]]
*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: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


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 libraries with a more specific uses===


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!
*[[Authentication API]]
[edit] Core components that affect everything
*[[Cookieless Sessions]]
*[[Email processing]]
*[[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]]
*[[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.
*[[Development:lib/graphlib|lib/graphlib]]
*[[Development:Admin settings|Admin settings]]


    * The database schema
===Modules included in the standard distribution===
    * lib/moodlelib.php
    * lib/weblib.php for outputting stuff
    * JavaScript function available on the client side
    * Database abstraction layer @ v1.7
    * Roles and Capabilities system @ v1.7 for controlling who can do what
    * Forms library @ v1.8 for creating accessible and secure HTML forms that let users edit things


[edit] Core libraries with a more specific uses
*[[Development:Lesson Specification|Lesson Specification]]
*[[Quiz developer docs|Quiz module]]
*[[SCORM schema|SCORM module 1.5 schema]]


    * Authentication API
==How you can contribute==
    * Cookieless Sessions
    * Email processing
    * Environment checking before install, check the user's server to ensure Moodle will work there.
    * Groups system
    * Gradebook
    * Moodle Network
    * Question engine
    * Stats package
    * Migration to UTF-8 @ v1.6
    * YUI JavaScript library - YUI was selected as the official AJAX library for Moodle.
    * lib/graphlib
    * Admin settings


[edit] Modules included in the standard distribution
===Make a new plugin===
 
    * Lesson Specification
    * Quiz module
    * SCORM module 1.5 schema
 
[edit] How you can contribute
[edit] 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:
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]]
    * Activity modules
*[[Development:Admin reports|Admin reports]]
    * Admin reports
*[[Development:Assignment types|Assignment types]]
    * Assignment types
*[[Development:Authentication plugins|Authentication plugins]]
    * Authentication plugins
*[[Development:Blocks|Blocks]]
    * Blocks
*[[Course formats]]
    * Course formats
*[[Development:Course Report Plugins|Course reports]]
    * Course reports
*[[Development:Database fields|Database fields]]
    * Database fields
*[[Development:Database presets|Database presets]]
    * Database presets
*[[Development:Enrolment plugins|Enrolment plugins]]
    * Enrolment plugins
*[[Development:Filters|Filters]]
    * Filters
*[[Development:Gradebook plugins|Gradebook plugins]]
    * Gradebook plugins
**[[Development:Gradebook_Report_Tutorial|Gradebook report]]
          o Gradebook report
**[[Development:Gradebook export|Gradebook export]]
          o Gradebook export
**[[Development:Gradebook import|Gradebook import]]
          o Gradebook import  
*[[Development:Writing_a_Portfolio_Plugin|Portfolio Plugins]]
    * Portfolio Plugins
*[[Development:Question_type_plugin_how_to|Question types]]
    * Question types
*[[Development:Question import/export formats|Question import/export formats]]
    * Question import/export formats
*[[Development:How to write a quiz report plugin|Quiz reports]]
    * Quiz reports
*[[Development:Repository plugins|Repository plugins]]
    * Repository plugins
*[[Development:Resource types|Resource types]]
    * Resource types
*[[Development: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]]
*[[Development:Installing and upgrading plugin database tables|Defining the database tables for your plugin]]


    * Where to put language strings 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.
    * Defining the database tables for your plugin


Please see the Guidelines for contributed code for an overview of how to contribute to the Moodle code.
===Change core code===
[edit] 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.
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.
[edit] Ways to contribute that do not involve PHP programming


    * Create Moodle themes
===Ways to contribute that do not involve PHP programming===
    * Translate Moodle into other languages
    * Help document Moodle
    * Database schemas
    * Join the testing effort, which involves participating in the bug tracker


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


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.
==Plans for the future==


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


    * Roadmap
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.
    * Developer notes
    * Student projects
    * Developer meetings


[edit] Resources and tools
*[[Roadmap]]
*[[Development:Developer notes|Developer notes]]
*[[Student projects]]
*[[Developer meetings]]


    * Developer FAQ - frequently asked questions, especially useful for newcomers to Moodle
== Resources and tools ==
    * Finding your way into the Moodle code - also aimed at newcomers
    * Moodle tracker - bug reports, feature requests and other tracked issues
          o 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:
          o the code with a complete change history from CVS
          o the code, with links generated by PHPXref
    * Moodle PHP doc reference - compiled from the comment attached to each class and function in the code
    * Database Schema - for recent releases
    * Development news and discussion section of Using Moodle course
          o especially the General developer forum
          o cool tricks you can use in the moodle.org forums
    * Some tools people use when working on Moodle code:
          o 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.
          o Setting up Vim for Moodle development
          o Setting up Netbeans for Moodle development - Netbeans Early Acces for PHP is a great out-of-the-box editor.
          o Ctags - Using a tags file to navigate code
          o W3C HTML validator - Moodle has built in support to make using it easier.
          o Firebug plugin for Firefox.
    * Windows Installer - Windows Installer documentation for developer.


[edit] See also
*[[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
*[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://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://phpdocs.moodle.org/ Moodle PHP doc reference] - compiled from the comment attached to each class and function in the code
*[[Development: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]
**[[Filters used on the Moodle.org forums|cool tricks you can use in the moodle.org forums]]
*Some tools people use when working on Moodle code:
**[[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: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
**[[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.


    * Moodle Security Centre
==See also==
    * Moodle Partners - providers of custom Moodle development services


Retrieved from "https://docs.moodle.org/en/Development:Developer_documentation"
*[http://security.moodle.org/ Moodle Security Centre]
*[http://moodle.com/partners/ Moodle Partners] - providers of custom Moodle development services


Category: Developer
[[Category:Developer]]
[[es:Documentación para Desarrolladores]]
[[fr:Documentation développeur]]
[[pt:Desenvolvimento:Documentação para programadores]]
[[zh:开发者文档]]
[[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