Aquesta pàgina forma part de la documentació de Moodle en català, tot i que no ha estat traduïda encara. Podeu contribuir obertament a les tasques de traducció. Podeu consultar la Guia d'edició de la documentació i també participar ens els debats del fòrum de traductors de la documentació a moodle.org

Patch: diferència entre les revisions

De MoodleDocs
Salta a:navegació, cerca
(Added wikipedia link)
(Shifted to dev docs)
 
(2 revisions intermèdies per 2 usuaris que no es mostren)
Línia 1: Línia 1:
[http://en.wikipedia.org/wiki/Patch_(Unix) Patch] is the unix program which alters one or more text files by following the instructions in a patch file. Diff is the unix program used to create the patches by comparing two similar files e.g. a file from a standard copy of Moodle and a copy of that file that a programmer has added some code to.
{{Moved_to_dev_docs}}
 
The reason for using it is that some files in Moodle are very large, so it may be that two programmers are working on separate improvements which you wish to apply to your copy of Moodle, but this can't be done by just downloading two modified versions of the file as each one will only contain one set of changes. Patches insert new code at specific points and leave the rest of the file untouched, so you can apply many of them to the same file with no interference between them.
 
Most linux distributions come with Patch already installed, but you may need to install it using whatever method your distribution requires. Patch for windows can be downloaded from [http://gnuwin32.sourceforge.net/packages/patch.htm sourceforge].
 
How to patch a file
 
# download the patch
# open it in a text editor and look for the line at the top which references a filename. If it says e.g. --- a/admin/roles/assign.php then put it in the main moodle directory, where the path starts from (ignoring the a). If it just says --- a/assign.php then it will need to go into /admin/roles/ or wherever.
# if you are using Windows, click Start->run then type cmd and press enter. If Liunx, open a terminal
# navigate to the directory that you put the file into
# type the following: patch -p0 < filename.patch

Revisió de 07:56, 22 juny 2011

This development related page is now located in the Dev docs.

See the Patch page in the Dev docs.