Merge lp:~yoboy-leguesh/ubuntu-fr-doc/maj20150810a into lp:ubuntu-fr-doc

Proposed by YoBoY
Status: Merged
Merged at revision: 131
Proposed branch: lp:~yoboy-leguesh/ubuntu-fr-doc/maj20150810a
Merge into: lp:ubuntu-fr-doc
Diff against target: 222970 lines (+107307/-83110)
1447 files modified
README (+1/-1)
VERSION (+1/-1)
bin/dwpage.php (+314/-374)
bin/gittool.php (+119/-123)
bin/indexer.php (+97/-92)
bin/render.php (+50/-56)
bin/striplangs.php (+99/-136)
bin/wantedpages.php (+149/-130)
conf/interwiki.conf (+27/-23)
conf/mime.conf (+4/-1)
conf/mysql.conf.php.example (+5/-5)
conf/wordblock.conf (+1/-5)
doku.php (+43/-4)
feed.php (+10/-6)
inc/DifferenceEngine.php (+67/-19)
inc/Form/ButtonElement.php (+34/-0)
inc/Form/CheckableElement.php (+62/-0)
inc/Form/Element.php (+151/-0)
inc/Form/FieldsetCloseElement.php (+30/-0)
inc/Form/FieldsetOpenElement.php (+36/-0)
inc/Form/Form.php (+426/-0)
inc/Form/HTMLElement.php (+29/-0)
inc/Form/InputElement.php (+161/-0)
inc/Form/LabelElement.php (+27/-0)
inc/Form/LegacyForm.php (+181/-0)
inc/Form/TagCloseElement.php (+76/-0)
inc/Form/TagElement.php (+29/-0)
inc/Form/TagOpenElement.php (+30/-0)
inc/Form/TextareaElement.php (+51/-0)
inc/Form/ValueElement.php (+45/-0)
inc/HTTPClient.php (+77/-19)
inc/IXR_Library.php (+499/-184)
inc/Input.class.php (+51/-16)
inc/JSON.php (+1/-1)
inc/JpegMeta.php (+133/-7)
inc/Mailer.class.php (+21/-10)
inc/PassHash.class.php (+15/-10)
inc/RemoteAPICore.php (+133/-5)
inc/Sitemapper.php (+14/-8)
inc/Tar.class.php (+21/-4)
inc/TarLib.class.php (+0/-87)
inc/ZipLib.class.php (+77/-5)
inc/actions.php (+49/-19)
inc/auth.php (+56/-39)
inc/blowfish.php (+8/-7)
inc/cache.php (+10/-9)
inc/changelog.php (+73/-21)
inc/cli.php (+652/-0)
inc/cliopts.php (+7/-6)
inc/common.php (+201/-64)
inc/compatibility.php (+46/-0)
inc/config_cascade.php (+59/-55)
inc/confutils.php (+54/-10)
inc/events.php (+23/-16)
inc/farm.php (+5/-5)
inc/feedcreator.class.php (+45/-11)
inc/fetch.functions.php (+35/-8)
inc/form.php (+105/-11)
inc/fulltext.php (+49/-1)
inc/geshi.php (+0/-4775)
inc/geshi/4cs.php (+0/-139)
inc/geshi/6502acme.php (+0/-230)
inc/geshi/6502kickass.php (+0/-241)
inc/geshi/6502tasm.php (+0/-189)
inc/geshi/68000devpac.php (+0/-168)
inc/geshi/abap.php (+0/-1409)
inc/geshi/actionscript-french.php (+0/-957)
inc/geshi/actionscript.php (+0/-197)
inc/geshi/actionscript3.php (+0/-473)
inc/geshi/ada.php (+0/-135)
inc/geshi/algol68.php (+0/-329)
inc/geshi/apache.php (+0/-483)
inc/geshi/applescript.php (+0/-157)
inc/geshi/apt_sources.php (+0/-148)
inc/geshi/arm.php (+0/-3318)
inc/geshi/asm.php (+0/-603)
inc/geshi/asp.php (+0/-164)
inc/geshi/asymptote.php (+0/-194)
inc/geshi/autoconf.php (+0/-512)
inc/geshi/autohotkey.php (+0/-373)
inc/geshi/autoit.php (+0/-1175)
inc/geshi/avisynth.php (+0/-194)
inc/geshi/awk.php (+0/-158)
inc/geshi/bascomavr.php (+0/-185)
inc/geshi/bash.php (+0/-440)
inc/geshi/basic4gl.php (+0/-341)
inc/geshi/bf.php (+0/-115)
inc/geshi/bibtex.php (+0/-183)
inc/geshi/blitzbasic.php (+0/-185)
inc/geshi/bnf.php (+0/-119)
inc/geshi/boo.php (+0/-217)
inc/geshi/c.php (+0/-281)
inc/geshi/c_loadrunner.php (+0/-323)
inc/geshi/c_mac.php (+0/-227)
inc/geshi/caddcl.php (+0/-126)
inc/geshi/cadlisp.php (+0/-186)
inc/geshi/cfdg.php (+0/-124)
inc/geshi/cfm.php (+0/-299)
inc/geshi/chaiscript.php (+0/-140)
inc/geshi/cil.php (+0/-196)
inc/geshi/clojure.php (+0/-134)
inc/geshi/cmake.php (+0/-181)
inc/geshi/cobol.php (+0/-244)
inc/geshi/coffeescript.php (+0/-146)
inc/geshi/cpp-qt.php (+0/-564)
inc/geshi/cpp.php (+0/-240)
inc/geshi/csharp.php (+0/-256)
inc/geshi/css.php (+0/-226)
inc/geshi/cuesheet.php (+0/-138)
inc/geshi/d.php (+0/-252)
inc/geshi/dcl.php (+0/-192)
inc/geshi/dcpu16.php (+0/-131)
inc/geshi/dcs.php (+0/-182)
inc/geshi/delphi.php (+0/-301)
inc/geshi/diff.php (+0/-196)
inc/geshi/div.php (+0/-126)
inc/geshi/dos.php (+0/-227)
inc/geshi/dot.php (+0/-164)
inc/geshi/e.php (+0/-208)
inc/geshi/ecmascript.php (+0/-210)
inc/geshi/eiffel.php (+0/-395)
inc/geshi/email.php (+0/-222)
inc/geshi/epc.php (+0/-154)
inc/geshi/erlang.php (+0/-441)
inc/geshi/euphoria.php (+0/-140)
inc/geshi/f1.php (+0/-151)
inc/geshi/falcon.php (+0/-218)
inc/geshi/fo.php (+0/-327)
inc/geshi/fortran.php (+0/-160)
inc/geshi/freebasic.php (+0/-141)
inc/geshi/freeswitch.php (+0/-168)
inc/geshi/fsharp.php (+0/-213)
inc/geshi/gambas.php (+0/-214)
inc/geshi/gdb.php (+0/-198)
inc/geshi/genero.php (+0/-463)
inc/geshi/genie.php (+0/-157)
inc/geshi/gettext.php (+0/-97)
inc/geshi/glsl.php (+0/-205)
inc/geshi/gml.php (+0/-506)
inc/geshi/gnuplot.php (+0/-296)
inc/geshi/go.php (+0/-375)
inc/geshi/groovy.php (+0/-1011)
inc/geshi/gwbasic.php (+0/-153)
inc/geshi/haskell.php (+0/-202)
inc/geshi/haxe.php (+0/-161)
inc/geshi/hicest.php (+0/-108)
inc/geshi/hq9plus.php (+0/-104)
inc/geshi/html4strict.php (+0/-190)
inc/geshi/html5.php (+0/-212)
inc/geshi/icon.php (+0/-212)
inc/geshi/idl.php (+0/-123)
inc/geshi/ini.php (+0/-128)
inc/geshi/inno.php (+0/-212)
inc/geshi/intercal.php (+0/-122)
inc/geshi/io.php (+0/-138)
inc/geshi/j.php (+0/-190)
inc/geshi/java.php (+0/-983)
inc/geshi/java5.php (+0/-1037)
inc/geshi/javascript.php (+0/-174)
inc/geshi/jquery.php (+0/-238)
inc/geshi/kixtart.php (+0/-329)
inc/geshi/klonec.php (+0/-282)
inc/geshi/klonecpp.php (+0/-310)
inc/geshi/latex.php (+0/-223)
inc/geshi/lb.php (+0/-162)
inc/geshi/ldif.php (+0/-116)
inc/geshi/lisp.php (+0/-144)
inc/geshi/llvm.php (+0/-385)
inc/geshi/locobasic.php (+0/-130)
inc/geshi/logtalk.php (+0/-345)
inc/geshi/lolcode.php (+0/-152)
inc/geshi/lotusformulas.php (+0/-318)
inc/geshi/lotusscript.php (+0/-191)
inc/geshi/lscript.php (+0/-387)
inc/geshi/lsl2.php (+0/-898)
inc/geshi/lua.php (+0/-177)
inc/geshi/m68k.php (+0/-143)
inc/geshi/magiksf.php (+0/-193)
inc/geshi/make.php (+0/-151)
inc/geshi/mapbasic.php (+0/-908)
inc/geshi/matlab.php (+0/-227)
inc/geshi/mirc.php (+0/-171)
inc/geshi/mmix.php (+0/-193)
inc/geshi/modula2.php (+0/-136)
inc/geshi/modula3.php (+0/-135)
inc/geshi/mpasm.php (+0/-164)
inc/geshi/mxml.php (+0/-145)
inc/geshi/mysql.php (+0/-475)
inc/geshi/nagios.php (+0/-225)
inc/geshi/netrexx.php (+0/-163)
inc/geshi/newlisp.php (+0/-191)
inc/geshi/nsis.php (+0/-351)
inc/geshi/oberon2.php (+0/-135)
inc/geshi/objc.php (+0/-358)
inc/geshi/objeck.php (+0/-116)
inc/geshi/ocaml-brief.php (+0/-112)
inc/geshi/ocaml.php (+0/-187)
inc/geshi/octave.php (+0/-515)
inc/geshi/oobas.php (+0/-135)
inc/geshi/oorexx.php (+0/-171)
inc/geshi/oracle11.php (+0/-614)
inc/geshi/oracle8.php (+0/-496)
inc/geshi/oxygene.php (+0/-154)
inc/geshi/oz.php (+0/-144)
inc/geshi/parasail.php (+0/-133)
inc/geshi/parigp.php (+0/-277)
inc/geshi/pascal.php (+0/-165)
inc/geshi/pcre.php (+0/-188)
inc/geshi/per.php (+0/-302)
inc/geshi/perl.php (+0/-213)
inc/geshi/perl6.php (+0/-197)
inc/geshi/pf.php (+0/-178)
inc/geshi/php-brief.php (+0/-222)
inc/geshi/php.php (+0/-1117)
inc/geshi/pic16.php (+0/-141)
inc/geshi/pike.php (+0/-103)
inc/geshi/pixelbender.php (+0/-176)
inc/geshi/pli.php (+0/-200)
inc/geshi/plsql.php (+0/-256)
inc/geshi/postgresql.php (+0/-288)
inc/geshi/povray.php (+0/-199)
inc/geshi/powerbuilder.php (+0/-418)
inc/geshi/powershell.php (+0/-277)
inc/geshi/proftpd.php (+0/-374)
inc/geshi/progress.php (+0/-485)
inc/geshi/prolog.php (+0/-143)
inc/geshi/properties.php (+0/-127)
inc/geshi/providex.php (+0/-299)
inc/geshi/purebasic.php (+0/-303)
inc/geshi/pycon.php (+0/-64)
inc/geshi/pys60.php (+0/-273)
inc/geshi/python.php (+0/-244)
inc/geshi/q.php (+0/-149)
inc/geshi/qbasic.php (+0/-162)
inc/geshi/rails.php (+0/-406)
inc/geshi/rebol.php (+0/-196)
inc/geshi/reg.php (+0/-233)
inc/geshi/rexx.php (+0/-162)
inc/geshi/robots.php (+0/-100)
inc/geshi/rpmspec.php (+0/-133)
inc/geshi/rsplus.php (+0/-483)
inc/geshi/ruby.php (+0/-231)
inc/geshi/sas.php (+0/-290)
inc/geshi/scala.php (+0/-138)
inc/geshi/scheme.php (+0/-170)
inc/geshi/scilab.php (+0/-295)
inc/geshi/sdlbasic.php (+0/-165)
inc/geshi/smalltalk.php (+0/-154)
inc/geshi/smarty.php (+0/-192)
inc/geshi/spark.php (+0/-132)
inc/geshi/sparql.php (+0/-155)
inc/geshi/sql.php (+0/-165)
inc/geshi/stonescript.php (+0/-307)
inc/geshi/systemverilog.php (+0/-317)
inc/geshi/tcl.php (+0/-194)
inc/geshi/teraterm.php (+0/-354)
inc/geshi/text.php (+0/-84)
inc/geshi/thinbasic.php (+0/-868)
inc/geshi/tsql.php (+0/-375)
inc/geshi/typoscript.php (+0/-300)
inc/geshi/unicon.php (+0/-210)
inc/geshi/upc.php (+0/-270)
inc/geshi/urbi.php (+0/-200)
inc/geshi/uscript.php (+0/-299)
inc/geshi/vala.php (+0/-151)
inc/geshi/vb.php (+0/-157)
inc/geshi/vbnet.php (+0/-182)
inc/geshi/vedit.php (+0/-103)
inc/geshi/verilog.php (+0/-173)
inc/geshi/vhdl.php (+0/-183)
inc/geshi/vim.php (+0/-420)
inc/geshi/visualfoxpro.php (+0/-456)
inc/geshi/visualprolog.php (+0/-129)
inc/geshi/whitespace.php (+0/-121)
inc/geshi/whois.php (+0/-181)
inc/geshi/winbatch.php (+0/-369)
inc/geshi/xbasic.php (+0/-143)
inc/geshi/xml.php (+0/-157)
inc/geshi/xorg_conf.php (+0/-124)
inc/geshi/xpp.php (+0/-436)
inc/geshi/yaml.php (+0/-150)
inc/geshi/z80.php (+0/-144)
inc/geshi/zxbasic.php (+0/-150)
inc/html.php (+144/-26)
inc/httputils.php (+11/-0)
inc/indexer.php (+73/-16)
inc/infoutils.php (+59/-16)
inc/init.php (+47/-26)
inc/io.php (+203/-72)
inc/lang/af/jquery.ui.datepicker.js (+35/-21)
inc/lang/af/lang.php (+4/-6)
inc/lang/ar/jquery.ui.datepicker.js (+37/-22)
inc/lang/ar/lang.php (+36/-32)
inc/lang/ar/register.txt (+1/-1)
inc/lang/ar/searchpage.txt (+1/-1)
inc/lang/ar/stopwords.txt (+163/-0)
inc/lang/az/jquery.ui.datepicker.js (+35/-21)
inc/lang/az/lang.php (+18/-20)
inc/lang/az/searchpage.txt (+1/-1)
inc/lang/bg/jquery.ui.datepicker.js (+36/-22)
inc/lang/bg/lang.php (+32/-29)
inc/lang/bg/searchpage.txt (+1/-1)
inc/lang/bn/lang.php (+81/-15)
inc/lang/ca-valencia/lang.php (+19/-21)
inc/lang/ca-valencia/searchpage.txt (+1/-1)
inc/lang/ca/jquery.ui.datepicker.js (+35/-21)
inc/lang/ca/lang.php (+48/-27)
inc/lang/ca/searchpage.txt (+1/-1)
inc/lang/ca/subscr_form.txt (+1/-1)
inc/lang/cs/adminplugins.txt (+1/-1)
inc/lang/cs/jquery.ui.datepicker.js (+35/-21)
inc/lang/cs/lang.php (+49/-38)
inc/lang/cs/mailtext.txt (+1/-1)
inc/lang/cs/password.txt (+2/-2)
inc/lang/cs/pwconfirm.txt (+3/-3)
inc/lang/cs/registermail.txt (+1/-1)
inc/lang/cs/resendpwd.txt (+1/-1)
inc/lang/cs/searchpage.txt (+1/-1)
inc/lang/cs/subscr_digest.txt (+3/-3)
inc/lang/cs/subscr_list.txt (+2/-2)
inc/lang/cs/subscr_single.txt (+3/-3)
inc/lang/cs/uploadmail.txt (+2/-2)
inc/lang/da/denied.txt (+1/-1)
inc/lang/da/jquery.ui.datepicker.js (+35/-21)
inc/lang/da/lang.php (+89/-75)
inc/lang/da/searchpage.txt (+1/-1)
inc/lang/de-informal/jquery.ui.datepicker.js (+35/-21)
inc/lang/de-informal/lang.php (+36/-26)
inc/lang/de-informal/searchpage.txt (+1/-1)
inc/lang/de/backlinks.txt (+1/-1)
inc/lang/de/jquery.ui.datepicker.js (+35/-21)
inc/lang/de/lang.php (+36/-25)
inc/lang/de/searchpage.txt (+1/-1)
inc/lang/el/jquery.ui.datepicker.js (+35/-21)
inc/lang/el/lang.php (+23/-27)
inc/lang/el/searchpage.txt (+1/-1)
inc/lang/en/lang.php (+30/-28)
inc/lang/en/searchpage.txt (+1/-1)
inc/lang/eo/jquery.ui.datepicker.js (+35/-21)
inc/lang/eo/lang.php (+23/-26)
inc/lang/eo/searchpage.txt (+1/-1)
inc/lang/es/edit.txt (+1/-1)
inc/lang/es/jquery.ui.datepicker.js (+35/-21)
inc/lang/es/lang.php (+39/-29)
inc/lang/es/searchpage.txt (+1/-1)
inc/lang/es/uploadmail.txt (+2/-1)
inc/lang/et/jquery.ui.datepicker.js (+35/-21)
inc/lang/et/lang.php (+23/-26)
inc/lang/et/searchpage.txt (+1/-1)
inc/lang/eu/jquery.ui.datepicker.js (+35/-22)
inc/lang/eu/lang.php (+26/-26)
inc/lang/eu/searchpage.txt (+1/-1)
inc/lang/fa/index.txt (+2/-2)
inc/lang/fa/jquery.ui.datepicker.js (+70/-56)
inc/lang/fa/lang.php (+64/-45)
inc/lang/fa/searchpage.txt (+1/-1)
inc/lang/fi/jquery.ui.datepicker.js (+35/-21)
inc/lang/fi/lang.php (+31/-28)
inc/lang/fi/searchpage.txt (+1/-1)
inc/lang/fo/jquery.ui.datepicker.js (+35/-21)
inc/lang/fo/lang.php (+24/-26)
inc/lang/fo/searchpage.txt (+1/-1)
inc/lang/fr/denied.txt (+1/-1)
inc/lang/fr/jquery.ui.datepicker.js (+35/-21)
inc/lang/fr/lang.php (+60/-49)
inc/lang/fr/newpage.txt (+1/-1)
inc/lang/fr/searchpage.txt (+1/-1)
inc/lang/fr/subscr_digest.txt (+1/-1)
inc/lang/fr/subscr_form.txt (+2/-2)
inc/lang/fr/subscr_list.txt (+1/-1)
inc/lang/fr/subscr_single.txt (+1/-1)
inc/lang/gl/jquery.ui.datepicker.js (+35/-21)
inc/lang/gl/lang.php (+23/-26)
inc/lang/gl/searchpage.txt (+1/-1)
inc/lang/he/jquery.ui.datepicker.js (+35/-21)
inc/lang/he/lang.php (+52/-31)
inc/lang/he/mailtext.txt (+2/-2)
inc/lang/he/registermail.txt (+2/-2)
inc/lang/he/resetpwd.txt (+3/-0)
inc/lang/he/searchpage.txt (+1/-1)
inc/lang/hi/jquery.ui.datepicker.js (+35/-21)
inc/lang/hi/lang.php (+13/-15)
inc/lang/hr/adminplugins.txt (+1/-0)
inc/lang/hr/backlinks.txt (+2/-2)
inc/lang/hr/draft.txt (+4/-0)
inc/lang/hr/edit.txt (+1/-1)
inc/lang/hr/index.txt (+3/-1)
inc/lang/hr/jquery.ui.datepicker.js (+35/-21)
inc/lang/hr/lang.php (+159/-81)
inc/lang/hr/pwconfirm.txt (+13/-0)
inc/lang/hr/registermail.txt (+14/-0)
inc/lang/hr/resetpwd.txt (+3/-0)
inc/lang/hr/revisions.txt (+1/-1)
inc/lang/hr/searchpage.txt (+5/-1)
inc/lang/hr/showrev.txt (+1/-1)
inc/lang/hr/subscr_digest.txt (+19/-0)
inc/lang/hr/subscr_form.txt (+3/-0)
inc/lang/hr/subscr_list.txt (+15/-0)
inc/lang/hr/subscr_single.txt (+22/-0)
inc/lang/hr/uploadmail.txt (+15/-0)
inc/lang/hu/admin.txt (+2/-2)
inc/lang/hu/jquery.ui.datepicker.js (+35/-22)
inc/lang/hu/lang.php (+33/-24)
inc/lang/hu/searchpage.txt (+1/-1)
inc/lang/ia/lang.php (+19/-21)
inc/lang/ia/searchpage.txt (+1/-1)
inc/lang/id-ni/lang.php (+2/-3)
inc/lang/id/jquery.ui.datepicker.js (+35/-21)
inc/lang/id/lang.php (+27/-44)
inc/lang/id/searchpage.txt (+1/-1)
inc/lang/is/jquery.ui.datepicker.js (+35/-21)
inc/lang/is/lang.php (+18/-21)
inc/lang/it/jquery.ui.datepicker.js (+35/-21)
inc/lang/it/lang.php (+43/-26)
inc/lang/it/searchpage.txt (+1/-1)
inc/lang/ja/index.txt (+1/-1)
inc/lang/ja/jquery.ui.datepicker.js (+35/-21)
inc/lang/ja/lang.php (+36/-27)
inc/lang/ja/register.txt (+1/-1)
inc/lang/ja/searchpage.txt (+1/-1)
inc/lang/ka/jquery.ui.datepicker.js (+35/-0)
inc/lang/ka/lang.php (+151/-12)
inc/lang/kk/jquery.ui.datepicker.js (+35/-21)
inc/lang/kk/lang.php (+9/-10)
inc/lang/km/jquery.ui.datepicker.js (+35/-21)
inc/lang/km/lang.php (+21/-27)
inc/lang/ko/backlinks.txt (+1/-1)
inc/lang/ko/denied.txt (+1/-2)
inc/lang/ko/draft.txt (+1/-1)
inc/lang/ko/edit.txt (+1/-1)
inc/lang/ko/jquery.ui.datepicker.js (+35/-21)
inc/lang/ko/lang.php (+50/-44)
inc/lang/ko/searchpage.txt (+1/-1)
inc/lang/ko/updateprofile.txt (+1/-1)
inc/lang/ku/admin.txt (+0/-4)
inc/lang/ku/denied.txt (+0/-4)
inc/lang/ku/editrev.txt (+0/-2)
inc/lang/ku/lang.php (+4/-100)
inc/lang/ku/locked.txt (+0/-3)
inc/lang/ku/login.txt (+0/-4)
inc/lang/ku/mailtext.txt (+0/-17)
inc/lang/ku/norev.txt (+0/-4)
inc/lang/ku/password.txt (+0/-10)
inc/lang/ku/read.txt (+0/-2)
inc/lang/ku/register.txt (+0/-4)
inc/lang/ku/revisions.txt (+0/-4)
inc/lang/ku/searchpage.txt (+1/-1)
inc/lang/ku/showrev.txt (+0/-2)
inc/lang/ku/stopwords.txt (+0/-29)
inc/lang/la/lang.php (+16/-19)
inc/lang/la/searchpage.txt (+1/-1)
inc/lang/lb/jquery.ui.datepicker.js (+35/-21)
inc/lang/lb/lang.php (+19/-21)
inc/lang/lb/searchpage.txt (+1/-1)
inc/lang/lt/jquery.ui.datepicker.js (+35/-21)
inc/lang/lt/lang.php (+29/-30)
inc/lang/lt/searchpage.txt (+1/-1)
inc/lang/lv/jquery.ui.datepicker.js (+35/-21)
inc/lang/lv/lang.php (+43/-28)
inc/lang/lv/searchpage.txt (+2/-1)
inc/lang/mg/lang.php (+6/-9)
inc/lang/mg/searchpage.txt (+1/-1)
inc/lang/mk/jquery.ui.datepicker.js (+35/-21)
inc/lang/mk/lang.php (+21/-22)
inc/lang/ml/admin.txt (+3/-0)
inc/lang/mr/lang.php (+19/-21)
inc/lang/mr/searchpage.txt (+1/-1)
inc/lang/ms/jquery.ui.datepicker.js (+35/-21)
inc/lang/ms/lang.php (+4/-6)
inc/lang/ne/adminplugins.txt (+1/-0)
inc/lang/ne/lang.php (+31/-22)
inc/lang/ne/searchpage.txt (+3/-1)
inc/lang/nl/jquery.ui.datepicker.js (+35/-21)
inc/lang/nl/lang.php (+36/-27)
inc/lang/nl/searchpage.txt (+1/-1)
inc/lang/no/jquery.ui.datepicker.js (+34/-20)
inc/lang/no/lang.php (+32/-28)
inc/lang/no/searchpage.txt (+1/-1)
inc/lang/pl/jquery.ui.datepicker.js (+35/-21)
inc/lang/pl/lang.php (+31/-28)
inc/lang/pl/searchpage.txt (+1/-1)
inc/lang/pt-br/jquery.ui.datepicker.js (+35/-21)
inc/lang/pt-br/lang.php (+36/-26)
inc/lang/pt-br/searchpage.txt (+1/-1)
inc/lang/pt/conflict.txt (+5/-9)
inc/lang/pt/denied.txt (+1/-1)
inc/lang/pt/jquery.ui.datepicker.js (+35/-21)
inc/lang/pt/lang.php (+55/-29)
inc/lang/pt/resetpwd.txt (+3/-0)
inc/lang/pt/searchpage.txt (+1/-1)
inc/lang/ro/jquery.ui.datepicker.js (+35/-21)
inc/lang/ro/lang.php (+32/-30)
inc/lang/ro/searchpage.txt (+1/-1)
inc/lang/ru/index.txt (+1/-1)
inc/lang/ru/jquery.ui.datepicker.js (+35/-21)
inc/lang/ru/lang.php (+49/-37)
inc/lang/ru/mailtext.txt (+1/-1)
inc/lang/ru/password.txt (+1/-1)
inc/lang/ru/pwconfirm.txt (+1/-1)
inc/lang/ru/registermail.txt (+1/-1)
inc/lang/ru/revisions.txt (+1/-1)
inc/lang/ru/searchpage.txt (+1/-1)
inc/lang/ru/uploadmail.txt (+1/-1)
inc/lang/sk/jquery.ui.datepicker.js (+35/-21)
inc/lang/sk/lang.php (+19/-22)
inc/lang/sk/searchpage.txt (+1/-1)
inc/lang/sl/jquery.ui.datepicker.js (+35/-21)
inc/lang/sl/lang.php (+21/-24)
inc/lang/sl/searchpage.txt (+1/-1)
inc/lang/sq/jquery.ui.datepicker.js (+35/-21)
inc/lang/sq/lang.php (+23/-25)
inc/lang/sq/searchpage.txt (+1/-1)
inc/lang/sr/jquery.ui.datepicker.js (+35/-21)
inc/lang/sr/lang.php (+19/-21)
inc/lang/sr/searchpage.txt (+1/-1)
inc/lang/sv/jquery.ui.datepicker.js (+35/-21)
inc/lang/sv/lang.php (+25/-27)
inc/lang/sv/searchpage.txt (+1/-1)
inc/lang/ta/admin.txt (+3/-0)
inc/lang/ta/adminplugins.txt (+1/-0)
inc/lang/ta/backlinks.txt (+3/-0)
inc/lang/ta/conflict.txt (+3/-0)
inc/lang/ta/denied.txt (+1/-0)
inc/lang/ta/diff.txt (+3/-0)
inc/lang/ta/draft.txt (+1/-0)
inc/lang/ta/edit.txt (+1/-0)
inc/lang/ta/jquery.ui.datepicker.js (+37/-0)
inc/lang/ta/lang.php (+55/-0)
inc/lang/th/jquery.ui.datepicker.js (+35/-21)
inc/lang/th/lang.php (+42/-39)
inc/lang/th/searchpage.txt (+2/-1)
inc/lang/tr/jquery.ui.datepicker.js (+35/-21)
inc/lang/tr/lang.php (+61/-26)
inc/lang/tr/searchpage.txt (+1/-1)
inc/lang/tr/subscr_form.txt (+3/-0)
inc/lang/uk/jquery.ui.datepicker.js (+35/-21)
inc/lang/uk/lang.php (+46/-24)
inc/lang/uk/searchpage.txt (+1/-1)
inc/lang/vi/jquery.ui.datepicker.js (+35/-21)
inc/lang/vi/lang.php (+21/-21)
inc/lang/vi/searchpage.txt (+1/-1)
inc/lang/zh-tw/jquery.ui.datepicker.js (+35/-21)
inc/lang/zh-tw/lang.php (+34/-31)
inc/lang/zh-tw/searchpage.txt (+1/-1)
inc/lang/zh/jquery.ui.datepicker.js (+35/-21)
inc/lang/zh/lang.php (+31/-24)
inc/lang/zh/searchpage.txt (+1/-1)
inc/load.php (+11/-3)
inc/mail.php (+14/-3)
inc/media.php (+293/-93)
inc/pageutils.php (+115/-20)
inc/parser/code.php (+11/-6)
inc/parser/handler.php (+57/-26)
inc/parser/lexer.php (+19/-14)
inc/parser/metadata.php (+448/-230)
inc/parser/parser.php (+30/-16)
inc/parser/renderer.php (+746/-230)
inc/parser/xhtml.php (+847/-386)
inc/parserutils.php (+71/-22)
inc/phpseclib/Crypt_AES.php (+2/-2)
inc/phpseclib/Crypt_Base.php (+1/-1)
inc/phpseclib/Crypt_Hash.php (+1/-1)
inc/phpseclib/Crypt_Rijndael.php (+2/-2)
inc/plugin.php (+84/-44)
inc/plugincontroller.class.php (+29/-25)
inc/pluginutils.php (+34/-3)
inc/remote.php (+103/-6)
inc/search.php (+6/-1)
inc/subscription.php (+10/-22)
inc/template.php (+242/-117)
inc/utf8.php (+95/-34)
lib/exe/ajax.php (+1/-1)
lib/exe/css.php (+84/-39)
lib/exe/detail.php (+3/-2)
lib/exe/indexer.php (+7/-6)
lib/exe/js.php (+66/-32)
lib/exe/mediamanager.php (+1/-0)
lib/exe/xmlrpc.php (+14/-1)
lib/images/admin/README (+2/-0)
lib/images/smileys/index.php (+1/-1)
lib/plugins/acl/admin.php (+12/-19)
lib/plugins/acl/lang/ar/lang.php (+2/-2)
lib/plugins/acl/lang/bg/lang.php (+2/-2)
lib/plugins/acl/lang/ca-valencia/lang.php (+2/-2)
lib/plugins/acl/lang/ca/lang.php (+4/-4)
lib/plugins/acl/lang/cs/help.txt (+6/-9)
lib/plugins/acl/lang/cs/lang.php (+2/-2)
lib/plugins/acl/lang/da/lang.php (+2/-2)
lib/plugins/acl/lang/de-informal/lang.php (+2/-2)
lib/plugins/acl/lang/de/lang.php (+2/-2)
lib/plugins/acl/lang/el/lang.php (+2/-2)
lib/plugins/acl/lang/en/lang.php (+2/-2)
lib/plugins/acl/lang/eo/lang.php (+2/-2)
lib/plugins/acl/lang/es/lang.php (+2/-2)
lib/plugins/acl/lang/et/lang.php (+2/-2)
lib/plugins/acl/lang/eu/lang.php (+5/-4)
lib/plugins/acl/lang/fa/lang.php (+2/-2)
lib/plugins/acl/lang/fi/lang.php (+2/-2)
lib/plugins/acl/lang/fr/help.txt (+1/-1)
lib/plugins/acl/lang/fr/lang.php (+2/-2)
lib/plugins/acl/lang/gl/lang.php (+2/-2)
lib/plugins/acl/lang/he/lang.php (+2/-2)
lib/plugins/acl/lang/hr/lang.php (+5/-4)
lib/plugins/acl/lang/ia/lang.php (+2/-2)
lib/plugins/acl/lang/id/lang.php (+2/-2)
lib/plugins/acl/lang/is/lang.php (+2/-2)
lib/plugins/acl/lang/it/lang.php (+2/-2)
lib/plugins/acl/lang/ja/help.txt (+8/-11)
lib/plugins/acl/lang/ja/lang.php (+2/-2)
lib/plugins/acl/lang/kk/lang.php (+2/-2)
lib/plugins/acl/lang/ko/lang.php (+6/-6)
lib/plugins/acl/lang/la/lang.php (+2/-2)
lib/plugins/acl/lang/lt/lang.php (+4/-4)
lib/plugins/acl/lang/lv/lang.php (+4/-4)
lib/plugins/acl/lang/mk/lang.php (+2/-2)
lib/plugins/acl/lang/mr/lang.php (+2/-2)
lib/plugins/acl/lang/ne/lang.php (+2/-2)
lib/plugins/acl/lang/nl/lang.php (+2/-2)
lib/plugins/acl/lang/no/lang.php (+2/-2)
lib/plugins/acl/lang/pl/lang.php (+2/-2)
lib/plugins/acl/lang/pt-br/lang.php (+2/-2)
lib/plugins/acl/lang/pt/lang.php (+2/-2)
lib/plugins/acl/lang/ro/lang.php (+5/-4)
lib/plugins/acl/lang/ru/lang.php (+2/-2)
lib/plugins/acl/lang/sk/lang.php (+2/-2)
lib/plugins/acl/lang/sl/lang.php (+2/-2)
lib/plugins/acl/lang/sq/lang.php (+2/-2)
lib/plugins/acl/lang/sr/lang.php (+2/-2)
lib/plugins/acl/lang/sv/lang.php (+2/-2)
lib/plugins/acl/lang/th/lang.php (+5/-4)
lib/plugins/acl/lang/tr/lang.php (+2/-2)
lib/plugins/acl/lang/uk/lang.php (+2/-2)
lib/plugins/acl/lang/vi/lang.php (+2/-2)
lib/plugins/acl/lang/zh-tw/lang.php (+2/-2)
lib/plugins/acl/lang/zh/lang.php (+2/-2)
lib/plugins/acl/plugin.info.txt (+1/-1)
lib/plugins/acl/remote.php (+39/-3)
lib/plugins/acl/script.js (+1/-1)
lib/plugins/acl/style.css (+0/-4)
lib/plugins/action.php (+2/-0)
lib/plugins/admin.php (+38/-6)
lib/plugins/auth.php (+11/-7)
lib/plugins/authad/action.php (+1/-1)
lib/plugins/authad/adLDAP/adLDAP.php (+0/-2)
lib/plugins/authad/auth.php (+178/-23)
lib/plugins/authad/lang/ar/lang.php (+10/-0)
lib/plugins/authad/lang/bg/lang.php (+8/-0)
lib/plugins/authad/lang/ca/lang.php (+8/-0)
lib/plugins/authad/lang/cs/lang.php (+12/-0)
lib/plugins/authad/lang/cs/settings.php (+2/-0)
lib/plugins/authad/lang/da/lang.php (+10/-0)
lib/plugins/authad/lang/de-informal/lang.php (+11/-0)
lib/plugins/authad/lang/de/lang.php (+4/-0)
lib/plugins/authad/lang/el/lang.php (+8/-0)
lib/plugins/authad/lang/en/lang.php (+5/-1)
lib/plugins/authad/lang/eo/lang.php (+1/-0)
lib/plugins/authad/lang/es/lang.php (+5/-0)
lib/plugins/authad/lang/et/lang.php (+8/-0)
lib/plugins/authad/lang/eu/lang.php (+8/-0)
lib/plugins/authad/lang/fa/lang.php (+10/-0)
lib/plugins/authad/lang/fa/settings.php (+10/-0)
lib/plugins/authad/lang/fi/lang.php (+8/-0)
lib/plugins/authad/lang/fr/lang.php (+5/-0)
lib/plugins/authad/lang/gl/lang.php (+8/-0)
lib/plugins/authad/lang/he/lang.php (+10/-0)
lib/plugins/authad/lang/he/settings.php (+8/-0)
lib/plugins/authad/lang/hr/lang.php (+11/-0)
lib/plugins/authad/lang/hr/settings.php (+20/-0)
lib/plugins/authad/lang/hu/lang.php (+11/-0)
lib/plugins/authad/lang/it/lang.php (+8/-0)
lib/plugins/authad/lang/ja/lang.php (+13/-0)
lib/plugins/authad/lang/ja/settings.php (+2/-0)
lib/plugins/authad/lang/ka/lang.php (+8/-0)
lib/plugins/authad/lang/ko/lang.php (+3/-0)
lib/plugins/authad/lang/lv/lang.php (+9/-0)
lib/plugins/authad/lang/lv/settings.php (+11/-0)
lib/plugins/authad/lang/nl/lang.php (+5/-0)
lib/plugins/authad/lang/no/lang.php (+13/-0)
lib/plugins/authad/lang/no/settings.php (+5/-0)
lib/plugins/authad/lang/pl/lang.php (+8/-0)
lib/plugins/authad/lang/pl/settings.php (+2/-0)
lib/plugins/authad/lang/pt-br/lang.php (+12/-0)
lib/plugins/authad/lang/pt/lang.php (+13/-0)
lib/plugins/authad/lang/pt/settings.php (+11/-0)
lib/plugins/authad/lang/ro/lang.php (+8/-0)
lib/plugins/authad/lang/ru/lang.php (+4/-0)
lib/plugins/authad/lang/ru/settings.php (+10/-1)
lib/plugins/authad/lang/sk/lang.php (+8/-0)
lib/plugins/authad/lang/sl/lang.php (+8/-0)
lib/plugins/authad/lang/sv/lang.php (+8/-0)
lib/plugins/authad/lang/tr/lang.php (+8/-0)
lib/plugins/authad/lang/zh-tw/lang.php (+10/-0)
lib/plugins/authad/lang/zh-tw/settings.php (+2/-0)
lib/plugins/authad/lang/zh/lang.php (+12/-0)
lib/plugins/authad/plugin.info.txt (+1/-1)
lib/plugins/authldap/auth.php (+81/-16)
lib/plugins/authldap/conf/default.php (+4/-2)
lib/plugins/authldap/conf/metadata.php (+3/-1)
lib/plugins/authldap/lang/cs/lang.php (+9/-0)
lib/plugins/authldap/lang/cs/settings.php (+11/-0)
lib/plugins/authldap/lang/da/settings.php (+5/-0)
lib/plugins/authldap/lang/de/lang.php (+9/-0)
lib/plugins/authldap/lang/de/settings.php (+7/-0)
lib/plugins/authldap/lang/en/lang.php (+11/-0)
lib/plugins/authldap/lang/en/settings.php (+6/-0)
lib/plugins/authldap/lang/es/lang.php (+8/-0)
lib/plugins/authldap/lang/es/settings.php (+5/-0)
lib/plugins/authldap/lang/fa/settings.php (+10/-0)
lib/plugins/authldap/lang/fr/lang.php (+9/-0)
lib/plugins/authldap/lang/fr/settings.php (+6/-0)
lib/plugins/authldap/lang/he/settings.php (+4/-0)
lib/plugins/authldap/lang/hr/lang.php (+9/-0)
lib/plugins/authldap/lang/hr/settings.php (+32/-0)
lib/plugins/authldap/lang/hu/lang.php (+9/-0)
lib/plugins/authldap/lang/hu/settings.php (+5/-0)
lib/plugins/authldap/lang/it/settings.php (+11/-0)
lib/plugins/authldap/lang/ja/lang.php (+9/-0)
lib/plugins/authldap/lang/ja/settings.php (+13/-0)
lib/plugins/authldap/lang/ko/lang.php (+9/-0)
lib/plugins/authldap/lang/ko/settings.php (+5/-0)
lib/plugins/authldap/lang/lv/settings.php (+9/-0)
lib/plugins/authldap/lang/nl/lang.php (+9/-0)
lib/plugins/authldap/lang/nl/settings.php (+6/-0)
lib/plugins/authldap/lang/no/settings.php (+2/-0)
lib/plugins/authldap/lang/pl/settings.php (+6/-0)
lib/plugins/authldap/lang/pt-br/lang.php (+9/-0)
lib/plugins/authldap/lang/pt-br/settings.php (+6/-0)
lib/plugins/authldap/lang/pt/lang.php (+9/-0)
lib/plugins/authldap/lang/pt/settings.php (+16/-0)
lib/plugins/authldap/lang/ru/lang.php (+9/-0)
lib/plugins/authldap/lang/ru/settings.php (+21/-2)
lib/plugins/authldap/lang/tr/settings.php (+8/-0)
lib/plugins/authldap/lang/zh-tw/settings.php (+4/-4)
lib/plugins/authldap/lang/zh/lang.php (+9/-0)
lib/plugins/authldap/lang/zh/settings.php (+8/-2)
lib/plugins/authldap/plugin.info.txt (+1/-1)
lib/plugins/authmysql/auth.php (+187/-57)
lib/plugins/authmysql/lang/bg/lang.php (+10/-0)
lib/plugins/authmysql/lang/cs/lang.php (+11/-0)
lib/plugins/authmysql/lang/cs/settings.php (+3/-2)
lib/plugins/authmysql/lang/da/settings.php (+6/-2)
lib/plugins/authmysql/lang/de/lang.php (+13/-0)
lib/plugins/authmysql/lang/en/lang.php (+13/-0)
lib/plugins/authmysql/lang/es/lang.php (+11/-0)
lib/plugins/authmysql/lang/es/settings.php (+11/-0)
lib/plugins/authmysql/lang/fa/settings.php (+10/-0)
lib/plugins/authmysql/lang/fi/settings.php (+11/-0)
lib/plugins/authmysql/lang/fr/lang.php (+11/-0)
lib/plugins/authmysql/lang/he/settings.php (+12/-0)
lib/plugins/authmysql/lang/hr/lang.php (+11/-0)
lib/plugins/authmysql/lang/hr/settings.php (+42/-0)
lib/plugins/authmysql/lang/hu/lang.php (+11/-0)
lib/plugins/authmysql/lang/it/lang.php (+11/-0)
lib/plugins/authmysql/lang/it/settings.php (+37/-0)
lib/plugins/authmysql/lang/ja/lang.php (+11/-0)
lib/plugins/authmysql/lang/ja/settings.php (+1/-1)
lib/plugins/authmysql/lang/ko/lang.php (+12/-0)
lib/plugins/authmysql/lang/lv/settings.php (+10/-0)
lib/plugins/authmysql/lang/nl/lang.php (+11/-0)
lib/plugins/authmysql/lang/no/settings.php (+14/-0)
lib/plugins/authmysql/lang/pl/settings.php (+12/-0)
lib/plugins/authmysql/lang/pt-br/lang.php (+11/-0)
lib/plugins/authmysql/lang/pt/lang.php (+10/-0)
lib/plugins/authmysql/lang/pt/settings.php (+20/-0)
lib/plugins/authmysql/lang/ru/lang.php (+11/-0)
lib/plugins/authmysql/lang/ru/settings.php (+4/-2)
lib/plugins/authmysql/lang/tr/lang.php (+9/-0)
lib/plugins/authmysql/lang/tr/settings.php (+41/-0)
lib/plugins/authmysql/lang/zh/lang.php (+11/-0)
lib/plugins/authmysql/plugin.info.txt (+1/-1)
lib/plugins/authpgsql/auth.php (+17/-6)
lib/plugins/authpgsql/lang/cs/settings.php (+3/-2)
lib/plugins/authpgsql/lang/es/settings.php (+32/-0)
lib/plugins/authpgsql/lang/fa/settings.php (+8/-0)
lib/plugins/authpgsql/lang/hr/settings.php (+38/-0)
lib/plugins/authpgsql/lang/it/settings.php (+35/-0)
lib/plugins/authpgsql/lang/ja/settings.php (+1/-1)
lib/plugins/authpgsql/lang/lv/settings.php (+9/-0)
lib/plugins/authpgsql/lang/pl/settings.php (+9/-0)
lib/plugins/authpgsql/lang/pt/settings.php (+17/-0)
lib/plugins/authpgsql/lang/ru/settings.php (+10/-1)
lib/plugins/authpgsql/lang/tr/settings.php (+13/-0)
lib/plugins/authpgsql/plugin.info.txt (+1/-1)
lib/plugins/authplain/auth.php (+86/-29)
lib/plugins/authplain/lang/af/lang.php (+6/-0)
lib/plugins/authplain/lang/ar/lang.php (+6/-0)
lib/plugins/authplain/lang/az/lang.php (+6/-0)
lib/plugins/authplain/lang/bg/lang.php (+9/-0)
lib/plugins/authplain/lang/bn/lang.php (+6/-0)
lib/plugins/authplain/lang/ca-valencia/lang.php (+6/-0)
lib/plugins/authplain/lang/ca/lang.php (+7/-0)
lib/plugins/authplain/lang/cs/lang.php (+10/-0)
lib/plugins/authplain/lang/da/lang.php (+6/-0)
lib/plugins/authplain/lang/de-informal/lang.php (+6/-0)
lib/plugins/authplain/lang/de/lang.php (+10/-0)
lib/plugins/authplain/lang/el/lang.php (+6/-0)
lib/plugins/authplain/lang/en/lang.php (+8/-0)
lib/plugins/authplain/lang/eo/lang.php (+6/-0)
lib/plugins/authplain/lang/es/lang.php (+10/-0)
lib/plugins/authplain/lang/et/lang.php (+6/-0)
lib/plugins/authplain/lang/eu/lang.php (+6/-0)
lib/plugins/authplain/lang/fa/lang.php (+6/-0)
lib/plugins/authplain/lang/fi/lang.php (+6/-0)
lib/plugins/authplain/lang/fo/lang.php (+6/-0)
lib/plugins/authplain/lang/fr/lang.php (+11/-0)
lib/plugins/authplain/lang/gl/lang.php (+6/-0)
lib/plugins/authplain/lang/he/lang.php (+6/-0)
lib/plugins/authplain/lang/hr/lang.php (+6/-0)
lib/plugins/authplain/lang/hu/lang.php (+10/-0)
lib/plugins/authplain/lang/ia/lang.php (+6/-0)
lib/plugins/authplain/lang/id-ni/lang.php (+6/-0)
lib/plugins/authplain/lang/id/lang.php (+6/-0)
lib/plugins/authplain/lang/is/lang.php (+6/-0)
lib/plugins/authplain/lang/it/lang.php (+7/-0)
lib/plugins/authplain/lang/ja/lang.php (+10/-0)
lib/plugins/authplain/lang/ka/lang.php (+6/-0)
lib/plugins/authplain/lang/kk/lang.php (+6/-0)
lib/plugins/authplain/lang/km/lang.php (+6/-0)
lib/plugins/authplain/lang/ko/lang.php (+10/-0)
lib/plugins/authplain/lang/ku/lang.php (+6/-0)
lib/plugins/authplain/lang/la/lang.php (+6/-0)
lib/plugins/authplain/lang/lb/lang.php (+6/-0)
lib/plugins/authplain/lang/lt/lang.php (+6/-0)
lib/plugins/authplain/lang/lv/lang.php (+6/-0)
lib/plugins/authplain/lang/mg/lang.php (+6/-0)
lib/plugins/authplain/lang/mk/lang.php (+6/-0)
lib/plugins/authplain/lang/mr/lang.php (+6/-0)
lib/plugins/authplain/lang/ms/lang.php (+6/-0)
lib/plugins/authplain/lang/ne/lang.php (+6/-0)
lib/plugins/authplain/lang/nl/lang.php (+10/-0)
lib/plugins/authplain/lang/no/lang.php (+6/-0)
lib/plugins/authplain/lang/pl/lang.php (+6/-0)
lib/plugins/authplain/lang/pt-br/lang.php (+10/-0)
lib/plugins/authplain/lang/pt/lang.php (+9/-0)
lib/plugins/authplain/lang/ro/lang.php (+6/-0)
lib/plugins/authplain/lang/ru/lang.php (+10/-0)
lib/plugins/authplain/lang/sk/lang.php (+6/-0)
lib/plugins/authplain/lang/sl/lang.php (+6/-0)
lib/plugins/authplain/lang/sq/lang.php (+6/-0)
lib/plugins/authplain/lang/sr/lang.php (+6/-0)
lib/plugins/authplain/lang/sv/lang.php (+6/-0)
lib/plugins/authplain/lang/th/lang.php (+6/-0)
lib/plugins/authplain/lang/tr/lang.php (+7/-0)
lib/plugins/authplain/lang/uk/lang.php (+6/-0)
lib/plugins/authplain/lang/vi/lang.php (+6/-0)
lib/plugins/authplain/lang/zh-tw/lang.php (+6/-0)
lib/plugins/authplain/lang/zh/lang.php (+10/-0)
lib/plugins/authplain/plugin.info.txt (+1/-1)
lib/plugins/backlinks/README (+1/-1)
lib/plugins/backlinks/plugin.info.txt (+3/-3)
lib/plugins/backlinks/syntax.php (+12/-2)
lib/plugins/captcha/action.php (+146/-96)
lib/plugins/captcha/conf/default.php (+1/-1)
lib/plugins/captcha/conf/metadata.php (+1/-1)
lib/plugins/captcha/helper.php (+36/-12)
lib/plugins/captcha/lang/ar/settings.php (+3/-1)
lib/plugins/captcha/lang/cs/lang.php (+1/-0)
lib/plugins/captcha/lang/cs/settings.php (+0/-1)
lib/plugins/captcha/lang/da/settings.php (+1/-2)
lib/plugins/captcha/lang/de-informal/settings.php (+1/-2)
lib/plugins/captcha/lang/de/settings.php (+5/-4)
lib/plugins/captcha/lang/en/settings.php (+1/-1)
lib/plugins/captcha/lang/eo/settings.php (+1/-2)
lib/plugins/captcha/lang/es/settings.php (+1/-2)
lib/plugins/captcha/lang/fr/settings.php (+2/-1)
lib/plugins/captcha/lang/hu/lang.php (+1/-1)
lib/plugins/captcha/lang/hu/settings.php (+1/-2)
lib/plugins/captcha/lang/is/lang.php (+12/-0)
lib/plugins/captcha/lang/is/settings.php (+22/-0)
lib/plugins/captcha/lang/it/lang.php (+9/-7)
lib/plugins/captcha/lang/it/settings.php (+19/-14)
lib/plugins/captcha/lang/ja/settings.php (+2/-1)
lib/plugins/captcha/lang/ko/lang.php (+2/-1)
lib/plugins/captcha/lang/ko/settings.php (+3/-2)
lib/plugins/captcha/lang/nl/settings.php (+2/-1)
lib/plugins/captcha/lang/nn/lang.php (+12/-0)
lib/plugins/captcha/lang/nn/settings.php (+21/-0)
lib/plugins/captcha/lang/no/lang.php (+12/-0)
lib/plugins/captcha/lang/no/settings.php (+23/-0)
lib/plugins/captcha/lang/pl/settings.php (+4/-2)
lib/plugins/captcha/lang/pt-br/settings.php (+1/-2)
lib/plugins/captcha/lang/pt/settings.php (+2/-1)
lib/plugins/captcha/lang/ru/lang.php (+9/-8)
lib/plugins/captcha/lang/ru/settings.php (+20/-16)
lib/plugins/captcha/lang/sk/settings.php (+1/-2)
lib/plugins/captcha/lang/tr/lang.php (+12/-0)
lib/plugins/captcha/lang/tr/settings.php (+14/-0)
lib/plugins/captcha/lang/uk/lang.php (+12/-0)
lib/plugins/captcha/lang/uk/settings.php (+21/-0)
lib/plugins/captcha/lang/zh-tw/lang.php (+9/-6)
lib/plugins/captcha/lang/zh-tw/settings.php (+14/-14)
lib/plugins/captcha/lang/zh/settings.php (+2/-1)
lib/plugins/captcha/plugin.info.txt (+1/-1)
lib/plugins/captcha/script.js (+29/-9)
lib/plugins/captcha/wav.php (+3/-1)
lib/plugins/config/admin.php (+43/-10)
lib/plugins/config/lang/ar/intro.txt (+1/-1)
lib/plugins/config/lang/bg/lang.php (+172/-236)
lib/plugins/config/lang/ca-valencia/intro.txt (+1/-1)
lib/plugins/config/lang/ca/lang.php (+4/-2)
lib/plugins/config/lang/cs/intro.txt (+0/-1)
lib/plugins/config/lang/cs/lang.php (+6/-2)
lib/plugins/config/lang/da/intro.txt (+0/-1)
lib/plugins/config/lang/de-informal/intro.txt (+1/-1)
lib/plugins/config/lang/de/intro.txt (+0/-3)
lib/plugins/config/lang/de/lang.php (+55/-52)
lib/plugins/config/lang/en/intro.txt (+0/-2)
lib/plugins/config/lang/eo/lang.php (+1/-1)
lib/plugins/config/lang/es/lang.php (+6/-2)
lib/plugins/config/lang/fa/intro.txt (+1/-1)
lib/plugins/config/lang/fi/intro.txt (+1/-1)
lib/plugins/config/lang/fr/intro.txt (+0/-2)
lib/plugins/config/lang/fr/lang.php (+8/-2)
lib/plugins/config/lang/he/intro.txt (+0/-2)
lib/plugins/config/lang/hu/lang.php (+6/-2)
lib/plugins/config/lang/ia/intro.txt (+1/-1)
lib/plugins/config/lang/it/intro.txt (+0/-2)
lib/plugins/config/lang/it/lang.php (+3/-2)
lib/plugins/config/lang/ja/intro.txt (+9/-7)
lib/plugins/config/lang/ja/lang.php (+7/-3)
lib/plugins/config/lang/ko/intro.txt (+5/-6)
lib/plugins/config/lang/ko/lang.php (+132/-130)
lib/plugins/config/lang/la/intro.txt (+1/-1)
lib/plugins/config/lang/mr/intro.txt (+1/-1)
lib/plugins/config/lang/nl/intro.txt (+0/-2)
lib/plugins/config/lang/nl/lang.php (+11/-6)
lib/plugins/config/lang/pl/intro.txt (+0/-2)
lib/plugins/config/lang/pt-br/intro.txt (+1/-1)
lib/plugins/config/lang/pt-br/lang.php (+6/-2)
lib/plugins/config/lang/pt/intro.txt (+1/-1)
lib/plugins/config/lang/pt/lang.php (+52/-48)
lib/plugins/config/lang/ru/intro.txt (+0/-2)
lib/plugins/config/lang/ru/lang.php (+7/-2)
lib/plugins/config/lang/sk/intro.txt (+1/-1)
lib/plugins/config/lang/sq/intro.txt (+1/-1)
lib/plugins/config/lang/sv/intro.txt (+0/-2)
lib/plugins/config/lang/tr/intro.txt (+1/-1)
lib/plugins/config/lang/tr/lang.php (+4/-2)
lib/plugins/config/lang/zh-tw/intro.txt (+1/-1)
lib/plugins/config/lang/zh-tw/lang.php (+1/-1)
lib/plugins/config/lang/zh/intro.txt (+0/-2)
lib/plugins/config/lang/zh/lang.php (+5/-2)
lib/plugins/config/plugin.info.txt (+1/-1)
lib/plugins/config/settings/config.class.php (+197/-42)
lib/plugins/config/settings/extra.class.php (+103/-6)
lib/plugins/extension/admin.php (+7/-3)
lib/plugins/extension/helper/extension.php (+102/-34)
lib/plugins/extension/helper/gui.php (+2/-2)
lib/plugins/extension/helper/list.php (+10/-11)
lib/plugins/extension/helper/repository.php (+3/-3)
lib/plugins/extension/images/license.txt (+2/-2)
lib/plugins/extension/lang/bg/lang.php (+73/-0)
lib/plugins/extension/lang/cs/intro_install.txt (+1/-0)
lib/plugins/extension/lang/cs/intro_plugins.txt (+1/-0)
lib/plugins/extension/lang/cs/intro_search.txt (+1/-0)
lib/plugins/extension/lang/cs/intro_templates.txt (+1/-0)
lib/plugins/extension/lang/cs/lang.php (+97/-0)
lib/plugins/extension/lang/da/intro_install.txt (+1/-0)
lib/plugins/extension/lang/da/intro_plugins.txt (+1/-0)
lib/plugins/extension/lang/da/intro_templates.txt (+1/-0)
lib/plugins/extension/lang/da/lang.php (+80/-0)
lib/plugins/extension/lang/de/lang.php (+15/-2)
lib/plugins/extension/lang/en/lang.php (+12/-2)
lib/plugins/extension/lang/eo/lang.php (+2/-2)
lib/plugins/extension/lang/es/intro_install.txt (+1/-0)
lib/plugins/extension/lang/es/intro_plugins.txt (+1/-0)
lib/plugins/extension/lang/es/intro_search.txt (+1/-0)
lib/plugins/extension/lang/es/intro_templates.txt (+1/-0)
lib/plugins/extension/lang/es/lang.php (+49/-1)
lib/plugins/extension/lang/fa/lang.php (+40/-0)
lib/plugins/extension/lang/fi/lang.php (+37/-0)
lib/plugins/extension/lang/fr/intro_install.txt (+1/-1)
lib/plugins/extension/lang/fr/intro_templates.txt (+1/-1)
lib/plugins/extension/lang/fr/lang.php (+19/-8)
lib/plugins/extension/lang/hr/intro_install.txt (+1/-0)
lib/plugins/extension/lang/hr/intro_plugins.txt (+1/-0)
lib/plugins/extension/lang/hr/intro_search.txt (+1/-0)
lib/plugins/extension/lang/hr/intro_templates.txt (+1/-0)
lib/plugins/extension/lang/hr/lang.php (+91/-0)
lib/plugins/extension/lang/hu/intro_install.txt (+1/-0)
lib/plugins/extension/lang/hu/intro_plugins.txt (+1/-0)
lib/plugins/extension/lang/hu/intro_search.txt (+1/-0)
lib/plugins/extension/lang/hu/intro_templates.txt (+1/-0)
lib/plugins/extension/lang/hu/lang.php (+95/-0)
lib/plugins/extension/lang/it/intro_install.txt (+1/-0)
lib/plugins/extension/lang/it/intro_plugins.txt (+1/-0)
lib/plugins/extension/lang/it/lang.php (+91/-0)
lib/plugins/extension/lang/ja/intro_install.txt (+1/-1)
lib/plugins/extension/lang/ja/intro_plugins.txt (+1/-1)
lib/plugins/extension/lang/ja/intro_templates.txt (+1/-1)
lib/plugins/extension/lang/ja/lang.php (+49/-5)
lib/plugins/extension/lang/ko/lang.php (+12/-3)
lib/plugins/extension/lang/lv/intro_templates.txt (+1/-0)
lib/plugins/extension/lang/lv/lang.php (+8/-0)
lib/plugins/extension/lang/nl/intro_plugins.txt (+1/-1)
lib/plugins/extension/lang/nl/intro_search.txt (+1/-1)
lib/plugins/extension/lang/nl/intro_templates.txt (+1/-1)
lib/plugins/extension/lang/nl/lang.php (+29/-15)
lib/plugins/extension/lang/pl/lang.php (+39/-0)
lib/plugins/extension/lang/pt-br/intro_install.txt (+1/-0)
lib/plugins/extension/lang/pt-br/intro_plugins.txt (+1/-0)
lib/plugins/extension/lang/pt-br/intro_search.txt (+1/-0)
lib/plugins/extension/lang/pt-br/intro_templates.txt (+1/-0)
lib/plugins/extension/lang/pt-br/lang.php (+97/-0)
lib/plugins/extension/lang/pt/intro_install.txt (+1/-0)
lib/plugins/extension/lang/pt/intro_plugins.txt (+1/-0)
lib/plugins/extension/lang/pt/intro_search.txt (+1/-0)
lib/plugins/extension/lang/pt/intro_templates.txt (+1/-0)
lib/plugins/extension/lang/pt/lang.php (+135/-0)
lib/plugins/extension/lang/ru/intro_install.txt (+1/-0)
lib/plugins/extension/lang/ru/intro_plugins.txt (+1/-0)
lib/plugins/extension/lang/ru/intro_search.txt (+1/-0)
lib/plugins/extension/lang/ru/intro_templates.txt (+1/-0)
lib/plugins/extension/lang/ru/lang.php (+49/-9)
lib/plugins/extension/lang/tr/lang.php (+61/-0)
lib/plugins/extension/lang/zh-tw/intro_install.txt (+1/-0)
lib/plugins/extension/lang/zh-tw/intro_plugins.txt (+1/-0)
lib/plugins/extension/lang/zh-tw/lang.php (+80/-0)
lib/plugins/extension/lang/zh/lang.php (+27/-0)
lib/plugins/extension/plugin.info.txt (+1/-1)
lib/plugins/extension/script.js (+23/-3)
lib/plugins/extension/style.less (+27/-2)
lib/plugins/info/plugin.info.txt (+1/-1)
lib/plugins/info/syntax.php (+31/-7)
lib/plugins/popularity/action.php (+1/-1)
lib/plugins/popularity/admin.php (+3/-3)
lib/plugins/popularity/helper.php (+32/-2)
lib/plugins/popularity/lang/ca/lang.php (+3/-2)
lib/plugins/popularity/lang/eu/lang.php (+3/-2)
lib/plugins/popularity/lang/hr/intro.txt (+7/-0)
lib/plugins/popularity/lang/hr/lang.php (+14/-0)
lib/plugins/popularity/lang/hr/submitted.txt (+3/-0)
lib/plugins/popularity/lang/ja/intro.txt (+1/-1)
lib/plugins/popularity/lang/ko/intro.txt (+1/-1)
lib/plugins/popularity/lang/lt/lang.php (+3/-2)
lib/plugins/popularity/lang/lv/lang.php (+3/-2)
lib/plugins/popularity/lang/ro/lang.php (+3/-2)
lib/plugins/popularity/lang/th/lang.php (+3/-2)
lib/plugins/popularity/plugin.info.txt (+1/-1)
lib/plugins/remote.php (+12/-1)
lib/plugins/revert/admin.php (+5/-5)
lib/plugins/revert/lang/ar/lang.php (+1/-0)
lib/plugins/revert/lang/ca/lang.php (+3/-2)
lib/plugins/revert/lang/cs/lang.php (+4/-0)
lib/plugins/revert/lang/eu/lang.php (+4/-2)
lib/plugins/revert/lang/hr/intro.txt (+3/-0)
lib/plugins/revert/lang/hr/lang.php (+16/-0)
lib/plugins/revert/lang/ko/lang.php (+4/-2)
lib/plugins/revert/lang/lv/lang.php (+3/-2)
lib/plugins/revert/lang/nl/intro.txt (+1/-1)
lib/plugins/revert/lang/nl/lang.php (+2/-1)
lib/plugins/revert/lang/no/lang.php (+2/-0)
lib/plugins/revert/lang/ro/lang.php (+3/-2)
lib/plugins/revert/lang/sv/lang.php (+1/-0)
lib/plugins/revert/lang/th/lang.php (+3/-2)
lib/plugins/revert/plugin.info.txt (+1/-1)
lib/plugins/styling/README (+27/-0)
lib/plugins/styling/action.php (+60/-0)
lib/plugins/styling/admin.php (+211/-0)
lib/plugins/styling/iris.js (+1488/-0)
lib/plugins/styling/lang/bg/lang.php (+17/-0)
lib/plugins/styling/lang/cs/lang.php (+23/-0)
lib/plugins/styling/lang/de/intro.txt (+2/-0)
lib/plugins/styling/lang/de/lang.php (+23/-0)
lib/plugins/styling/lang/en/intro.txt (+2/-0)
lib/plugins/styling/lang/en/lang.php (+35/-0)
lib/plugins/styling/lang/es/intro.txt (+2/-0)
lib/plugins/styling/lang/es/lang.php (+23/-0)
lib/plugins/styling/lang/fr/intro.txt (+2/-0)
lib/plugins/styling/lang/fr/lang.php (+24/-0)
lib/plugins/styling/lang/hu/intro.txt (+2/-0)
lib/plugins/styling/lang/hu/lang.php (+23/-0)
lib/plugins/styling/lang/it/lang.php (+17/-0)
lib/plugins/styling/lang/ja/intro.txt (+2/-0)
lib/plugins/styling/lang/ja/lang.php (+23/-0)
lib/plugins/styling/lang/ko/intro.txt (+2/-0)
lib/plugins/styling/lang/ko/lang.php (+23/-0)
lib/plugins/styling/lang/nl/intro.txt (+2/-0)
lib/plugins/styling/lang/nl/lang.php (+24/-0)
lib/plugins/styling/lang/pt-br/intro.txt (+2/-0)
lib/plugins/styling/lang/pt-br/lang.php (+23/-0)
lib/plugins/styling/lang/ru/intro.txt (+1/-0)
lib/plugins/styling/lang/ru/lang.php (+22/-0)
lib/plugins/styling/lang/zh/intro.txt (+1/-0)
lib/plugins/styling/lang/zh/lang.php (+23/-0)
lib/plugins/styling/plugin.info.txt (+7/-0)
lib/plugins/styling/popup.php (+30/-0)
lib/plugins/styling/script.js (+97/-0)
lib/plugins/styling/style.less (+13/-0)
lib/plugins/syntax.php (+16/-6)
lib/plugins/usermanager/admin.php (+69/-22)
lib/plugins/usermanager/lang/bg/lang.php (+9/-0)
lib/plugins/usermanager/lang/ca/lang.php (+3/-2)
lib/plugins/usermanager/lang/cs/lang.php (+9/-5)
lib/plugins/usermanager/lang/da/import.txt (+9/-0)
lib/plugins/usermanager/lang/da/lang.php (+2/-0)
lib/plugins/usermanager/lang/en/import.txt (+2/-2)
lib/plugins/usermanager/lang/es/import.txt (+9/-0)
lib/plugins/usermanager/lang/es/lang.php (+19/-0)
lib/plugins/usermanager/lang/eu/lang.php (+3/-2)
lib/plugins/usermanager/lang/fa/lang.php (+10/-6)
lib/plugins/usermanager/lang/fi/lang.php (+10/-0)
lib/plugins/usermanager/lang/hr/add.txt (+1/-0)
lib/plugins/usermanager/lang/hr/delete.txt (+1/-0)
lib/plugins/usermanager/lang/hr/edit.txt (+1/-0)
lib/plugins/usermanager/lang/hr/import.txt (+9/-0)
lib/plugins/usermanager/lang/hr/intro.txt (+1/-0)
lib/plugins/usermanager/lang/hr/lang.php (+66/-0)
lib/plugins/usermanager/lang/hr/list.txt (+1/-0)
lib/plugins/usermanager/lang/hu/import.txt (+1/-1)
lib/plugins/usermanager/lang/it/lang.php (+14/-0)
lib/plugins/usermanager/lang/ja/import.txt (+1/-1)
lib/plugins/usermanager/lang/ja/lang.php (+2/-2)
lib/plugins/usermanager/lang/ko/lang.php (+6/-6)
lib/plugins/usermanager/lang/lt/lang.php (+3/-2)
lib/plugins/usermanager/lang/lv/import.txt (+9/-0)
lib/plugins/usermanager/lang/lv/lang.php (+3/-2)
lib/plugins/usermanager/lang/nl/intro.txt (+1/-1)
lib/plugins/usermanager/lang/nl/lang.php (+2/-1)
lib/plugins/usermanager/lang/pt-br/import.txt (+9/-0)
lib/plugins/usermanager/lang/pt/lang.php (+11/-0)
lib/plugins/usermanager/lang/ro/lang.php (+3/-2)
lib/plugins/usermanager/lang/ru/import.txt (+2/-2)
lib/plugins/usermanager/lang/ru/lang.php (+6/-1)
lib/plugins/usermanager/lang/th/lang.php (+3/-2)
lib/plugins/usermanager/lang/zh-tw/lang.php (+0/-11)
lib/plugins/usermanager/plugin.info.txt (+1/-1)
lib/plugins/usermanager/style.css (+1/-1)
lib/scripts/behaviour.js (+29/-18)
lib/scripts/compatibility.js (+0/-395)
lib/scripts/drag.js (+0/-87)
lib/scripts/editor.js (+9/-3)
lib/scripts/fileuploader.js (+3/-1)
lib/scripts/fileuploaderextended.js (+2/-2)
lib/scripts/hotkeys.js (+3/-3)
lib/scripts/jquery/jquery-ui-theme/smoothness.css (+111/-64)
lib/scripts/jquery/jquery-ui.js (+5397/-3788)
lib/scripts/jquery/jquery-ui.min.js (+11/-5)
lib/scripts/jquery/jquery.js (+4783/-4221)
lib/scripts/jquery/jquery.min.js (+5/-5)
lib/scripts/jquery/update.sh (+21/-13)
lib/scripts/linkwiz.js (+8/-2)
lib/scripts/locktimer.js (+6/-17)
lib/scripts/media.js (+2/-2)
lib/scripts/page.js (+10/-3)
lib/scripts/toolbar.js (+14/-1)
lib/scripts/tw-sack.js (+0/-140)
lib/tpl/dokuwiki/css/_admin.css (+3/-0)
lib/tpl/dokuwiki/css/_edit.css (+2/-2)
lib/tpl/dokuwiki/css/_forms.css (+1/-2)
lib/tpl/dokuwiki/css/_links.css (+0/-1)
lib/tpl/dokuwiki/css/_media_fullscreen.css (+4/-4)
lib/tpl/dokuwiki/css/_media_popup.css (+1/-1)
lib/tpl/dokuwiki/css/_modal.css (+1/-1)
lib/tpl/dokuwiki/css/basic.less (+0/-6)
lib/tpl/dokuwiki/css/content.less (+1/-2)
lib/tpl/dokuwiki/css/design.less (+13/-20)
lib/tpl/dokuwiki/css/mobile.less (+8/-2)
lib/tpl/dokuwiki/css/pagetools.less (+0/-19)
lib/tpl/dokuwiki/css/print.css (+3/-0)
lib/tpl/dokuwiki/detail.php (+20/-5)
lib/tpl/dokuwiki/images/pagetools-build.php (+3/-1)
lib/tpl/dokuwiki/lang/cs/lang.php (+10/-0)
lib/tpl/dokuwiki/lang/de/lang.php (+15/-0)
lib/tpl/dokuwiki/lang/de/style.txt (+1/-0)
lib/tpl/dokuwiki/lang/en/lang.php (+12/-0)
lib/tpl/dokuwiki/lang/en/style.txt (+4/-0)
lib/tpl/dokuwiki/lang/es/lang.php (+15/-0)
lib/tpl/dokuwiki/lang/es/style.txt (+1/-0)
lib/tpl/dokuwiki/lang/fr/lang.php (+15/-0)
lib/tpl/dokuwiki/lang/fr/style.txt (+1/-0)
lib/tpl/dokuwiki/lang/hu/lang.php (+15/-0)
lib/tpl/dokuwiki/lang/hu/style.txt (+1/-0)
lib/tpl/dokuwiki/lang/it/lang.php (+8/-0)
lib/tpl/dokuwiki/lang/ja/lang.php (+15/-0)
lib/tpl/dokuwiki/lang/ja/style.txt (+5/-0)
lib/tpl/dokuwiki/lang/ko/lang.php (+15/-0)
lib/tpl/dokuwiki/lang/ko/style.txt (+4/-0)
lib/tpl/dokuwiki/lang/nl/lang.php (+15/-0)
lib/tpl/dokuwiki/lang/nl/style.txt (+1/-0)
lib/tpl/dokuwiki/lang/pt-br/lang.php (+15/-0)
lib/tpl/dokuwiki/lang/pt-br/style.txt (+1/-0)
lib/tpl/dokuwiki/lang/ru/lang.php (+14/-0)
lib/tpl/dokuwiki/lang/zh/lang.php (+15/-0)
lib/tpl/dokuwiki/lang/zh/style.txt (+1/-0)
lib/tpl/dokuwiki/main.php (+12/-11)
lib/tpl/dokuwiki/mediamanager.php (+2/-2)
lib/tpl/dokuwiki/template.info.txt (+1/-1)
lib/tpl/dokuwiki/tpl_header.php (+12/-8)
lib/tpl/index.php (+1/-1)
vendor/README (+6/-0)
vendor/autoload.php (+7/-0)
vendor/composer/ClassLoader.php (+413/-0)
vendor/composer/autoload_classmap.php (+10/-0)
vendor/composer/autoload_namespaces.php (+9/-0)
vendor/composer/autoload_psr4.php (+10/-0)
vendor/composer/autoload_real.php (+50/-0)
vendor/composer/installed.json (+99/-0)
vendor/easybook/geshi/README.md (+10/-0)
vendor/easybook/geshi/geshi.php (+4775/-0)
vendor/easybook/geshi/geshi/4cs.php (+137/-0)
vendor/easybook/geshi/geshi/6502acme.php (+230/-0)
vendor/easybook/geshi/geshi/6502kickass.php (+241/-0)
vendor/easybook/geshi/geshi/6502tasm.php (+189/-0)
vendor/easybook/geshi/geshi/68000devpac.php (+168/-0)
vendor/easybook/geshi/geshi/abap.php (+1409/-0)
vendor/easybook/geshi/geshi/actionscript.php (+197/-0)
vendor/easybook/geshi/geshi/actionscript3.php (+473/-0)
vendor/easybook/geshi/geshi/ada.php (+135/-0)
vendor/easybook/geshi/geshi/aimms.php (+316/-0)
vendor/easybook/geshi/geshi/algol68.php (+329/-0)
vendor/easybook/geshi/geshi/apache.php (+483/-0)
vendor/easybook/geshi/geshi/applescript.php (+157/-0)
vendor/easybook/geshi/geshi/apt_sources.php (+155/-0)
vendor/easybook/geshi/geshi/arm.php (+3318/-0)
vendor/easybook/geshi/geshi/asm.php (+603/-0)
vendor/easybook/geshi/geshi/asp.php (+164/-0)
vendor/easybook/geshi/geshi/asymptote.php (+192/-0)
vendor/easybook/geshi/geshi/autoconf.php (+512/-0)
vendor/easybook/geshi/geshi/autohotkey.php (+373/-0)
vendor/easybook/geshi/geshi/autoit.php (+1175/-0)
vendor/easybook/geshi/geshi/avisynth.php (+194/-0)
vendor/easybook/geshi/geshi/awk.php (+156/-0)
vendor/easybook/geshi/geshi/bascomavr.php (+185/-0)
vendor/easybook/geshi/geshi/bash.php (+474/-0)
vendor/easybook/geshi/geshi/basic4gl.php (+339/-0)
vendor/easybook/geshi/geshi/batch.php (+138/-0)
vendor/easybook/geshi/geshi/bf.php (+115/-0)
vendor/easybook/geshi/geshi/bibtex.php (+183/-0)
vendor/easybook/geshi/geshi/blitzbasic.php (+183/-0)
vendor/easybook/geshi/geshi/bnf.php (+119/-0)
vendor/easybook/geshi/geshi/boo.php (+215/-0)
vendor/easybook/geshi/geshi/c.php (+281/-0)
vendor/easybook/geshi/geshi/c_loadrunner.php (+323/-0)
vendor/easybook/geshi/geshi/c_mac.php (+227/-0)
vendor/easybook/geshi/geshi/c_winapi.php (+870/-0)
vendor/easybook/geshi/geshi/caddcl.php (+124/-0)
vendor/easybook/geshi/geshi/cadlisp.php (+184/-0)
vendor/easybook/geshi/geshi/cfdg.php (+122/-0)
vendor/easybook/geshi/geshi/cfm.php (+299/-0)
vendor/easybook/geshi/geshi/chaiscript.php (+140/-0)
vendor/easybook/geshi/geshi/chapel.php (+169/-0)
vendor/easybook/geshi/geshi/cil.php (+194/-0)
vendor/easybook/geshi/geshi/clojure.php (+134/-0)
vendor/easybook/geshi/geshi/cmake.php (+181/-0)
vendor/easybook/geshi/geshi/cobol.php (+457/-0)
vendor/easybook/geshi/geshi/coffeescript.php (+146/-0)
vendor/easybook/geshi/geshi/cpp-qt.php (+570/-0)
vendor/easybook/geshi/geshi/cpp-winapi.php (+836/-0)
vendor/easybook/geshi/geshi/cpp.php (+246/-0)
vendor/easybook/geshi/geshi/csharp.php (+259/-0)
vendor/easybook/geshi/geshi/css.php (+226/-0)
vendor/easybook/geshi/geshi/cuesheet.php (+138/-0)
vendor/easybook/geshi/geshi/d.php (+252/-0)
vendor/easybook/geshi/geshi/dart.php (+159/-0)
vendor/easybook/geshi/geshi/dcl.php (+192/-0)
vendor/easybook/geshi/geshi/dcpu16.php (+131/-0)
vendor/easybook/geshi/geshi/dcs.php (+182/-0)
vendor/easybook/geshi/geshi/delphi.php (+299/-0)
vendor/easybook/geshi/geshi/diff.php (+196/-0)
vendor/easybook/geshi/geshi/div.php (+124/-0)
vendor/easybook/geshi/geshi/dos.php (+227/-0)
vendor/easybook/geshi/geshi/dot.php (+164/-0)
vendor/easybook/geshi/geshi/e.php (+208/-0)
vendor/easybook/geshi/geshi/ecmascript.php (+210/-0)
vendor/easybook/geshi/geshi/eiffel.php (+393/-0)
vendor/easybook/geshi/geshi/email.php (+222/-0)
vendor/easybook/geshi/geshi/epc.php (+154/-0)
vendor/easybook/geshi/geshi/erlang.php (+441/-0)
vendor/easybook/geshi/geshi/euphoria.php (+140/-0)
vendor/easybook/geshi/geshi/ezt.php (+134/-0)
vendor/easybook/geshi/geshi/f1.php (+151/-0)
vendor/easybook/geshi/geshi/falcon.php (+218/-0)
vendor/easybook/geshi/geshi/fo.php (+327/-0)
vendor/easybook/geshi/geshi/fortran.php (+158/-0)
vendor/easybook/geshi/geshi/freebasic.php (+139/-0)
vendor/easybook/geshi/geshi/freeswitch.php (+166/-0)
vendor/easybook/geshi/geshi/fsharp.php (+213/-0)
vendor/easybook/geshi/geshi/gambas.php (+214/-0)
vendor/easybook/geshi/geshi/gdb.php (+196/-0)
vendor/easybook/geshi/geshi/genero.php (+461/-0)
vendor/easybook/geshi/geshi/genie.php (+155/-0)
vendor/easybook/geshi/geshi/gettext.php (+95/-0)
vendor/easybook/geshi/geshi/glsl.php (+205/-0)
vendor/easybook/geshi/geshi/gml.php (+504/-0)
vendor/easybook/geshi/geshi/gnuplot.php (+296/-0)
vendor/easybook/geshi/geshi/go.php (+375/-0)
vendor/easybook/geshi/geshi/groovy.php (+1011/-0)
vendor/easybook/geshi/geshi/gwbasic.php (+153/-0)
vendor/easybook/geshi/geshi/haskell.php (+202/-0)
vendor/easybook/geshi/geshi/haxe.php (+161/-0)
vendor/easybook/geshi/geshi/hicest.php (+108/-0)
vendor/easybook/geshi/geshi/hq9plus.php (+102/-0)
vendor/easybook/geshi/geshi/html4strict.php (+190/-0)
vendor/easybook/geshi/geshi/html5.php (+212/-0)
vendor/easybook/geshi/geshi/icon.php (+212/-0)
vendor/easybook/geshi/geshi/idl.php (+121/-0)
vendor/easybook/geshi/geshi/ini.php (+127/-0)
vendor/easybook/geshi/geshi/inno.php (+210/-0)
vendor/easybook/geshi/geshi/intercal.php (+122/-0)
vendor/easybook/geshi/geshi/io.php (+136/-0)
vendor/easybook/geshi/geshi/ispfpanel.php (+165/-0)
vendor/easybook/geshi/geshi/j.php (+188/-0)
vendor/easybook/geshi/geshi/java.php (+981/-0)
vendor/easybook/geshi/geshi/java5.php (+1035/-0)
vendor/easybook/geshi/geshi/javascript.php (+174/-0)
vendor/easybook/geshi/geshi/jcl.php (+155/-0)
vendor/easybook/geshi/geshi/jquery.php (+238/-0)
vendor/easybook/geshi/geshi/kixtart.php (+327/-0)
vendor/easybook/geshi/geshi/klonec.php (+280/-0)
vendor/easybook/geshi/geshi/klonecpp.php (+308/-0)
vendor/easybook/geshi/geshi/latex.php (+223/-0)
vendor/easybook/geshi/geshi/lb.php (+162/-0)
vendor/easybook/geshi/geshi/ldif.php (+116/-0)
vendor/easybook/geshi/geshi/lisp.php (+147/-0)
vendor/easybook/geshi/geshi/llvm.php (+385/-0)
vendor/easybook/geshi/geshi/locobasic.php (+130/-0)
vendor/easybook/geshi/geshi/logtalk.php (+345/-0)
vendor/easybook/geshi/geshi/lolcode.php (+152/-0)
vendor/easybook/geshi/geshi/lotusformulas.php (+316/-0)
vendor/easybook/geshi/geshi/lotusscript.php (+189/-0)
vendor/easybook/geshi/geshi/lscript.php (+387/-0)
vendor/easybook/geshi/geshi/lsl2.php (+1257/-0)
vendor/easybook/geshi/geshi/lua.php (+175/-0)
vendor/easybook/geshi/geshi/m68k.php (+141/-0)
vendor/easybook/geshi/geshi/magiksf.php (+193/-0)
vendor/easybook/geshi/geshi/make.php (+151/-0)
vendor/easybook/geshi/geshi/mapbasic.php (+908/-0)
vendor/easybook/geshi/geshi/matlab.php (+227/-0)
vendor/easybook/geshi/geshi/mirc.php (+171/-0)
vendor/easybook/geshi/geshi/mmix.php (+193/-0)
vendor/easybook/geshi/geshi/modula2.php (+136/-0)
vendor/easybook/geshi/geshi/modula3.php (+135/-0)
vendor/easybook/geshi/geshi/mpasm.php (+162/-0)
vendor/easybook/geshi/geshi/mxml.php (+143/-0)
vendor/easybook/geshi/geshi/mysql.php (+475/-0)
vendor/easybook/geshi/geshi/nagios.php (+223/-0)
vendor/easybook/geshi/geshi/netrexx.php (+161/-0)
vendor/easybook/geshi/geshi/newlisp.php (+191/-0)
vendor/easybook/geshi/geshi/nginx.php (+868/-0)
vendor/easybook/geshi/geshi/nsis.php (+349/-0)
vendor/easybook/geshi/geshi/oberon2.php (+135/-0)
vendor/easybook/geshi/geshi/objc.php (+356/-0)
vendor/easybook/geshi/geshi/objeck.php (+116/-0)
vendor/easybook/geshi/geshi/ocaml-brief.php (+110/-0)
vendor/easybook/geshi/geshi/ocaml.php (+187/-0)
vendor/easybook/geshi/geshi/octave.php (+513/-0)
vendor/easybook/geshi/geshi/oobas.php (+133/-0)
vendor/easybook/geshi/geshi/oorexx.php (+169/-0)
vendor/easybook/geshi/geshi/oracle11.php (+612/-0)
vendor/easybook/geshi/geshi/oracle8.php (+494/-0)
vendor/easybook/geshi/geshi/oxygene.php (+154/-0)
vendor/easybook/geshi/geshi/oz.php (+144/-0)
vendor/easybook/geshi/geshi/parasail.php (+133/-0)
vendor/easybook/geshi/geshi/parigp.php (+293/-0)
vendor/easybook/geshi/geshi/pascal.php (+165/-0)
vendor/easybook/geshi/geshi/pcre.php (+188/-0)
vendor/easybook/geshi/geshi/per.php (+300/-0)
vendor/easybook/geshi/geshi/perl.php (+219/-0)
vendor/easybook/geshi/geshi/perl6.php (+197/-0)
vendor/easybook/geshi/geshi/pf.php (+178/-0)
vendor/easybook/geshi/geshi/php-brief.php (+222/-0)
vendor/easybook/geshi/geshi/php.php (+1115/-0)
vendor/easybook/geshi/geshi/pic16.php (+139/-0)
vendor/easybook/geshi/geshi/pike.php (+101/-0)
vendor/easybook/geshi/geshi/pixelbender.php (+174/-0)
vendor/easybook/geshi/geshi/pli.php (+200/-0)
vendor/easybook/geshi/geshi/plsql.php (+254/-0)
vendor/easybook/geshi/geshi/postgresql.php (+288/-0)
vendor/easybook/geshi/geshi/povray.php (+199/-0)
vendor/easybook/geshi/geshi/powerbuilder.php (+418/-0)
vendor/easybook/geshi/geshi/powershell.php (+277/-0)
vendor/easybook/geshi/geshi/proftpd.php (+374/-0)
vendor/easybook/geshi/geshi/progress.php (+485/-0)
vendor/easybook/geshi/geshi/prolog.php (+143/-0)
vendor/easybook/geshi/geshi/properties.php (+127/-0)
vendor/easybook/geshi/geshi/providex.php (+297/-0)
vendor/easybook/geshi/geshi/purebasic.php (+303/-0)
vendor/easybook/geshi/geshi/pycon.php (+64/-0)
vendor/easybook/geshi/geshi/pys60.php (+271/-0)
vendor/easybook/geshi/geshi/python.php (+244/-0)
vendor/easybook/geshi/geshi/q.php (+149/-0)
vendor/easybook/geshi/geshi/qbasic.php (+162/-0)
vendor/easybook/geshi/geshi/racket.php (+964/-0)
vendor/easybook/geshi/geshi/rails.php (+404/-0)
vendor/easybook/geshi/geshi/rbs.php (+224/-0)
vendor/easybook/geshi/geshi/rebol.php (+196/-0)
vendor/easybook/geshi/geshi/reg.php (+231/-0)
vendor/easybook/geshi/geshi/rexx.php (+160/-0)
vendor/easybook/geshi/geshi/robots.php (+100/-0)
vendor/easybook/geshi/geshi/rpmspec.php (+133/-0)
vendor/easybook/geshi/geshi/rsplus.php (+483/-0)
vendor/easybook/geshi/geshi/ruby.php (+231/-0)
vendor/easybook/geshi/geshi/rust.php (+228/-0)
vendor/easybook/geshi/geshi/sas.php (+290/-0)
vendor/easybook/geshi/geshi/sass.php (+248/-0)
vendor/easybook/geshi/geshi/scala.php (+138/-0)
vendor/easybook/geshi/geshi/scheme.php (+168/-0)
vendor/easybook/geshi/geshi/scilab.php (+295/-0)
vendor/easybook/geshi/geshi/scl.php (+148/-0)
vendor/easybook/geshi/geshi/sdlbasic.php (+163/-0)
vendor/easybook/geshi/geshi/smalltalk.php (+154/-0)
vendor/easybook/geshi/geshi/smarty.php (+190/-0)
vendor/easybook/geshi/geshi/spark.php (+132/-0)
vendor/easybook/geshi/geshi/sparql.php (+155/-0)
vendor/easybook/geshi/geshi/sql.php (+170/-0)
vendor/easybook/geshi/geshi/stonescript.php (+307/-0)
vendor/easybook/geshi/geshi/systemverilog.php (+317/-0)
vendor/easybook/geshi/geshi/tcl.php (+194/-0)
vendor/easybook/geshi/geshi/teraterm.php (+354/-0)
vendor/easybook/geshi/geshi/text.php (+82/-0)
vendor/easybook/geshi/geshi/thinbasic.php (+866/-0)
vendor/easybook/geshi/geshi/tsql.php (+375/-0)
vendor/easybook/geshi/geshi/twig.php (+190/-0)
vendor/easybook/geshi/geshi/typoscript.php (+298/-0)
vendor/easybook/geshi/geshi/unicon.php (+210/-0)
vendor/easybook/geshi/geshi/upc.php (+270/-0)
vendor/easybook/geshi/geshi/urbi.php (+198/-0)
vendor/easybook/geshi/geshi/uscript.php (+297/-0)
vendor/easybook/geshi/geshi/vala.php (+149/-0)
vendor/easybook/geshi/geshi/vb.php (+157/-0)
vendor/easybook/geshi/geshi/vbnet.php (+182/-0)
vendor/easybook/geshi/geshi/vbscript.php (+153/-0)
vendor/easybook/geshi/geshi/vedit.php (+103/-0)
vendor/easybook/geshi/geshi/verilog.php (+193/-0)
vendor/easybook/geshi/geshi/vhdl.php (+181/-0)
vendor/easybook/geshi/geshi/vim.php (+418/-0)
vendor/easybook/geshi/geshi/visualfoxpro.php (+456/-0)
vendor/easybook/geshi/geshi/visualprolog.php (+127/-0)
vendor/easybook/geshi/geshi/whitespace.php (+119/-0)
vendor/easybook/geshi/geshi/whois.php (+181/-0)
vendor/easybook/geshi/geshi/winbatch.php (+369/-0)
vendor/easybook/geshi/geshi/xbasic.php (+143/-0)
vendor/easybook/geshi/geshi/xml.php (+155/-0)
vendor/easybook/geshi/geshi/xojo.php (+166/-0)
vendor/easybook/geshi/geshi/xorg_conf.php (+122/-0)
vendor/easybook/geshi/geshi/xpp.php (+434/-0)
vendor/easybook/geshi/geshi/yaml.php (+150/-0)
vendor/easybook/geshi/geshi/z80.php (+144/-0)
vendor/easybook/geshi/geshi/zxbasic.php (+150/-0)
vendor/splitbrain/php-archive/LICENSE (+19/-0)
vendor/splitbrain/php-archive/README.md (+70/-0)
vendor/splitbrain/php-archive/phpunit.xml (+17/-0)
vendor/splitbrain/php-archive/src/Archive.php (+132/-0)
vendor/splitbrain/php-archive/src/FileInfo.php (+343/-0)
vendor/splitbrain/php-archive/src/Tar.php (+659/-0)
vendor/splitbrain/php-archive/src/Zip.php (+750/-0)
To merge this branch: bzr merge lp:~yoboy-leguesh/ubuntu-fr-doc/maj20150810a
Reviewer Review Type Date Requested Status
Ubuntu-fr-webteam Pending
Review via email: mp+277387@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2014-06-08 13:04:43 +0000
3+++ README 2015-11-12 19:55:23 +0000
4@@ -4,7 +4,7 @@
5 For Installation Instructions see
6 http://www.dokuwiki.org/install
7
8-DokuWiki - 2004-2014 (c) Andreas Gohr <andi@splitbrain.org>
9+DokuWiki - 2004-2015 (c) Andreas Gohr <andi@splitbrain.org>
10 and the DokuWiki Community
11 See COPYING and file headers for license info
12
13
14=== modified file 'VERSION'
15--- VERSION 2014-06-08 13:04:43 +0000
16+++ VERSION 2015-11-12 19:55:23 +0000
17@@ -1,1 +1,1 @@
18-2014-05-05 "Ponder Stibbons"
19+2015-08-10a "Detritus"
20
21=== modified file 'bin/dwpage.php'
22--- bin/dwpage.php 2014-06-08 13:04:43 +0000
23+++ bin/dwpage.php 2015-11-12 19:55:23 +0000
24@@ -1,378 +1,318 @@
25 #!/usr/bin/php
26 <?php
27-#------------------------------------------------------------------------------
28-if ('cli' != php_sapi_name()) die();
29-
30-ini_set('memory_limit','128M');
31-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
32-require_once DOKU_INC.'inc/init.php';
33-require_once DOKU_INC.'inc/common.php';
34-require_once DOKU_INC.'inc/cliopts.php';
35-
36-#------------------------------------------------------------------------------
37-function usage($action) {
38- switch ( $action ) {
39- case 'checkout':
40- print "Usage: dwpage.php [opts] checkout <wiki:page> [working_file]
41-
42- Checks out a file from the repository, using the wiki id and obtaining
43- a lock for the page.
44- If a working_file is specified, this is where the page is copied to.
45- Otherwise defaults to the same as the wiki page in the current
46- working directory.
47-
48- EXAMPLE
49- $ ./dwpage.php checkout wiki:syntax ./new_syntax.txt
50-
51- OPTIONS
52- -h, --help=<action>: get help
53- -f: force obtaining a lock for the page (generally bad idea)
54-";
55- break;
56- case 'commit':
57- print "Usage: dwpage.php [opts] -m \"Msg\" commit <working_file> <wiki:page>
58-
59- Checks in the working_file into the repository using the specified
60- wiki id, archiving the previous version.
61-
62- EXAMPLE
63- $ ./dwpage.php -m \"Some message\" commit ./new_syntax.txt wiki:syntax
64-
65- OPTIONS
66- -h, --help=<action>: get help
67- -f: force obtaining a lock for the page (generally bad idea)
68- -t, trivial: minor change
69- -m (required): Summary message describing the change
70-";
71- break;
72- case 'lock':
73- print "Usage: dwpage.php [opts] lock <wiki:page>
74-
75- Obtains or updates a lock for a wiki page
76-
77- EXAMPLE
78- $ ./dwpage.php lock wiki:syntax
79-
80- OPTIONS
81- -h, --help=<action>: get help
82- -f: force obtaining a lock for the page (generally bad idea)
83-";
84- break;
85- case 'unlock':
86- print "Usage: dwpage.php [opts] unlock <wiki:page>
87-
88- Removes a lock for a wiki page.
89-
90- EXAMPLE
91- $ ./dwpage.php unlock wiki:syntax
92-
93- OPTIONS
94- -h, --help=<action>: get help
95- -f: force obtaining a lock for the page (generally bad idea)
96-";
97- break;
98- default:
99- print "Usage: dwpage.php [opts] <action>
100-
101- Utility to help command line Dokuwiki page editing, allow
102- pages to be checked out for editing then committed after changes
103-
104- Normal operation would be;
105-
106-
107-
108- ACTIONS
109- checkout: see $ dwpage.php --help=checkout
110- commit: see $ dwpage.php --help=commit
111- lock: see $ dwpage.php --help=lock
112-
113- OPTIONS
114- -h, --help=<action>: get help
115- e.g. $ ./dwpage.php -hcommit
116- e.g. $ ./dwpage.php --help=commit
117-";
118- break;
119- }
120-}
121-
122-#------------------------------------------------------------------------------
123-function getUser() {
124- $user = getenv('USER');
125- if (empty ($user)) {
126- $user = getenv('USERNAME');
127- } else {
128+if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
129+define('NOSESSION', 1);
130+require_once(DOKU_INC.'inc/init.php');
131+
132+/**
133+ * Checkout and commit pages from the command line while maintaining the history
134+ */
135+class PageCLI extends DokuCLI {
136+
137+ protected $force = false;
138+ protected $username = '';
139+
140+ /**
141+ * Register options and arguments on the given $options object
142+ *
143+ * @param DokuCLI_Options $options
144+ * @return void
145+ */
146+ protected function setup(DokuCLI_Options $options) {
147+ /* global */
148+ $options->registerOption(
149+ 'force',
150+ 'force obtaining a lock for the page (generally bad idea)',
151+ 'f'
152+ );
153+ $options->registerOption(
154+ 'user',
155+ 'work as this user. defaults to current CLI user',
156+ 'u',
157+ 'username'
158+ );
159+ $options->setHelp(
160+ 'Utility to help command line Dokuwiki page editing, allow '.
161+ 'pages to be checked out for editing then committed after changes'
162+ );
163+
164+ /* checkout command */
165+ $options->registerCommand(
166+ 'checkout',
167+ 'Checks out a file from the repository, using the wiki id and obtaining '.
168+ 'a lock for the page. '."\n".
169+ 'If a working_file is specified, this is where the page is copied to. '.
170+ 'Otherwise defaults to the same as the wiki page in the current '.
171+ 'working directory.'
172+ );
173+ $options->registerArgument(
174+ 'wikipage',
175+ 'The wiki page to checkout',
176+ true,
177+ 'checkout'
178+ );
179+ $options->registerArgument(
180+ 'workingfile',
181+ 'How to name the local checkout',
182+ false,
183+ 'checkout'
184+ );
185+
186+ /* commit command */
187+ $options->registerCommand(
188+ 'commit',
189+ 'Checks in the working_file into the repository using the specified '.
190+ 'wiki id, archiving the previous version.'
191+ );
192+ $options->registerArgument(
193+ 'workingfile',
194+ 'The local file to commit',
195+ true,
196+ 'commit'
197+ );
198+ $options->registerArgument(
199+ 'wikipage',
200+ 'The wiki page to create or update',
201+ true,
202+ 'commit'
203+ );
204+ $options->registerOption(
205+ 'message',
206+ 'Summary describing the change (required)',
207+ 'm',
208+ 'summary',
209+ 'commit'
210+ );
211+ $options->registerOption(
212+ 'trivial',
213+ 'minor change',
214+ 't',
215+ false,
216+ 'commit'
217+ );
218+
219+ /* lock command */
220+ $options->registerCommand(
221+ 'lock',
222+ 'Obtains or updates a lock for a wiki page'
223+ );
224+ $options->registerArgument(
225+ 'wikipage',
226+ 'The wiki page to lock',
227+ true,
228+ 'lock'
229+ );
230+
231+ /* unlock command */
232+ $options->registerCommand(
233+ 'unlock',
234+ 'Removes a lock for a wiki page.'
235+ );
236+ $options->registerArgument(
237+ 'wikipage',
238+ 'The wiki page to unlock',
239+ true,
240+ 'unlock'
241+ );
242+ }
243+
244+ /**
245+ * Your main program
246+ *
247+ * Arguments and options have been parsed when this is run
248+ *
249+ * @param DokuCLI_Options $options
250+ * @return void
251+ */
252+ protected function main(DokuCLI_Options $options) {
253+ $this->force = $options->getOpt('force', false);
254+ $this->username = $options->getOpt('user', $this->getUser());
255+
256+ $command = $options->getCmd();
257+ switch($command) {
258+ case 'checkout':
259+ $wiki_id = array_shift($options->args);
260+ $localfile = array_shift($options->args);
261+ $this->commandCheckout($wiki_id, $localfile);
262+ break;
263+ case 'commit':
264+ $localfile = array_shift($options->args);
265+ $wiki_id = array_shift($options->args);
266+ $this->commandCommit(
267+ $localfile,
268+ $wiki_id,
269+ $options->getOpt('message', ''),
270+ $options->getOpt('trivial', false)
271+ );
272+ break;
273+ case 'lock':
274+ $wiki_id = array_shift($options->args);
275+ $this->obtainLock($wiki_id);
276+ $this->success("$wiki_id locked");
277+ break;
278+ case 'unlock':
279+ $wiki_id = array_shift($options->args);
280+ $this->clearLock($wiki_id);
281+ $this->success("$wiki_id unlocked");
282+ break;
283+ default:
284+ echo $options->help();
285+ }
286+ }
287+
288+ /**
289+ * Check out a file
290+ *
291+ * @param string $wiki_id
292+ * @param string $localfile
293+ */
294+ protected function commandCheckout($wiki_id, $localfile) {
295+ global $conf;
296+
297+ $wiki_id = cleanID($wiki_id);
298+ $wiki_fn = wikiFN($wiki_id);
299+
300+ if(!file_exists($wiki_fn)) {
301+ $this->fatal("$wiki_id does not yet exist");
302+ }
303+
304+ if(empty($localfile)) {
305+ $localfile = getcwd().'/'.utf8_basename($wiki_fn);
306+ }
307+
308+ if(!file_exists(dirname($localfile))) {
309+ $this->fatal("Directory ".dirname($localfile)." does not exist");
310+ }
311+
312+ if(stristr(realpath(dirname($localfile)), realpath($conf['datadir'])) !== false) {
313+ $this->fatal("Attempt to check out file into data directory - not allowed");
314+ }
315+
316+ $this->obtainLock($wiki_id);
317+
318+ if(!copy($wiki_fn, $localfile)) {
319+ $this->clearLock($wiki_id);
320+ $this->fatal("Unable to copy $wiki_fn to $localfile");
321+ }
322+
323+ $this->success("$wiki_id > $localfile");
324+ }
325+
326+ /**
327+ * Save a file as a new page revision
328+ *
329+ * @param string $localfile
330+ * @param string $wiki_id
331+ * @param string $message
332+ * @param bool $minor
333+ */
334+ protected function commandCommit($localfile, $wiki_id, $message, $minor) {
335+ $wiki_id = cleanID($wiki_id);
336+ $message = trim($message);
337+
338+ if(!file_exists($localfile)) {
339+ $this->fatal("$localfile does not exist");
340+ }
341+
342+ if(!is_readable($localfile)) {
343+ $this->fatal("Cannot read from $localfile");
344+ }
345+
346+ if(!$message) {
347+ $this->fatal("Summary message required");
348+ }
349+
350+ $this->obtainLock($wiki_id);
351+
352+ saveWikiText($wiki_id, file_get_contents($localfile), $message, $minor);
353+
354+ $this->clearLock($wiki_id);
355+
356+ $this->success("$localfile > $wiki_id");
357+ }
358+
359+ /**
360+ * Lock the given page or exit
361+ *
362+ * @param string $wiki_id
363+ */
364+ protected function obtainLock($wiki_id) {
365+ if($this->force) $this->deleteLock($wiki_id);
366+
367+ $_SERVER['REMOTE_USER'] = $this->username;
368+
369+ if(checklock($wiki_id)) {
370+ $this->error("Page $wiki_id is already locked by another user");
371+ exit(1);
372+ }
373+
374+ lock($wiki_id);
375+
376+ if(checklock($wiki_id) != $this->username) {
377+ $this->error("Unable to obtain lock for $wiki_id ");
378+ var_dump(checklock($wiki_id));
379+ exit(1);
380+ }
381+ }
382+
383+ /**
384+ * Clear the lock on the given page
385+ *
386+ * @param string $wiki_id
387+ */
388+ protected function clearLock($wiki_id) {
389+ if($this->force) $this->deleteLock($wiki_id);
390+
391+ $_SERVER['REMOTE_USER'] = $this->username;
392+ if(checklock($wiki_id)) {
393+ $this->error("Page $wiki_id is locked by another user");
394+ exit(1);
395+ }
396+
397+ unlock($wiki_id);
398+
399+ if(file_exists(wikiLockFN($wiki_id))) {
400+ $this->error("Unable to clear lock for $wiki_id");
401+ exit(1);
402+ }
403+ }
404+
405+ /**
406+ * Forcefully remove a lock on the page given
407+ *
408+ * @param string $wiki_id
409+ */
410+ protected function deleteLock($wiki_id) {
411+ $wikiLockFN = wikiLockFN($wiki_id);
412+
413+ if(file_exists($wikiLockFN)) {
414+ if(!unlink($wikiLockFN)) {
415+ $this->error("Unable to delete $wikiLockFN");
416+ exit(1);
417+ }
418+ }
419+ }
420+
421+ /**
422+ * Get the current user's username from the environment
423+ *
424+ * @return string
425+ */
426+ protected function getUser() {
427+ $user = getenv('USER');
428+ if(empty ($user)) {
429+ $user = getenv('USERNAME');
430+ } else {
431+ return $user;
432+ }
433+ if(empty ($user)) {
434+ $user = 'admin';
435+ }
436 return $user;
437 }
438- if (empty ($user)) {
439- $user = 'admin';
440- }
441- return $user;
442-}
443-
444-#------------------------------------------------------------------------------
445-function getSuppliedArgument($OPTS, $short, $long) {
446- $arg = $OPTS->get($short);
447- if ( is_null($arg) ) {
448- $arg = $OPTS->get($long);
449- }
450- return $arg;
451-}
452-
453-#------------------------------------------------------------------------------
454-function obtainLock($WIKI_ID) {
455-
456- global $USERNAME;
457-
458- if ( !file_exists(wikiFN($WIKI_ID)) ) {
459- fwrite( STDERR, "$WIKI_ID does not yet exist\n");
460- }
461-
462- $_SERVER['REMOTE_USER'] = $USERNAME;
463- if ( checklock($WIKI_ID) ) {
464- fwrite( STDERR, "Page $WIKI_ID is already locked by another user\n");
465- exit(1);
466- }
467-
468- lock($WIKI_ID);
469-
470- $_SERVER['REMOTE_USER'] = '_'.$USERNAME.'_';
471-
472- if ( checklock($WIKI_ID) != $USERNAME ) {
473-
474- fwrite( STDERR, "Unable to obtain lock for $WIKI_ID\n" );
475- exit(1);
476-
477- }
478-}
479-
480-#------------------------------------------------------------------------------
481-function clearLock($WIKI_ID) {
482-
483- global $USERNAME ;
484-
485- if ( !file_exists(wikiFN($WIKI_ID)) ) {
486- fwrite( STDERR, "$WIKI_ID does not yet exist\n");
487- }
488-
489- $_SERVER['REMOTE_USER'] = $USERNAME;
490- if ( checklock($WIKI_ID) ) {
491- fwrite( STDERR, "Page $WIKI_ID is locked by another user\n");
492- exit(1);
493- }
494-
495- unlock($WIKI_ID);
496-
497- if ( file_exists(wikiLockFN($WIKI_ID)) ) {
498- fwrite( STDERR, "Unable to clear lock for $WIKI_ID\n" );
499- exit(1);
500- }
501-
502-}
503-
504-#------------------------------------------------------------------------------
505-function deleteLock($WIKI_ID) {
506-
507- $wikiLockFN = wikiLockFN($WIKI_ID);
508-
509- if ( file_exists($wikiLockFN) ) {
510- if ( !unlink($wikiLockFN) ) {
511- fwrite( STDERR, "Unable to delete $wikiLockFN\n" );
512- exit(1);
513- }
514- }
515-
516-}
517-
518-#------------------------------------------------------------------------------
519-$USERNAME = getUser();
520-$CWD = getcwd();
521-$SYSTEM_ID = '127.0.0.1';
522-
523-#------------------------------------------------------------------------------
524-$OPTS = Doku_Cli_Opts::getOptions(
525- __FILE__,
526- 'h::fm:u:s:t',
527- array(
528- 'help==',
529- 'user=',
530- 'system=',
531- 'trivial',
532- )
533-);
534-
535-if ( $OPTS->isError() ) {
536- print $OPTS->getMessage()."\n";
537- exit(1);
538-}
539-
540-if ( $OPTS->has('h') or $OPTS->has('help') or !$OPTS->hasArgs() ) {
541- usage(getSuppliedArgument($OPTS,'h','help'));
542- exit(0);
543-}
544-
545-if ( $OPTS->has('u') or $OPTS->has('user') ) {
546- $USERNAME = getSuppliedArgument($OPTS,'u','user');
547-}
548-
549-if ( $OPTS->has('s') or $OPTS->has('system') ) {
550- $SYSTEM_ID = getSuppliedArgument($OPTS,'s','system');
551-}
552-
553-#------------------------------------------------------------------------------
554-switch ( $OPTS->arg(0) ) {
555-
556- #----------------------------------------------------------------------
557- case 'checkout':
558-
559- $WIKI_ID = $OPTS->arg(1);
560-
561- if ( !$WIKI_ID ) {
562- fwrite( STDERR, "Wiki page ID required\n");
563- exit(1);
564- }
565-
566- $WIKI_FN = wikiFN($WIKI_ID);
567-
568- if ( !file_exists($WIKI_FN) ) {
569- fwrite( STDERR, "$WIKI_ID does not yet exist\n");
570- exit(1);
571- }
572-
573- $TARGET_FN = $OPTS->arg(2);
574-
575- if ( empty($TARGET_FN) ) {
576- $TARGET_FN = getcwd().'/'.utf8_basename($WIKI_FN);
577- }
578-
579- if ( !file_exists(dirname($TARGET_FN)) ) {
580- fwrite( STDERR, "Directory ".dirname($TARGET_FN)." does not exist\n");
581- exit(1);
582- }
583-
584- if ( stristr( realpath(dirname($TARGET_FN)), realpath($conf['datadir']) ) !== false ) {
585- fwrite( STDERR, "Attempt to check out file into data directory - not allowed\n");
586- exit(1);
587- }
588-
589- if ( $OPTS->has('f') ) {
590- deleteLock($WIKI_ID);
591- }
592-
593- obtainLock($WIKI_ID);
594-
595- # Need to lock the file first?
596- if ( !copy($WIKI_FN, $TARGET_FN) ) {
597- fwrite( STDERR, "Unable to copy $WIKI_FN to $TARGET_FN\n");
598- clearLock($WIKI_ID);
599- exit(1);
600- }
601-
602- print "$WIKI_ID > $TARGET_FN\n";
603- exit(0);
604-
605- break;
606-
607- #----------------------------------------------------------------------
608- case 'commit':
609-
610- $TARGET_FN = $OPTS->arg(1);
611-
612- if ( !$TARGET_FN ) {
613- fwrite( STDERR, "Target filename required\n");
614- exit(1);
615- }
616-
617- if ( !file_exists($TARGET_FN) ) {
618- fwrite( STDERR, "$TARGET_FN does not exist\n");
619- exit(1);
620- }
621-
622- if ( !is_readable($TARGET_FN) ) {
623- fwrite( STDERR, "Cannot read from $TARGET_FN\n");
624- exit(1);
625- }
626-
627- $WIKI_ID = $OPTS->arg(2);
628-
629- if ( !$WIKI_ID ) {
630- fwrite( STDERR, "Wiki page ID required\n");
631- exit(1);
632- }
633-
634- if ( !$OPTS->has('m') ) {
635- fwrite( STDERR, "Summary message required\n");
636- exit(1);
637- }
638-
639- if ( $OPTS->has('f') ) {
640- deleteLock($WIKI_ID);
641- }
642-
643- $_SERVER['REMOTE_USER'] = $USERNAME;
644- if ( checklock($WIKI_ID) ) {
645- fwrite( STDERR, "$WIKI_ID is locked by another user\n");
646- exit(1);
647- }
648-
649- obtainLock($WIKI_ID);
650-
651- saveWikiText($WIKI_ID, file_get_contents($TARGET_FN), $OPTS->get('m'), $OPTS->has('t'));
652-
653- clearLock($WIKI_ID);
654-
655- exit(0);
656-
657- break;
658-
659- #----------------------------------------------------------------------
660- case 'lock':
661-
662- $WIKI_ID = $OPTS->arg(1);
663-
664- if ( !$WIKI_ID ) {
665- fwrite( STDERR, "Wiki page ID required\n");
666- exit(1);
667- }
668-
669- if ( $OPTS->has('f') ) {
670- deleteLock($WIKI_ID);
671- }
672-
673- obtainLock($WIKI_ID);
674-
675- print "Locked : $WIKI_ID\n";
676- exit(0);
677-
678- break;
679-
680- #----------------------------------------------------------------------
681- case 'unlock':
682-
683- $WIKI_ID = $OPTS->arg(1);
684-
685- if ( !$WIKI_ID ) {
686- fwrite( STDERR, "Wiki page ID required\n");
687- exit(1);
688- }
689-
690- if ( $OPTS->has('f') ) {
691- deleteLock($WIKI_ID);
692- } else {
693- clearLock($WIKI_ID);
694- }
695-
696- print "Unlocked : $WIKI_ID\n";
697- exit(0);
698-
699- break;
700-
701- #----------------------------------------------------------------------
702- default:
703-
704- fwrite( STDERR, "Invalid action ".$OPTS->arg(0)."\n" );
705- exit(1);
706-
707- break;
708-
709-}
710-
711+}
712+
713+
714+// Main
715+$cli = new PageCLI();
716+$cli->run();
717\ No newline at end of file
718
719=== modified file 'bin/gittool.php'
720--- bin/gittool.php 2014-06-08 13:04:43 +0000
721+++ bin/gittool.php 2015-11-12 19:55:23 +0000
722@@ -1,84 +1,107 @@
723 #!/usr/bin/php
724 <?php
725-
726-if('cli' != php_sapi_name()) die();
727-ini_set('memory_limit', '128M');
728 if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
729 define('NOSESSION', 1);
730 require_once(DOKU_INC.'inc/init.php');
731
732-$GitToolCLI = new GitToolCLI();
733-
734-array_shift($argv);
735-$command = array_shift($argv);
736-
737-switch($command) {
738- case '':
739- case 'help':
740- $GitToolCLI->cmd_help();
741- break;
742- case 'clone':
743- $GitToolCLI->cmd_clone($argv);
744- break;
745- case 'install':
746- $GitToolCLI->cmd_install($argv);
747- break;
748- case 'repo':
749- case 'repos':
750- $GitToolCLI->cmd_repos();
751- break;
752- default:
753- $GitToolCLI->cmd_git($command, $argv);
754-}
755-
756 /**
757 * Easily manage DokuWiki git repositories
758 *
759 * @author Andreas Gohr <andi@splitbrain.org>
760 */
761-class GitToolCLI {
762- private $color = true;
763-
764- public function cmd_help() {
765- echo <<<EOF
766-Usage: gittool.php <command> [parameters]
767-
768-Manage git repositories for DokuWiki and its plugins and templates.
769-
770-EXAMPLE
771-
772-$> ./bin/gittool.php clone gallery template:ach
773-$> ./bin/gittool.php repos
774-$> ./bin/gittool.php origin -v
775-
776-COMMANDS
777-
778-help
779- This help screen
780-
781-clone <extensions>
782- Tries to install a known plugin or template (prefix with template:) via
783- git. Uses the DokuWiki.org plugin repository to find the proper git
784- repository. Multiple extensions can be given as parameters
785-
786-install <extensions>
787- The same as clone, but when no git source repository can be found, the
788- extension is installed via download
789-
790-repos
791- Lists all git repositories found in this DokuWiki installation
792-
793-<any>
794- Any unknown commands are assumed to be arguments to git and will be
795- executed in all repositories found within this DokuWiki installation
796-
797-EOF;
798+class GitToolCLI extends DokuCLI {
799+
800+ /**
801+ * Register options and arguments on the given $options object
802+ *
803+ * @param DokuCLI_Options $options
804+ * @return void
805+ */
806+ protected function setup(DokuCLI_Options $options) {
807+ $options->setHelp(
808+ "Manage git repositories for DokuWiki and its plugins and templates.\n\n".
809+ "$> ./bin/gittool.php clone gallery template:ach\n".
810+ "$> ./bin/gittool.php repos\n".
811+ "$> ./bin/gittool.php origin -v"
812+ );
813+
814+ $options->registerArgument(
815+ 'command',
816+ 'Command to execute. See below',
817+ true
818+ );
819+
820+ $options->registerCommand(
821+ 'clone',
822+ 'Tries to install a known plugin or template (prefix with template:) via git. Uses the DokuWiki.org '.
823+ 'plugin repository to find the proper git repository. Multiple extensions can be given as parameters'
824+ );
825+ $options->registerArgument(
826+ 'extension',
827+ 'name of the extension to install, prefix with \'template:\' for templates',
828+ true,
829+ 'clone'
830+ );
831+
832+ $options->registerCommand(
833+ 'install',
834+ 'The same as clone, but when no git source repository can be found, the extension is installed via '.
835+ 'download'
836+ );
837+ $options->registerArgument(
838+ 'extension',
839+ 'name of the extension to install, prefix with \'template:\' for templates',
840+ true,
841+ 'install'
842+ );
843+
844+ $options->registerCommand(
845+ 'repos',
846+ 'Lists all git repositories found in this DokuWiki installation'
847+ );
848+
849+ $options->registerCommand(
850+ '*',
851+ 'Any unknown commands are assumed to be arguments to git and will be executed in all repositories '.
852+ 'found within this DokuWiki installation'
853+ );
854+ }
855+
856+ /**
857+ * Your main program
858+ *
859+ * Arguments and options have been parsed when this is run
860+ *
861+ * @param DokuCLI_Options $options
862+ * @return void
863+ */
864+ protected function main(DokuCLI_Options $options) {
865+ $command = $options->getCmd();
866+ if(!$command) $command = array_shift($options->args);
867+
868+ switch($command) {
869+ case '':
870+ echo $options->help();
871+ break;
872+ case 'clone':
873+ $this->cmd_clone($options->args);
874+ break;
875+ case 'install':
876+ $this->cmd_install($options->args);
877+ break;
878+ case 'repo':
879+ case 'repos':
880+ $this->cmd_repos();
881+ break;
882+ default:
883+ $this->cmd_git($command, $options->args);
884+ }
885 }
886
887 /**
888 * Tries to install the given extensions using git clone
889 *
890- * @param $extensions
891+ * @param array $extensions
892 */
893 public function cmd_clone($extensions) {
894 $errors = array();
895@@ -88,7 +111,7 @@
896 $repo = $this->getSourceRepo($ext);
897
898 if(!$repo) {
899- $this->msg_error("could not find a repository for $ext");
900+ $this->error("could not find a repository for $ext");
901 $errors[] = $ext;
902 } else {
903 if($this->cloneExtension($ext, $repo)) {
904@@ -100,14 +123,14 @@
905 }
906
907 echo "\n";
908- if($succeeded) $this->msg_success('successfully cloned the following extensions: '.join(', ', $succeeded));
909- if($errors) $this->msg_error('failed to clone the following extensions: '.join(', ', $errors));
910+ if($succeeded) $this->success('successfully cloned the following extensions: '.join(', ', $succeeded));
911+ if($errors) $this->error('failed to clone the following extensions: '.join(', ', $errors));
912 }
913
914 /**
915 * Tries to install the given extensions using git clone with fallback to install
916 *
917- * @param $extensions
918+ * @param array $extensions
919 */
920 public function cmd_install($extensions) {
921 $errors = array();
922@@ -117,7 +140,7 @@
923 $repo = $this->getSourceRepo($ext);
924
925 if(!$repo) {
926- $this->msg_info("could not find a repository for $ext");
927+ $this->info("could not find a repository for $ext");
928 if($this->downloadExtension($ext)) {
929 $succeeded[] = $ext;
930 } else {
931@@ -133,8 +156,8 @@
932 }
933
934 echo "\n";
935- if($succeeded) $this->msg_success('successfully installed the following extensions: '.join(', ', $succeeded));
936- if($errors) $this->msg_error('failed to install the following extensions: '.join(', ', $errors));
937+ if($succeeded) $this->success('successfully installed the following extensions: '.join(', ', $succeeded));
938+ if($errors) $this->error('failed to install the following extensions: '.join(', ', $errors));
939 }
940
941 /**
942@@ -152,19 +175,19 @@
943
944 foreach($repos as $repo) {
945 if(!@chdir($repo)) {
946- $this->msg_error("Could not change into $repo");
947+ $this->error("Could not change into $repo");
948 continue;
949 }
950
951 echo "\n";
952- $this->msg_info("executing $shell in $repo");
953+ $this->info("executing $shell in $repo");
954 $ret = 0;
955 system($shell, $ret);
956
957 if($ret == 0) {
958- $this->msg_success("git succeeded in $repo");
959+ $this->success("git succeeded in $repo");
960 } else {
961- $this->msg_error("git failed in $repo");
962+ $this->error("git failed in $repo");
963 }
964 }
965 }
966@@ -183,33 +206,34 @@
967 * Install extension from the given download URL
968 *
969 * @param string $ext
970- * @return bool
971+ * @return bool|null
972 */
973 private function downloadExtension($ext) {
974 /** @var helper_plugin_extension_extension $plugin */
975 $plugin = plugin_load('helper', 'extension_extension');
976 if(!$ext) die("extension plugin not available, can't continue");
977+
978 $plugin->setExtension($ext);
979
980 $url = $plugin->getDownloadURL();
981 if(!$url) {
982- $this->msg_error("no download URL for $ext");
983+ $this->error("no download URL for $ext");
984 return false;
985 }
986
987 $ok = false;
988 try {
989- $this->msg_info("installing $ext via download from $url");
990+ $this->info("installing $ext via download from $url");
991 $ok = $plugin->installFromURL($url);
992 } catch(Exception $e) {
993- $this->msg_error($e->getMessage());
994+ $this->error($e->getMessage());
995 }
996
997 if($ok) {
998- $this->msg_success("installed $ext via download");
999+ $this->success("installed $ext via download");
1000 return true;
1001 } else {
1002- $this->msg_success("failed to install $ext via download");
1003+ $this->success("failed to install $ext via download");
1004 return false;
1005 }
1006 }
1007@@ -228,14 +252,14 @@
1008 $target = DOKU_PLUGIN.$ext;
1009 }
1010
1011- $this->msg_info("cloning $ext from $repo to $target");
1012+ $this->info("cloning $ext from $repo to $target");
1013 $ret = 0;
1014 system("git clone $repo $target", $ret);
1015 if($ret === 0) {
1016- $this->msg_success("cloning of $ext succeeded");
1017+ $this->success("cloning of $ext succeeded");
1018 return true;
1019 } else {
1020- $this->msg_error("cloning of $ext failed");
1021+ $this->error("cloning of $ext failed");
1022 return false;
1023 }
1024 }
1025@@ -248,7 +272,7 @@
1026 * @return array
1027 */
1028 private function findRepos() {
1029- $this->msg_info('Looking for .git directories');
1030+ $this->info('Looking for .git directories');
1031 $data = array_merge(
1032 glob(DOKU_INC.'.git', GLOB_ONLYDIR),
1033 glob(DOKU_PLUGIN.'*/.git', GLOB_ONLYDIR),
1034@@ -256,9 +280,9 @@
1035 );
1036
1037 if(!$data) {
1038- $this->msg_error('Found no .git directories');
1039+ $this->error('Found no .git directories');
1040 } else {
1041- $this->msg_success('Found '.count($data).' .git directories');
1042+ $this->success('Found '.count($data).' .git directories');
1043 }
1044 $data = array_map('fullpath', array_map('dirname', $data));
1045 return $data;
1046@@ -268,12 +292,13 @@
1047 * Returns the repository for the given extension
1048 *
1049 * @param $extension
1050- * @return bool|string
1051+ * @return false|string
1052 */
1053 private function getSourceRepo($extension) {
1054 /** @var helper_plugin_extension_extension $ext */
1055 $ext = plugin_load('helper', 'extension_extension');
1056 if(!$ext) die("extension plugin not available, can't continue");
1057+
1058 $ext->setExtension($extension);
1059
1060 $repourl = $ext->getSourcerepoURL();
1061@@ -304,37 +329,8 @@
1062
1063 return false;
1064 }
1065-
1066- /**
1067- * Print an error message
1068- *
1069- * @param $string
1070- */
1071- private function msg_error($string) {
1072- if($this->color) echo "\033[31m"; // red
1073- echo "E: $string\n";
1074- if($this->color) echo "\033[37m"; // reset
1075- }
1076-
1077- /**
1078- * Print a success message
1079- *
1080- * @param $string
1081- */
1082- private function msg_success($string) {
1083- if($this->color) echo "\033[32m"; // green
1084- echo "S: $string\n";
1085- if($this->color) echo "\033[37m"; // reset
1086- }
1087-
1088- /**
1089- * Print an info message
1090- *
1091- * @param $string
1092- */
1093- private function msg_info($string) {
1094- if($this->color) echo "\033[36m"; // cyan
1095- echo "I: $string\n";
1096- if($this->color) echo "\033[37m"; // reset
1097- }
1098-}
1099\ No newline at end of file
1100+}
1101+
1102+// Main
1103+$cli = new GitToolCLI();
1104+$cli->run();
1105\ No newline at end of file
1106
1107=== modified file 'bin/indexer.php'
1108--- bin/indexer.php 2014-06-08 13:04:43 +0000
1109+++ bin/indexer.php 2015-11-12 19:55:23 +0000
1110@@ -1,98 +1,103 @@
1111 #!/usr/bin/php
1112 <?php
1113-if ('cli' != php_sapi_name()) die();
1114-
1115-ini_set('memory_limit','128M');
1116-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
1117+if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
1118+define('NOSESSION', 1);
1119 require_once(DOKU_INC.'inc/init.php');
1120-require_once(DOKU_INC.'inc/cliopts.php');
1121-session_write_close();
1122-
1123-// handle options
1124-$short_opts = 'hcuq';
1125-$long_opts = array('help', 'clear', 'update', 'quiet');
1126-$OPTS = Doku_Cli_Opts::getOptions(__FILE__,$short_opts,$long_opts);
1127-if ( $OPTS->isError() ) {
1128- fwrite( STDERR, $OPTS->getMessage() . "\n");
1129- _usage();
1130- exit(1);
1131-}
1132-$CLEAR = false;
1133-$QUIET = false;
1134-$INDEXER = null;
1135-foreach ($OPTS->options as $key => $val) {
1136- switch ($key) {
1137- case 'h':
1138- case 'help':
1139- _usage();
1140- exit;
1141- case 'c':
1142- case 'clear':
1143- $CLEAR = true;
1144- break;
1145- case 'q':
1146- case 'quiet':
1147- $QUIET = true;
1148- break;
1149- }
1150-}
1151-
1152-#------------------------------------------------------------------------------
1153-# Action
1154-
1155-if($CLEAR) _clearindex();
1156-_update();
1157-
1158-
1159-
1160-#------------------------------------------------------------------------------
1161-
1162-function _usage() {
1163- print "Usage: indexer.php <options>
1164-
1165- Updates the searchindex by indexing all new or changed pages
1166- when the -c option is given the index is cleared first.
1167-
1168- OPTIONS
1169- -h, --help show this help and exit
1170- -c, --clear clear the index before updating
1171- -q, --quiet don't produce any output
1172-";
1173-}
1174-
1175-function _update(){
1176- global $conf;
1177- $data = array();
1178- _quietecho("Searching pages... ");
1179- search($data,$conf['datadir'],'search_allpages',array('skipacl' => true));
1180- _quietecho(count($data)." pages found.\n");
1181-
1182- foreach($data as $val){
1183- _index($val['id']);
1184- }
1185-}
1186-
1187-function _index($id){
1188- global $CLEAR;
1189- global $QUIET;
1190-
1191- _quietecho("$id... ");
1192- idx_addPage($id, !$QUIET, $CLEAR);
1193- _quietecho("done.\n");
1194-}
1195
1196 /**
1197- * Clear all index files
1198+ * Update the Search Index from command line
1199 */
1200-function _clearindex(){
1201- _quietecho("Clearing index... ");
1202- idx_get_indexer()->clear();
1203- _quietecho("done.\n");
1204-}
1205-
1206-function _quietecho($msg) {
1207- global $QUIET;
1208- if(!$QUIET) echo $msg;
1209-}
1210-
1211-//Setup VIM: ex: et ts=2 :
1212+class IndexerCLI extends DokuCLI {
1213+
1214+ private $quiet = false;
1215+ private $clear = false;
1216+
1217+ /**
1218+ * Register options and arguments on the given $options object
1219+ *
1220+ * @param DokuCLI_Options $options
1221+ * @return void
1222+ */
1223+ protected function setup(DokuCLI_Options $options) {
1224+ $options->setHelp(
1225+ 'Updates the searchindex by indexing all new or changed pages. When the -c option is '.
1226+ 'given the index is cleared first.'
1227+ );
1228+
1229+ $options->registerOption(
1230+ 'clear',
1231+ 'clear the index before updating',
1232+ 'c'
1233+ );
1234+ $options->registerOption(
1235+ 'quiet',
1236+ 'don\'t produce any output',
1237+ 'q'
1238+ );
1239+ }
1240+
1241+ /**
1242+ * Your main program
1243+ *
1244+ * Arguments and options have been parsed when this is run
1245+ *
1246+ * @param DokuCLI_Options $options
1247+ * @return void
1248+ */
1249+ protected function main(DokuCLI_Options $options) {
1250+ $this->clear = $options->getOpt('clear');
1251+ $this->quiet = $options->getOpt('quiet');
1252+
1253+ if($this->clear) $this->clearindex();
1254+
1255+ $this->update();
1256+ }
1257+
1258+ /**
1259+ * Update the index
1260+ */
1261+ function update() {
1262+ global $conf;
1263+ $data = array();
1264+ $this->quietecho("Searching pages... ");
1265+ search($data, $conf['datadir'], 'search_allpages', array('skipacl' => true));
1266+ $this->quietecho(count($data)." pages found.\n");
1267+
1268+ foreach($data as $val) {
1269+ $this->index($val['id']);
1270+ }
1271+ }
1272+
1273+ /**
1274+ * Index the given page
1275+ *
1276+ * @param string $id
1277+ */
1278+ function index($id) {
1279+ $this->quietecho("$id... ");
1280+ idx_addPage($id, !$this->quiet, $this->clear);
1281+ $this->quietecho("done.\n");
1282+ }
1283+
1284+ /**
1285+ * Clear all index files
1286+ */
1287+ function clearindex() {
1288+ $this->quietecho("Clearing index... ");
1289+ idx_get_indexer()->clear();
1290+ $this->quietecho("done.\n");
1291+ }
1292+
1293+ /**
1294+ * Print message if not supressed
1295+ *
1296+ * @param string $msg
1297+ */
1298+ function quietecho($msg) {
1299+ if(!$this->quiet) echo $msg;
1300+ }
1301+}
1302+
1303+// Main
1304+$cli = new IndexerCLI();
1305+$cli->run();
1306\ No newline at end of file
1307
1308=== modified file 'bin/render.php'
1309--- bin/render.php 2011-01-24 08:52:15 +0000
1310+++ bin/render.php 2015-11-12 19:55:23 +0000
1311@@ -1,5 +1,10 @@
1312 #!/usr/bin/php
1313 <?php
1314+if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
1315+define('NOSESSION', 1);
1316+require_once(DOKU_INC.'inc/init.php');
1317+
1318+
1319 /**
1320 * A simple commandline tool to render some DokuWiki syntax with a given
1321 * renderer.
1322@@ -9,59 +14,48 @@
1323 * DokuWiki markup
1324 *
1325 * @license GPL2
1326- * @author Andreas Gohr <andi@splitbrain.org>
1327- */
1328-if ('cli' != php_sapi_name()) die();
1329-
1330-ini_set('memory_limit','128M');
1331-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
1332-define('NOSESSION',1);
1333-require_once(DOKU_INC.'inc/init.php');
1334-require_once(DOKU_INC.'inc/common.php');
1335-require_once(DOKU_INC.'inc/parserutils.php');
1336-require_once(DOKU_INC.'inc/cliopts.php');
1337-
1338-// handle options
1339-$short_opts = 'hr:';
1340-$long_opts = array('help','renderer:');
1341-$OPTS = Doku_Cli_Opts::getOptions(__FILE__,$short_opts,$long_opts);
1342-if ( $OPTS->isError() ) {
1343- fwrite( STDERR, $OPTS->getMessage() . "\n");
1344- _usage();
1345- exit(1);
1346-}
1347-$RENDERER = 'xhtml';
1348-foreach ($OPTS->options as $key => $val) {
1349- switch ($key) {
1350- case 'h':
1351- case 'help':
1352- _usage();
1353- exit;
1354- case 'r':
1355- case 'renderer':
1356- $RENDERER = $val;
1357- }
1358-}
1359-
1360-
1361-// do the action
1362-$source = stream_get_contents(STDIN);
1363-$info = array();
1364-$result = p_render($RENDERER,p_get_instructions($source),$info);
1365-if(is_null($result)) die("No such renderer $RENDERER\n");
1366-echo $result;
1367-
1368-/**
1369- * Print usage info
1370- */
1371-function _usage(){
1372- print "Usage: render.php <options>
1373-
1374- Reads DokuWiki syntax from STDIN and renders it with the given renderer
1375- to STDOUT
1376-
1377- OPTIONS
1378- -h, --help show this help and exit
1379- -r, --renderer <renderer> the render mode (default: xhtml)
1380-";
1381-}
1382+ * @author Andreas Gohr <andi@splitbrain.org>
1383+ */
1384+class RenderCLI extends DokuCLI {
1385+
1386+ /**
1387+ * Register options and arguments on the given $options object
1388+ *
1389+ * @param DokuCLI_Options $options
1390+ * @return void
1391+ */
1392+ protected function setup(DokuCLI_Options $options) {
1393+ $options->setHelp(
1394+ 'A simple commandline tool to render some DokuWiki syntax with a given renderer.'.
1395+ "\n\n".
1396+ 'This may not work for plugins that expect a certain environment to be '.
1397+ 'set up before rendering, but should work for most or even all standard '.
1398+ 'DokuWiki markup'
1399+ );
1400+ $options->registerOption('renderer', 'The renderer mode to use. Defaults to xhtml', 'r', 'mode');
1401+ }
1402+
1403+ /**
1404+ * Your main program
1405+ *
1406+ * Arguments and options have been parsed when this is run
1407+ *
1408+ * @param DokuCLI_Options $options
1409+ * @throws DokuCLI_Exception
1410+ * @return void
1411+ */
1412+ protected function main(DokuCLI_Options $options) {
1413+ $renderer = $options->getOpt('renderer', 'xhtml');
1414+
1415+ // do the action
1416+ $source = stream_get_contents(STDIN);
1417+ $info = array();
1418+ $result = p_render($renderer, p_get_instructions($source), $info);
1419+ if(is_null($result)) throw new DokuCLI_Exception("No such renderer $renderer");
1420+ echo $result;
1421+ }
1422+}
1423+
1424+// Main
1425+$cli = new RenderCLI();
1426+$cli->run();
1427\ No newline at end of file
1428
1429=== modified file 'bin/striplangs.php'
1430--- bin/striplangs.php 2014-06-08 13:04:43 +0000
1431+++ bin/striplangs.php 2015-11-12 19:55:23 +0000
1432@@ -1,148 +1,111 @@
1433 #!/usr/bin/php
1434 <?php
1435+if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
1436+define('NOSESSION', 1);
1437+require_once(DOKU_INC.'inc/init.php');
1438+
1439+
1440 /**
1441- * Strip unwanted languages from the DokuWiki install
1442- *
1443- * @author Martin 'E.T.' Misuth <et.github@ethome.sk>
1444+ * Remove unwanted languages from a DokuWiki install
1445 */
1446-if ('cli' != php_sapi_name()) die();
1447-
1448-#------------------------------------------------------------------------------
1449-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
1450-require_once DOKU_INC.'inc/cliopts.php';
1451-
1452-#------------------------------------------------------------------------------
1453-function usage($show_examples = false) {
1454- print "Usage: striplangs.php [-h [-x]] [-e] [-k lang1[,lang2]..[,langN]]
1455-
1456- Removes all languages from the installation, besides the ones
1457- after the -k option. English language is never removed!
1458-
1459- OPTIONS
1460- -h, --help get this help
1461- -x, --examples get also usage examples
1462- -k, --keep comma separated list of languages, -e is always implied
1463- -e, --english keeps english, dummy to use without -k\n";
1464- if ( $show_examples ) {
1465- print "\n
1466- EXAMPLES
1467- Strips all languages, but keeps 'en' and 'de':
1468- striplangs -k de
1469-
1470- Strips all but 'en','ca-valencia','cs','de','is','sk':
1471- striplangs --keep ca-valencia,cs,de,is,sk
1472-
1473- Strips all but 'en':
1474- striplangs -e
1475-
1476- No option specified, prints usage and throws error:
1477- striplangs\n";
1478- }
1479-}
1480-
1481-function getSuppliedArgument($OPTS, $short, $long) {
1482- $arg = $OPTS->get($short);
1483- if ( is_null($arg) ) {
1484- $arg = $OPTS->get($long);
1485- }
1486- return $arg;
1487-}
1488-
1489-function processPlugins($path, $keep_langs) {
1490- if (is_dir($path)) {
1491- $entries = scandir($path);
1492-
1493- foreach ($entries as $entry) {
1494- if ($entry != "." && $entry != "..") {
1495- if ( is_dir($path.'/'.$entry) ) {
1496-
1497- $plugin_langs = $path.'/'.$entry.'/lang';
1498-
1499- if ( is_dir( $plugin_langs ) ) {
1500- stripDirLangs($plugin_langs, $keep_langs);
1501+class StripLangsCLI extends DokuCLI {
1502+
1503+ /**
1504+ * Register options and arguments on the given $options object
1505+ *
1506+ * @param DokuCLI_Options $options
1507+ * @return void
1508+ */
1509+ protected function setup(DokuCLI_Options $options) {
1510+
1511+ $options->setHelp(
1512+ 'Remove all languages from the installation, besides the ones specified. English language '.
1513+ 'is never removed!'
1514+ );
1515+
1516+ $options->registerOption(
1517+ 'keep',
1518+ 'Comma separated list of languages to keep in addition to English.',
1519+ 'k',
1520+ 'langcodes'
1521+ );
1522+ $options->registerOption(
1523+ 'english-only',
1524+ 'Remove all languages except English',
1525+ 'e'
1526+ );
1527+ }
1528+
1529+ /**
1530+ * Your main program
1531+ *
1532+ * Arguments and options have been parsed when this is run
1533+ *
1534+ * @param DokuCLI_Options $options
1535+ * @return void
1536+ */
1537+ protected function main(DokuCLI_Options $options) {
1538+ if($options->getOpt('keep')) {
1539+ $keep = explode(',', $options->getOpt('keep'));
1540+ if(!in_array('en', $keep)) $keep[] = 'en';
1541+ } elseif($options->getOpt('english-only')) {
1542+ $keep = array('en');
1543+ } else {
1544+ echo $options->help();
1545+ exit(0);
1546+ }
1547+
1548+ // Kill all language directories in /inc/lang and /lib/plugins besides those in $langs array
1549+ $this->stripDirLangs(realpath(dirname(__FILE__).'/../inc/lang'), $keep);
1550+ $this->processExtensions(realpath(dirname(__FILE__).'/../lib/plugins'), $keep);
1551+ $this->processExtensions(realpath(dirname(__FILE__).'/../lib/tpl'), $keep);
1552+ }
1553+
1554+ /**
1555+ * Strip languages from extensions
1556+ *
1557+ * @param string $path path to plugin or template dir
1558+ * @param array $keep_langs languages to keep
1559+ */
1560+ protected function processExtensions($path, $keep_langs) {
1561+ if(is_dir($path)) {
1562+ $entries = scandir($path);
1563+
1564+ foreach($entries as $entry) {
1565+ if($entry != "." && $entry != "..") {
1566+ if(is_dir($path.'/'.$entry)) {
1567+
1568+ $plugin_langs = $path.'/'.$entry.'/lang';
1569+
1570+ if(is_dir($plugin_langs)) {
1571+ $this->stripDirLangs($plugin_langs, $keep_langs);
1572+ }
1573 }
1574 }
1575 }
1576 }
1577 }
1578-}
1579-
1580-function stripDirLangs($path, $keep_langs) {
1581- $dir = dir($path);
1582-
1583- while(($cur_dir = $dir->read()) !== false) {
1584- if( $cur_dir != '.' and $cur_dir != '..' and is_dir($path.'/'.$cur_dir)) {
1585-
1586- if ( !in_array($cur_dir, $keep_langs, true ) ) {
1587- killDir($path.'/'.$cur_dir);
1588- }
1589- }
1590- }
1591- $dir->close();
1592-}
1593-
1594-function killDir($dir) {
1595- if (is_dir($dir)) {
1596- $entries = scandir($dir);
1597-
1598- foreach ($entries as $entry) {
1599- if ($entry != "." && $entry != "..") {
1600- if ( is_dir($dir.'/'.$entry) ) {
1601- killDir($dir.'/'.$entry);
1602- } else {
1603- unlink($dir.'/'.$entry);
1604+
1605+ /**
1606+ * Strip languages from path
1607+ *
1608+ * @param string $path path to lang dir
1609+ * @param array $keep_langs languages to keep
1610+ */
1611+ protected function stripDirLangs($path, $keep_langs) {
1612+ $dir = dir($path);
1613+
1614+ while(($cur_dir = $dir->read()) !== false) {
1615+ if($cur_dir != '.' and $cur_dir != '..' and is_dir($path.'/'.$cur_dir)) {
1616+
1617+ if(!in_array($cur_dir, $keep_langs, true)) {
1618+ io_rmdir($path.'/'.$cur_dir, true);
1619 }
1620 }
1621 }
1622- reset($entries);
1623- rmdir($dir);
1624- }
1625-}
1626-#------------------------------------------------------------------------------
1627-
1628-// handle options
1629-$short_opts = 'hxk:e';
1630-$long_opts = array('help', 'examples', 'keep=','english');
1631-
1632-$OPTS = Doku_Cli_Opts::getOptions(__FILE__, $short_opts, $long_opts);
1633-
1634-if ( $OPTS->isError() ) {
1635- fwrite( STDERR, $OPTS->getMessage() . "\n");
1636- exit(1);
1637-}
1638-
1639-// handle '--examples' option
1640-$show_examples = ( $OPTS->has('x') or $OPTS->has('examples') ) ? true : false;
1641-
1642-// handle '--help' option
1643-if ( $OPTS->has('h') or $OPTS->has('help') ) {
1644- usage($show_examples);
1645- exit(0);
1646-}
1647-
1648-// handle both '--keep' and '--english' options
1649-if ( $OPTS->has('k') or $OPTS->has('keep') ) {
1650- $preserved_langs = getSuppliedArgument($OPTS,'k','keep');
1651- $langs = explode(',', $preserved_langs);
1652-
1653- // ! always enforce 'en' lang when using '--keep' (DW relies on it)
1654- if ( !isset($langs['en']) ) {
1655- $langs[]='en';
1656- }
1657-} elseif ( $OPTS->has('e') or $OPTS->has('english') ) {
1658- // '--english' was specified strip everything besides 'en'
1659- $langs = array ('en');
1660-} else {
1661- // no option was specified, print usage but don't do anything as
1662- // this run might not be intented
1663- usage();
1664- print "\n
1665- ERROR
1666- No option specified, use either -h -x to get more info,
1667- or -e to strip every language besides english.\n";
1668- exit(1);
1669-}
1670-
1671-// Kill all language directories in /inc/lang and /lib/plugins besides those in $langs array
1672-stripDirLangs(realpath(dirname(__FILE__).'/../inc/lang'), $langs);
1673-processPlugins(realpath(dirname(__FILE__).'/../lib/plugins'), $langs);
1674+ $dir->close();
1675+ }
1676+}
1677+
1678+$cli = new StripLangsCLI();
1679+$cli->run();
1680\ No newline at end of file
1681
1682=== modified file 'bin/wantedpages.php'
1683--- bin/wantedpages.php 2014-06-08 13:04:43 +0000
1684+++ bin/wantedpages.php 2015-11-12 19:55:23 +0000
1685@@ -1,134 +1,153 @@
1686 #!/usr/bin/php
1687 <?php
1688-if ('cli' != php_sapi_name()) die();
1689-
1690-#------------------------------------------------------------------------------
1691-ini_set('memory_limit','128M');
1692-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
1693-require_once DOKU_INC.'inc/init.php';
1694-require_once DOKU_INC.'inc/common.php';
1695-require_once DOKU_INC.'inc/search.php';
1696-require_once DOKU_INC.'inc/cliopts.php';
1697-
1698-#------------------------------------------------------------------------------
1699-function usage() {
1700- print "Usage: wantedpages.php [wiki:namespace]
1701-
1702- Outputs a list of wanted pages (pages which have
1703- internal links but do not yet exist).
1704-
1705- If the optional [wiki:namespace] is not provided,
1706- defaults to the root wiki namespace
1707-
1708- OPTIONS
1709- -h, --help get help
1710-";
1711-}
1712-
1713-#------------------------------------------------------------------------------
1714-define ('DW_DIR_CONTINUE',1);
1715-define ('DW_DIR_NS',2);
1716-define ('DW_DIR_PAGE',3);
1717-
1718-#------------------------------------------------------------------------------
1719-function dw_dir_filter($entry, $basepath) {
1720- if ($entry == '.' || $entry == '..' ) {
1721- return DW_DIR_CONTINUE;
1722- }
1723- if ( is_dir($basepath . '/' . $entry) ) {
1724- if ( strpos($entry, '_') === 0 ) {
1725- return DW_DIR_CONTINUE;
1726- }
1727- return DW_DIR_NS;
1728- }
1729- if ( preg_match('/\.txt$/',$entry) ) {
1730- return DW_DIR_PAGE;
1731- }
1732- return DW_DIR_CONTINUE;
1733-}
1734-
1735-#------------------------------------------------------------------------------
1736-function dw_get_pages($dir) {
1737- static $trunclen = null;
1738- if ( !$trunclen ) {
1739- global $conf;
1740- $trunclen = strlen($conf['datadir'].':');
1741- }
1742-
1743- if ( !is_dir($dir) ) {
1744- fwrite( STDERR, "Unable to read directory $dir\n");
1745- exit(1);
1746- }
1747-
1748- $pages = array();
1749- $dh = opendir($dir);
1750- while ( false !== ( $entry = readdir($dh) ) ) {
1751- $status = dw_dir_filter($entry, $dir);
1752- if ( $status == DW_DIR_CONTINUE ) {
1753- continue;
1754- } else if ( $status == DW_DIR_NS ) {
1755- $pages = array_merge($pages, dw_get_pages($dir . '/' . $entry));
1756+if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
1757+define('NOSESSION', 1);
1758+require_once(DOKU_INC.'inc/init.php');
1759+
1760+/**
1761+ * Find wanted pages
1762+ */
1763+class WantedPagesCLI extends DokuCLI {
1764+
1765+ const DIR_CONTINUE = 1;
1766+ const DIR_NS = 2;
1767+ const DIR_PAGE = 3;
1768+
1769+ /**
1770+ * Register options and arguments on the given $options object
1771+ *
1772+ * @param DokuCLI_Options $options
1773+ * @return void
1774+ */
1775+ protected function setup(DokuCLI_Options $options) {
1776+ $options->setHelp(
1777+ 'Outputs a list of wanted pages (pages which have internal links but do not yet exist).'
1778+ );
1779+ $options->registerArgument(
1780+ 'namespace',
1781+ 'The namespace to lookup. Defaults to root namespace',
1782+ false
1783+ );
1784+ }
1785+
1786+ /**
1787+ * Your main program
1788+ *
1789+ * Arguments and options have been parsed when this is run
1790+ *
1791+ * @param DokuCLI_Options $options
1792+ * @return void
1793+ */
1794+ protected function main(DokuCLI_Options $options) {
1795+
1796+ if($options->args) {
1797+ $startdir = dirname(wikiFN($options->args[0].':xxx'));
1798 } else {
1799- $page = array(
1800- 'id' => pathID(substr($dir.'/'.$entry,$trunclen)),
1801- 'file'=> $dir.'/'.$entry,
1802+ $startdir = dirname(wikiFN('xxx'));
1803+ }
1804+
1805+ $this->info("searching $startdir");
1806+
1807+ $wanted_pages = array();
1808+
1809+ foreach($this->get_pages($startdir) as $page) {
1810+ $wanted_pages = array_merge($wanted_pages, $this->internal_links($page));
1811+ }
1812+ $wanted_pages = array_unique($wanted_pages);
1813+ sort($wanted_pages);
1814+
1815+ foreach($wanted_pages as $page) {
1816+ print $page."\n";
1817+ }
1818+ }
1819+
1820+ /**
1821+ * Determine directions of the search loop
1822+ *
1823+ * @param string $entry
1824+ * @param string $basepath
1825+ * @return int
1826+ */
1827+ protected function dir_filter($entry, $basepath) {
1828+ if($entry == '.' || $entry == '..') {
1829+ return WantedPagesCLI::DIR_CONTINUE;
1830+ }
1831+ if(is_dir($basepath.'/'.$entry)) {
1832+ if(strpos($entry, '_') === 0) {
1833+ return WantedPagesCLI::DIR_CONTINUE;
1834+ }
1835+ return WantedPagesCLI::DIR_NS;
1836+ }
1837+ if(preg_match('/\.txt$/', $entry)) {
1838+ return WantedPagesCLI::DIR_PAGE;
1839+ }
1840+ return WantedPagesCLI::DIR_CONTINUE;
1841+ }
1842+
1843+ /**
1844+ * Collects recursively the pages in a namespace
1845+ *
1846+ * @param string $dir
1847+ * @return array
1848+ * @throws DokuCLI_Exception
1849+ */
1850+ protected function get_pages($dir) {
1851+ static $trunclen = null;
1852+ if(!$trunclen) {
1853+ global $conf;
1854+ $trunclen = strlen($conf['datadir'].':');
1855+ }
1856+
1857+ if(!is_dir($dir)) {
1858+ throw new DokuCLI_Exception("Unable to read directory $dir");
1859+ }
1860+
1861+ $pages = array();
1862+ $dh = opendir($dir);
1863+ while(false !== ($entry = readdir($dh))) {
1864+ $status = $this->dir_filter($entry, $dir);
1865+ if($status == WantedPagesCLI::DIR_CONTINUE) {
1866+ continue;
1867+ } else if($status == WantedPagesCLI::DIR_NS) {
1868+ $pages = array_merge($pages, $this->get_pages($dir.'/'.$entry));
1869+ } else {
1870+ $page = array(
1871+ 'id' => pathID(substr($dir.'/'.$entry, $trunclen)),
1872+ 'file' => $dir.'/'.$entry,
1873 );
1874- $pages[] = $page;
1875- }
1876- }
1877- closedir($dh);
1878- return $pages;
1879-}
1880-
1881-#------------------------------------------------------------------------------
1882-function dw_internal_links($page) {
1883- global $conf;
1884- $instructions = p_get_instructions(file_get_contents($page['file']));
1885- $links = array();
1886- $cns = getNS($page['id']);
1887- $exists = false;
1888- foreach($instructions as $ins){
1889- if($ins[0] == 'internallink' || ($conf['camelcase'] && $ins[0] == 'camelcaselink') ){
1890- $mid = $ins[1][0];
1891- resolve_pageid($cns,$mid,$exists);
1892- if ( !$exists ) {
1893- list($mid) = explode('#',$mid); //record pages without hashs
1894- $links[] = $mid;
1895- }
1896- }
1897- }
1898- return $links;
1899-}
1900-
1901-#------------------------------------------------------------------------------
1902-$OPTS = Doku_Cli_Opts::getOptions(__FILE__,'h',array('help'));
1903-
1904-if ( $OPTS->isError() ) {
1905- fwrite( STDERR, $OPTS->getMessage() . "\n");
1906- exit(1);
1907-}
1908-
1909-if ( $OPTS->has('h') or $OPTS->has('help') ) {
1910- usage();
1911- exit(0);
1912-}
1913-
1914-$START_DIR = $conf['datadir'];
1915-
1916-if ( $OPTS->numArgs() == 1 ) {
1917- $START_DIR .= '/' . $OPTS->arg(0);
1918-}
1919-
1920-#------------------------------------------------------------------------------
1921-$WANTED_PAGES = array();
1922-
1923-foreach ( dw_get_pages($START_DIR) as $WIKI_PAGE ) {
1924- $WANTED_PAGES = array_merge($WANTED_PAGES,dw_internal_links($WIKI_PAGE));
1925-}
1926-$WANTED_PAGES = array_unique($WANTED_PAGES);
1927-sort($WANTED_PAGES);
1928-
1929-foreach ( $WANTED_PAGES as $WANTED_PAGE ) {
1930- print $WANTED_PAGE."\n";
1931-}
1932-exit(0);
1933+ $pages[] = $page;
1934+ }
1935+ }
1936+ closedir($dh);
1937+ return $pages;
1938+ }
1939+
1940+ /**
1941+ * Parse instructions and returns the non-existing links
1942+ *
1943+ * @param array $page array with page id and file path
1944+ * @return array
1945+ */
1946+ function internal_links($page) {
1947+ global $conf;
1948+ $instructions = p_get_instructions(file_get_contents($page['file']));
1949+ $links = array();
1950+ $cns = getNS($page['id']);
1951+ $exists = false;
1952+ foreach($instructions as $ins) {
1953+ if($ins[0] == 'internallink' || ($conf['camelcase'] && $ins[0] == 'camelcaselink')) {
1954+ $mid = $ins[1][0];
1955+ resolve_pageid($cns, $mid, $exists);
1956+ if(!$exists) {
1957+ list($mid) = explode('#', $mid); //record pages without hashs
1958+ $links[] = $mid;
1959+ }
1960+ }
1961+ }
1962+ return $links;
1963+ }
1964+}
1965+
1966+// Main
1967+$cli = new WantedPagesCLI();
1968+$cli->run();
1969\ No newline at end of file
1970
1971=== modified file 'conf/interwiki.conf'
1972--- conf/interwiki.conf 2014-06-08 13:04:43 +0000
1973+++ conf/interwiki.conf 2015-11-12 19:55:23 +0000
1974@@ -1,37 +1,41 @@
1975-# Each URL may contain one of the placeholders {URL} or {NAME}
1976+# Each URL may contain one of these placeholders
1977 # {URL} is replaced by the URL encoded representation of the wikiname
1978 # this is the right thing to do in most cases
1979 # {NAME} this is replaced by the wikiname as given in the document
1980-# no further encoding is done
1981+# only mandatory encoded is done, urlencoding if the link
1982+# is an external URL, or encoding as a wikiname if it is an
1983+# internal link (begins with a colon)
1984+# {SCHEME}
1985+# {HOST}
1986+# {PORT}
1987+# {PATH}
1988+# {QUERY} these placeholders will be replaced with the appropriate part
1989+# of the link when parsed as a URL
1990 # If no placeholder is defined the urlencoded name is appended to the URL
1991
1992 # To prevent losing your added InterWiki shortcuts after an upgrade,
1993 # you should add new ones to interwiki.local.conf
1994
1995-wp http://en.wikipedia.org/wiki/{NAME}
1996-wpfr http://fr.wikipedia.org/wiki/{NAME}
1997-wpde http://de.wikipedia.org/wiki/{NAME}
1998-wpes http://es.wikipedia.org/wiki/{NAME}
1999-wppl http://pl.wikipedia.org/wiki/{NAME}
2000-wpjp http://ja.wikipedia.org/wiki/{NAME}
2001-wpmeta http://meta.wikipedia.org/wiki/{NAME}
2002-doku http://www.dokuwiki.org/
2003-dokubug http://bugs.dokuwiki.org/index.php?do=details&amp;task_id=
2004-rfc http://tools.ietf.org/html/rfc
2005+wp https://en.wikipedia.org/wiki/{NAME}
2006+wpfr https://fr.wikipedia.org/wiki/{NAME}
2007+wpde https://de.wikipedia.org/wiki/{NAME}
2008+wpes https://es.wikipedia.org/wiki/{NAME}
2009+wppl https://pl.wikipedia.org/wiki/{NAME}
2010+wpjp https://ja.wikipedia.org/wiki/{NAME}
2011+wpmeta https://meta.wikipedia.org/wiki/{NAME}
2012+doku https://www.dokuwiki.org/
2013+rfc https://tools.ietf.org/html/rfc
2014 man http://man.cx/
2015-amazon http://www.amazon.com/exec/obidos/ASIN/{URL}/splitbrain-20/
2016-amazon.de http://www.amazon.de/exec/obidos/ASIN/{URL}/splitbrain-21/
2017-amazon.uk http://www.amazon.co.uk/exec/obidos/ASIN/
2018+amazon https://www.amazon.com/exec/obidos/ASIN/{URL}/splitbrain-20/
2019+amazon.de https://www.amazon.de/exec/obidos/ASIN/{URL}/splitbrain-21/
2020+amazon.uk https://www.amazon.co.uk/exec/obidos/ASIN/
2021 paypal https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=
2022-phpfn http://www.php.net/{NAME}
2023-coral http://{HOST}.{PORT}.nyud.net:8090{PATH}?{QUERY}
2024-freecache http://freecache.org/{NAME}
2025-sb http://www.splitbrain.org/go/
2026+phpfn https://www.php.net/{NAME}
2027 skype skype:{NAME}
2028-google.de http://www.google.de/search?q=
2029-go http://www.google.com/search?q={URL}&amp;btnI=lucky
2030+google.de https://www.google.de/search?q=
2031+go https://www.google.com/search?q={URL}&amp;btnI=lucky
2032 user :user:{NAME}
2033
2034-# To support VoIP/SIP links
2035+# To support VoIP/SIP/TEL links
2036 callto callto://{NAME}
2037-
2038+tel tel:{NAME}
2039
2040=== modified file 'conf/mime.conf'
2041--- conf/mime.conf 2014-06-08 13:15:48 +0000
2042+++ conf/mime.conf 2015-11-12 19:55:23 +0000
2043@@ -9,7 +9,6 @@
2044 png image/png
2045 ico image/vnd.microsoft.icon
2046
2047-#swf application/x-shockwave-flash
2048 mp3 audio/mpeg
2049 ogg audio/ogg
2050 wav audio/wav
2051@@ -66,3 +65,7 @@
2052 #xml text/xml
2053 #csv text/csv
2054
2055+# Also flash may be able to execute arbitrary scripts in the website's
2056+# context
2057+#swf application/x-shockwave-flash
2058+
2059
2060=== modified file 'conf/mysql.conf.php.example'
2061--- conf/mysql.conf.php.example 2014-06-08 13:04:43 +0000
2062+++ conf/mysql.conf.php.example 2015-11-12 19:55:23 +0000
2063@@ -56,7 +56,7 @@
2064 * of the user. If the result table is empty or contains more than one
2065 * row, access will be denied.
2066 *
2067- * The plugin accesses the password as 'pass' so a alias might be necessary.
2068+ * The plugin accesses the password as 'pass' so an alias might be necessary.
2069 *
2070 * Following patters will be replaced:
2071 * %{user} user name
2072@@ -107,10 +107,10 @@
2073 /* This statement should return a table containing all user login names
2074 * that meet certain filter criteria. The filter expressions will be added
2075 * case dependend by the plugin. At the end a sort expression will be added.
2076- * Important is that this list contains no double entries fo a user. Each
2077+ * Important is that this list contains no double entries for a user. Each
2078 * user name is only allowed once in the table.
2079 *
2080- * The login name will be accessed as 'user' to a alias might be neseccary.
2081+ * The login name will be accessed as 'user' to an alias might be neseccary.
2082 * No patterns will be replaced in this statement but following patters
2083 * will be replaced in the filter expressions:
2084 * %{user} in FilterLogin user's login name
2085@@ -174,7 +174,7 @@
2086 WHERE gid='%{gid}'";
2087
2088 /* This statement should return the database index of a given user name.
2089- * The plugin will access the index with the name 'id' so a alias might be
2090+ * The plugin will access the index with the name 'id' so an alias might be
2091 * necessary.
2092 * following patters will be replaced:
2093 * %{user} user name
2094@@ -240,7 +240,7 @@
2095 AND gid='%{gid}'";
2096
2097 /* This statement should return the database index of a given group name.
2098- * The plugin will access the index with the name 'id' so a alias might
2099+ * The plugin will access the index with the name 'id' so an alias might
2100 * be necessary.
2101 *
2102 * Following patters will be replaced:
2103
2104=== modified file 'conf/wordblock.conf'
2105--- conf/wordblock.conf 2014-06-08 13:04:43 +0000
2106+++ conf/wordblock.conf 2015-11-12 19:55:23 +0000
2107@@ -2,16 +2,12 @@
2108 # patches welcome
2109 #
2110 https?:\/\/(\S*?)(-side-effects|top|pharm|pill|discount|discount-|deal|price|order|now|best|cheap|cheap-|online|buy|buy-|sale|sell)(\S*?)(cialis|viagra|prazolam|xanax|zanax|soma|vicodin|zenical|xenical|meridia|paxil|prozac|claritin|allegra|lexapro|wellbutrin|zoloft|retin|valium|levitra|phentermine)
2111-gay\s*sex
2112-bi\s*sex
2113-incest
2114+https?:\/\/(\S*?)(bi\s*sex|gay\s*sex|fetish|incest|penis|\brape\b)
2115 zoosex
2116 gang\s*bang
2117 facials
2118 ladyboy
2119-fetish
2120 \btits\b
2121-\brape\b
2122 bolea\.com
2123 52crystal
2124 baida\.org
2125
2126=== modified file 'doku.php'
2127--- doku.php 2014-06-08 13:15:48 +0000
2128+++ doku.php 2015-11-12 19:55:23 +0000
2129@@ -8,13 +8,18 @@
2130 * @global Input $INPUT
2131 */
2132
2133-// update message version
2134-$updateVersion = 44;
2135+// update message version - always use a string to avoid localized floats!
2136+$updateVersion = "47.1";
2137
2138 // xdebug_start_profiling();
2139
2140 if(!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__).'/');
2141
2142+// define all DokuWiki globals here (needed within test requests but also helps to keep track)
2143+global $ACT, $INPUT, $QUERY, $ID, $REV, $DATE_AT, $IDX,
2144+ $DATE, $RANGE, $HIGH, $TEXT, $PRE, $SUF, $SUM, $INFO, $JSINFO;
2145+
2146+
2147 if(isset($_SERVER['HTTP_X_DOKUWIKI_DO'])) {
2148 $ACT = trim(strtolower($_SERVER['HTTP_X_DOKUWIKI_DO']));
2149 } elseif(!empty($_REQUEST['idx'])) {
2150@@ -29,7 +34,6 @@
2151 Header('Location: /maintenance-search.php');
2152 exit;
2153 }
2154-
2155 // load and initialize the core system
2156 require_once(DOKU_INC.'inc/init.php');
2157
2158@@ -39,6 +43,7 @@
2159 $ID = getID();
2160
2161 $REV = $INPUT->int('rev');
2162+$DATE_AT = $INPUT->str('at');
2163 $IDX = $INPUT->str('idx');
2164 $DATE = $INPUT->int('date');
2165 $RANGE = $INPUT->str('range');
2166@@ -52,7 +57,41 @@
2167 $SUF = cleanText($INPUT->post->str('suffix'));
2168 $SUM = $INPUT->post->str('summary');
2169
2170-//make info about the selected page available
2171+
2172+//parse DATE_AT
2173+if($DATE_AT) {
2174+ $date_parse = strtotime($DATE_AT);
2175+ if($date_parse) {
2176+ $DATE_AT = $date_parse;
2177+ } else { // check for UNIX Timestamp
2178+ $date_parse = @date('Ymd',$DATE_AT);
2179+ if(!$date_parse || $date_parse === '19700101') {
2180+ msg(sprintf($lang['unable_to_parse_date'], $DATE_AT));
2181+ $DATE_AT = null;
2182+ }
2183+ }
2184+}
2185+
2186+//check for existing $REV related to $DATE_AT
2187+if($DATE_AT) {
2188+ $pagelog = new PageChangeLog($ID);
2189+ $rev_t = $pagelog->getLastRevisionAt($DATE_AT);
2190+ if($rev_t === '') { //current revision
2191+ $REV = null;
2192+ $DATE_AT = null;
2193+ } else if ($rev_t === false) { //page did not exist
2194+ $rev_n = $pagelog->getRelativeRevision($DATE_AT,+1);
2195+ msg(sprintf($lang['page_nonexist_rev'],
2196+ strftime($conf['dformat'],$DATE_AT),
2197+ wl($ID, array('rev' => $rev_n)),
2198+ strftime($conf['dformat'],$rev_n)));
2199+ $REV = $DATE_AT; //will result in a page not exists message
2200+ } else {
2201+ $REV = $rev_t;
2202+ }
2203+}
2204+
2205+//make infos about the selected page available
2206 $INFO = pageinfo();
2207
2208 //export minimal info to JS, plugins can add more
2209
2210=== modified file 'feed.php'
2211--- feed.php 2014-06-08 13:04:43 +0000
2212+++ feed.php 2015-11-12 19:55:23 +0000
2213@@ -127,6 +127,8 @@
2214 'items' => array('int', 'num', $conf['recent']),
2215 // Boolean, only used in rc mode
2216 'show_minor' => array('bool', 'minor', false),
2217+ // String, only used in list mode
2218+ 'sort' => array('str', 'sort', 'natural'),
2219 // String, only used in search mode
2220 'search_query' => array('str', 'q', null),
2221 // One of: pages, media, both
2222@@ -138,6 +140,7 @@
2223
2224 $opt['items'] = max(0, (int) $opt['items']);
2225 $opt['show_minor'] = (bool) $opt['show_minor'];
2226+ $opt['sort'] = valid_input_set('sort', array('default' => 'natural', 'date'), $opt);
2227
2228 $opt['guardmail'] = ($conf['mailguard'] != '' && $conf['mailguard'] != 'none');
2229
2230@@ -215,7 +218,7 @@
2231 $date = $ditem['date'];
2232 } elseif ($ditem['media']) {
2233 $date = @filemtime(mediaFN($id));
2234- } elseif (@file_exists(wikiFN($id))) {
2235+ } elseif (file_exists(wikiFN($id))) {
2236 $date = @filemtime(wikiFN($id));
2237 } elseif($meta['date']['modified']) {
2238 $date = $meta['date']['modified'];
2239@@ -303,7 +306,7 @@
2240 $src_r = '';
2241 $src_l = '';
2242
2243- if($size = media_image_preview_size($id, false, new JpegMeta(mediaFN($id)), 300)) {
2244+ if($size = media_image_preview_size($id, '', new JpegMeta(mediaFN($id)), 300)) {
2245 $more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));
2246 $src_r = ml($id, $more, true, '&amp;', true);
2247 }
2248@@ -352,7 +355,7 @@
2249 break;
2250 case 'html':
2251 if($ditem['media']) {
2252- if($size = media_image_preview_size($id, false, new JpegMeta(mediaFN($id)))) {
2253+ if($size = media_image_preview_size($id, '', new JpegMeta(mediaFN($id)))) {
2254 $more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));
2255 $src = ml($id, $more, true, '&amp;', true);
2256 $content = '<img src="'.$src.'" alt="'.$id.'" />';
2257@@ -383,7 +386,7 @@
2258 case 'abstract':
2259 default:
2260 if($ditem['media']) {
2261- if($size = media_image_preview_size($id, false, new JpegMeta(mediaFN($id)))) {
2262+ if($size = media_image_preview_size($id, '', new JpegMeta(mediaFN($id)))) {
2263 $more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));
2264 $src = ml($id, $more, true, '&amp;', true);
2265 $content = '<img src="'.$src.'" alt="'.$id.'" />';
2266@@ -405,6 +408,7 @@
2267 if($userInfo) {
2268 switch($conf['showuseras']) {
2269 case 'username':
2270+ case 'username_link':
2271 $item->author = $userInfo['name'];
2272 break;
2273 default:
2274@@ -479,7 +483,7 @@
2275 global $conf;
2276
2277 $ns = ':'.cleanID($opt['namespace']);
2278- $ns = str_replace(':', '/', $ns);
2279+ $ns = utf8_encodeFN(str_replace(':', '/', $ns));
2280
2281 $data = array();
2282 $search_opts = array(
2283@@ -487,7 +491,7 @@
2284 'pagesonly' => true,
2285 'listfiles' => true
2286 );
2287- search($data, $conf['datadir'], 'search_universal', $search_opts, $ns);
2288+ search($data, $conf['datadir'], 'search_universal', $search_opts, $ns, $lvl = 1, $opt['sort']);
2289
2290 return $data;
2291 }
2292
2293=== modified file 'inc/DifferenceEngine.php'
2294--- inc/DifferenceEngine.php 2014-06-08 13:04:43 +0000
2295+++ inc/DifferenceEngine.php 2015-11-12 19:55:23 +0000
2296@@ -14,6 +14,9 @@
2297 var $orig;
2298 var $closing;
2299
2300+ /**
2301+ * @return _DiffOp
2302+ */
2303 function reverse() {
2304 trigger_error("pure virtual", E_USER_ERROR);
2305 }
2306@@ -104,6 +107,21 @@
2307 */
2308 class _DiffEngine {
2309
2310+ var $xchanged = array();
2311+ var $ychanged = array();
2312+ var $xv = array();
2313+ var $yv = array();
2314+ var $xind = array();
2315+ var $yind = array();
2316+ var $seq;
2317+ var $in_seq;
2318+ var $lcs;
2319+
2320+ /**
2321+ * @param array $from_lines
2322+ * @param array $to_lines
2323+ * @return _DiffOp[]
2324+ */
2325 function diff($from_lines, $to_lines) {
2326 $n_from = count($from_lines);
2327 $n_to = count($to_lines);
2328@@ -495,9 +513,9 @@
2329 * Constructor.
2330 * Computes diff between sequences of strings.
2331 *
2332- * @param $from_lines array An array of strings.
2333- * (Typically these are lines from a file.)
2334- * @param $to_lines array An array of strings.
2335+ * @param array $from_lines An array of strings.
2336+ * (Typically these are lines from a file.)
2337+ * @param array $to_lines An array of strings.
2338 */
2339 function __construct($from_lines, $to_lines) {
2340 $eng = new _DiffEngine;
2341@@ -512,8 +530,9 @@
2342 *
2343 * $diff = new Diff($lines1, $lines2);
2344 * $rev = $diff->reverse();
2345- * @return object A Diff object representing the inverse of the
2346- * original diff.
2347+ *
2348+ * @return Diff A Diff object representing the inverse of the
2349+ * original diff.
2350 */
2351 function reverse() {
2352 $rev = $this;
2353@@ -631,19 +650,19 @@
2354 * case-insensitve diffs, or diffs which ignore
2355 * changes in white-space.
2356 *
2357- * @param $from_lines array An array of strings.
2358- * (Typically these are lines from a file.)
2359- *
2360- * @param $to_lines array An array of strings.
2361- *
2362- * @param $mapped_from_lines array This array should
2363- * have the same size number of elements as $from_lines.
2364- * The elements in $mapped_from_lines and
2365- * $mapped_to_lines are what is actually compared
2366- * when computing the diff.
2367- *
2368- * @param $mapped_to_lines array This array should
2369- * have the same number of elements as $to_lines.
2370+ * @param string[] $from_lines An array of strings.
2371+ * (Typically these are lines from a file.)
2372+ *
2373+ * @param string[] $to_lines An array of strings.
2374+ *
2375+ * @param string[] $mapped_from_lines This array should
2376+ * have the same size number of elements as $from_lines.
2377+ * The elements in $mapped_from_lines and
2378+ * $mapped_to_lines are what is actually compared
2379+ * when computing the diff.
2380+ *
2381+ * @param string[] $mapped_to_lines This array should
2382+ * have the same number of elements as $to_lines.
2383 */
2384 function __construct($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) {
2385
2386@@ -697,12 +716,13 @@
2387 /**
2388 * Format a diff.
2389 *
2390- * @param $diff object A Diff object.
2391+ * @param Diff $diff A Diff object.
2392 * @return string The formatted output.
2393 */
2394 function format($diff) {
2395
2396 $xi = $yi = 1;
2397+ $x0 = $y0 = 0;
2398 $block = false;
2399 $context = array();
2400
2401@@ -752,6 +772,13 @@
2402 return $this->_end_diff();
2403 }
2404
2405+ /**
2406+ * @param int $xbeg
2407+ * @param int $xlen
2408+ * @param int $ybeg
2409+ * @param int $ylen
2410+ * @param array $edits
2411+ */
2412 function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) {
2413 $this->_start_block($this->_block_header($xbeg, $xlen, $ybeg, $ylen));
2414 foreach ($edits as $edit) {
2415@@ -779,6 +806,13 @@
2416 return $val;
2417 }
2418
2419+ /**
2420+ * @param int $xbeg
2421+ * @param int $xlen
2422+ * @param int $ybeg
2423+ * @param int $ylen
2424+ * @return string
2425+ */
2426 function _block_header($xbeg, $xlen, $ybeg, $ylen) {
2427 if ($xlen > 1)
2428 $xbeg .= "," . ($xbeg + $xlen - 1);
2429@@ -788,6 +822,9 @@
2430 return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
2431 }
2432
2433+ /**
2434+ * @param string $header
2435+ */
2436 function _start_block($header) {
2437 echo $header;
2438 }
2439@@ -896,6 +933,9 @@
2440 $this->_tag = $new_tag;
2441 }
2442
2443+ /**
2444+ * @param string $new_tag
2445+ */
2446 function _flushLine($new_tag) {
2447 $this->_flushGroup($new_tag);
2448 if ($this->_line != '')
2449@@ -1055,6 +1095,10 @@
2450 $this->trailing_context_lines = 2;
2451 }
2452
2453+ /**
2454+ * @param Diff $diff
2455+ * @return string
2456+ */
2457 function format($diff) {
2458 // Preserve whitespaces by converting some to non-breaking spaces.
2459 // Do not convert all of them to allow word-wrap.
2460@@ -1165,6 +1209,10 @@
2461 $this->trailing_context_lines = 2;
2462 }
2463
2464+ /**
2465+ * @param Diff $diff
2466+ * @return string
2467+ */
2468 function format($diff) {
2469 // Preserve whitespaces by converting some to non-breaking spaces.
2470 // Do not convert all of them to allow word-wrap.
2471
2472=== added directory 'inc/Form'
2473=== added file 'inc/Form/ButtonElement.php'
2474--- inc/Form/ButtonElement.php 1970-01-01 00:00:00 +0000
2475+++ inc/Form/ButtonElement.php 2015-11-12 19:55:23 +0000
2476@@ -0,0 +1,34 @@
2477+<?php
2478+namespace dokuwiki\Form;
2479+
2480+/**
2481+ * Class ButtonElement
2482+ *
2483+ * Represents a simple button
2484+ *
2485+ * @package dokuwiki\Form
2486+ */
2487+class ButtonElement extends Element {
2488+
2489+ /** @var string HTML content */
2490+ protected $content = '';
2491+
2492+ /**
2493+ * @param string $name
2494+ * @param string $content HTML content of the button. You have to escape it yourself.
2495+ */
2496+ function __construct($name, $content = '') {
2497+ parent::__construct('button', array('name' => $name, 'value' => 1));
2498+ $this->content = $content;
2499+ }
2500+
2501+ /**
2502+ * The HTML representation of this element
2503+ *
2504+ * @return string
2505+ */
2506+ public function toHTML() {
2507+ return '<button ' . buildAttributes($this->attrs()) . '>'.$this->content.'</button>';
2508+ }
2509+
2510+}
2511
2512=== added file 'inc/Form/CheckableElement.php'
2513--- inc/Form/CheckableElement.php 1970-01-01 00:00:00 +0000
2514+++ inc/Form/CheckableElement.php 2015-11-12 19:55:23 +0000
2515@@ -0,0 +1,62 @@
2516+<?php
2517+namespace dokuwiki\Form;
2518+
2519+/**
2520+ * Class CheckableElement
2521+ *
2522+ * For Radio- and Checkboxes
2523+ *
2524+ * @package DokuForm
2525+ */
2526+class CheckableElement extends InputElement {
2527+
2528+ /**
2529+ * @param string $type The type of this element
2530+ * @param string $name The name of this form element
2531+ * @param string $label The label text for this element
2532+ */
2533+ public function __construct($type, $name, $label) {
2534+ parent::__construct($type, $name, $label);
2535+ // default value is 1
2536+ $this->attr('value', 1);
2537+ }
2538+
2539+ /**
2540+ * Handles the useInput flag and sets the checked attribute accordingly
2541+ */
2542+ protected function prefillInput() {
2543+ global $INPUT;
2544+ list($name, $key) = $this->getInputName();
2545+ $myvalue = $this->val();
2546+
2547+ if(!$INPUT->has($name)) return;
2548+
2549+ if($key === null) {
2550+ // no key - single value
2551+ $value = $INPUT->str($name);
2552+ if($value == $myvalue) {
2553+ $this->attr('checked', 'checked');
2554+ } else {
2555+ $this->rmattr('checked');
2556+ }
2557+ } else {
2558+ // we have an array, there might be several values in it
2559+ $input = $INPUT->arr($name);
2560+ if(isset($input[$key])) {
2561+ $this->rmattr('checked');
2562+
2563+ // values seem to be in another sub array
2564+ if(is_array($input[$key])) {
2565+ $input = $input[$key];
2566+ }
2567+
2568+ foreach($input as $value) {
2569+ if($value == $myvalue) {
2570+ $this->attr('checked', 'checked');
2571+ }
2572+ }
2573+ }
2574+ }
2575+ }
2576+
2577+}
2578
2579=== added file 'inc/Form/Element.php'
2580--- inc/Form/Element.php 1970-01-01 00:00:00 +0000
2581+++ inc/Form/Element.php 2015-11-12 19:55:23 +0000
2582@@ -0,0 +1,151 @@
2583+<?php
2584+namespace dokuwiki\Form;
2585+
2586+/**
2587+ * Class Element
2588+ *
2589+ * The basic building block of a form
2590+ *
2591+ * @package dokuwiki\Form
2592+ */
2593+abstract class Element {
2594+
2595+ /**
2596+ * @var array the attributes of this element
2597+ */
2598+ protected $attributes = array();
2599+
2600+ /**
2601+ * @var string The type of this element
2602+ */
2603+ protected $type;
2604+
2605+ /**
2606+ * @param string $type The type of this element
2607+ * @param array $attributes
2608+ */
2609+ public function __construct($type, $attributes = array()) {
2610+ $this->type = $type;
2611+ $this->attributes = $attributes;
2612+ }
2613+
2614+ /**
2615+ * Type of this element
2616+ *
2617+ * @return string
2618+ */
2619+ public function getType() {
2620+ return $this->type;
2621+ }
2622+
2623+ /**
2624+ * Gets or sets an attribute
2625+ *
2626+ * When no $value is given, the current content of the attribute is returned.
2627+ * An empty string is returned for unset attributes.
2628+ *
2629+ * When a $value is given, the content is set to that value and the Element
2630+ * itself is returned for easy chaining
2631+ *
2632+ * @param string $name Name of the attribute to access
2633+ * @param null|string $value New value to set
2634+ * @return string|$this
2635+ */
2636+ public function attr($name, $value = null) {
2637+ // set
2638+ if($value !== null) {
2639+ $this->attributes[$name] = $value;
2640+ return $this;
2641+ }
2642+
2643+ // get
2644+ if(isset($this->attributes[$name])) {
2645+ return $this->attributes[$name];
2646+ } else {
2647+ return '';
2648+ }
2649+ }
2650+
2651+ /**
2652+ * Removes the given attribute if it exists
2653+ *
2654+ * @param $name
2655+ * @return $this
2656+ */
2657+ public function rmattr($name) {
2658+ if(isset($this->attributes[$name])) {
2659+ unset($this->attributes[$name]);
2660+ }
2661+ return $this;
2662+ }
2663+
2664+ /**
2665+ * Gets or adds a all given attributes at once
2666+ *
2667+ * @param array|null $attributes
2668+ * @return array|$this
2669+ */
2670+ public function attrs($attributes = null) {
2671+ // set
2672+ if($attributes) {
2673+ foreach((array) $attributes as $key => $val) {
2674+ $this->attr($key, $val);
2675+ }
2676+ return $this;
2677+ }
2678+ // get
2679+ return $this->attributes;
2680+ }
2681+
2682+ /**
2683+ * Adds a class to the class attribute
2684+ *
2685+ * This is the preferred method of setting the element's class
2686+ *
2687+ * @param string $class the new class to add
2688+ * @return $this
2689+ */
2690+ public function addClass($class) {
2691+ $classes = explode(' ', $this->attr('class'));
2692+ $classes[] = $class;
2693+ $classes = array_unique($classes);
2694+ $classes = array_filter($classes);
2695+ $this->attr('class', join(' ', $classes));
2696+ return $this;
2697+ }
2698+
2699+ /**
2700+ * Get or set the element's ID
2701+ *
2702+ * This is the preferred way of setting the element's ID
2703+ *
2704+ * @param null|string $id
2705+ * @return string|$this
2706+ */
2707+ public function id($id = null) {
2708+ if(strpos($id, '__') === false) {
2709+ throw new \InvalidArgumentException('IDs in DokuWiki have to contain two subsequent underscores');
2710+ }
2711+
2712+ return $this->attr('id', $id);
2713+ }
2714+
2715+ /**
2716+ * Get or set the element's value
2717+ *
2718+ * This is the preferred way of setting the element's value
2719+ *
2720+ * @param null|string $value
2721+ * @return string|$this
2722+ */
2723+ public function val($value = null) {
2724+ return $this->attr('value', $value);
2725+ }
2726+
2727+ /**
2728+ * The HTML representation of this element
2729+ *
2730+ * @return string
2731+ */
2732+ abstract public function toHTML();
2733+}
2734
2735=== added file 'inc/Form/FieldsetCloseElement.php'
2736--- inc/Form/FieldsetCloseElement.php 1970-01-01 00:00:00 +0000
2737+++ inc/Form/FieldsetCloseElement.php 2015-11-12 19:55:23 +0000
2738@@ -0,0 +1,30 @@
2739+<?php
2740+namespace dokuwiki\Form;
2741+
2742+/**
2743+ * Class FieldsetCloseElement
2744+ *
2745+ * Closes an open Fieldset
2746+ *
2747+ * @package dokuwiki\Form
2748+ */
2749+class FieldsetCloseElement extends TagCloseElement {
2750+
2751+ /**
2752+ * @param array $attributes
2753+ */
2754+ public function __construct($attributes = array()) {
2755+ parent::__construct('', $attributes);
2756+ $this->type = 'fieldsetclose';
2757+ }
2758+
2759+
2760+ /**
2761+ * The HTML representation of this element
2762+ *
2763+ * @return string
2764+ */
2765+ public function toHTML() {
2766+ return '</fieldset>';
2767+ }
2768+}
2769
2770=== added file 'inc/Form/FieldsetOpenElement.php'
2771--- inc/Form/FieldsetOpenElement.php 1970-01-01 00:00:00 +0000
2772+++ inc/Form/FieldsetOpenElement.php 2015-11-12 19:55:23 +0000
2773@@ -0,0 +1,36 @@
2774+<?php
2775+namespace dokuwiki\Form;
2776+
2777+/**
2778+ * Class FieldsetOpenElement
2779+ *
2780+ * Opens a Fieldset with an optional legend
2781+ *
2782+ * @package dokuwiki\Form
2783+ */
2784+class FieldsetOpenElement extends TagOpenElement {
2785+
2786+ /**
2787+ * @param string $legend
2788+ * @param array $attributes
2789+ */
2790+ public function __construct($legend='', $attributes = array()) {
2791+ // this is a bit messy and we just do it for the nicer class hierarchy
2792+ // the parent would expect the tag in $value but we're storing the
2793+ // legend there, so we have to set the type manually
2794+ parent::__construct($legend, $attributes);
2795+ $this->type = 'fieldsetopen';
2796+ }
2797+
2798+ /**
2799+ * The HTML representation of this element
2800+ *
2801+ * @return string
2802+ */
2803+ public function toHTML() {
2804+ $html = '<fieldset '.buildAttributes($this->attrs()).'>';
2805+ $legend = $this->val();
2806+ if($legend) $html .= DOKU_LF.'<legend>'.hsc($legend).'</legend>';
2807+ return $html;
2808+ }
2809+}
2810
2811=== added file 'inc/Form/Form.php'
2812--- inc/Form/Form.php 1970-01-01 00:00:00 +0000
2813+++ inc/Form/Form.php 2015-11-12 19:55:23 +0000
2814@@ -0,0 +1,426 @@
2815+<?php
2816+namespace dokuwiki\Form;
2817+
2818+/**
2819+ * Class Form
2820+ *
2821+ * Represents the whole Form. This is what you work on, and add Elements to
2822+ *
2823+ * @package dokuwiki\Form
2824+ */
2825+class Form extends Element {
2826+
2827+ /**
2828+ * @var array name value pairs for hidden values
2829+ */
2830+ protected $hidden = array();
2831+
2832+ /**
2833+ * @var Element[] the elements of the form
2834+ */
2835+ protected $elements = array();
2836+
2837+ /**
2838+ * Creates a new, empty form with some default attributes
2839+ *
2840+ * @param array $attributes
2841+ */
2842+ public function __construct($attributes = array()) {
2843+ global $ID;
2844+
2845+ parent::__construct('form', $attributes);
2846+
2847+ // use the current URL as default action
2848+ if(!$this->attr('action')) {
2849+ $get = $_GET;
2850+ if(isset($get['id'])) unset($get['id']);
2851+ $self = wl($ID, $get, false, '&'); //attributes are escaped later
2852+ $this->attr('action', $self);
2853+ }
2854+
2855+ // post is default
2856+ if(!$this->attr('method')) {
2857+ $this->attr('method', 'post');
2858+ }
2859+
2860+ // we like UTF-8
2861+ if(!$this->attr('accept-charset')) {
2862+ $this->attr('accept-charset', 'utf-8');
2863+ }
2864+
2865+ // add the security token by default
2866+ $this->setHiddenField('sectok', getSecurityToken());
2867+
2868+ // identify this as a new form based form in HTML
2869+ $this->addClass('doku_form');
2870+ }
2871+
2872+ /**
2873+ * Sets a hidden field
2874+ *
2875+ * @param $name
2876+ * @param $value
2877+ * @return $this
2878+ */
2879+ public function setHiddenField($name, $value) {
2880+ $this->hidden[$name] = $value;
2881+ return $this;
2882+ }
2883+
2884+ #region element query function
2885+
2886+ /**
2887+ * Returns the numbers of elements in the form
2888+ *
2889+ * @return int
2890+ */
2891+ public function elementCount() {
2892+ return count($this->elements);
2893+ }
2894+
2895+ /**
2896+ * Returns a reference to the element at a position.
2897+ * A position out-of-bounds will return either the
2898+ * first (underflow) or last (overflow) element.
2899+ *
2900+ * @param $pos
2901+ * @return Element
2902+ */
2903+ public function getElementAt($pos) {
2904+ if($pos < 0) $pos = count($this->elements) + $pos;
2905+ if($pos < 0) $pos = 0;
2906+ if($pos >= count($this->elements)) $pos = count($this->elements) - 1;
2907+ return $this->elements[$pos];
2908+ }
2909+
2910+ /**
2911+ * Gets the position of the first of a type of element
2912+ *
2913+ * @param string $type Element type to look for.
2914+ * @param int $offset search from this position onward
2915+ * @return false|int position of element if found, otherwise false
2916+ */
2917+ public function findPositionByType($type, $offset = 0) {
2918+ $len = $this->elementCount();
2919+ for($pos = $offset; $pos < $len; $pos++) {
2920+ if($this->elements[$pos]->getType() == $type) {
2921+ return $pos;
2922+ }
2923+ }
2924+ return false;
2925+ }
2926+
2927+ /**
2928+ * Gets the position of the first element matching the attribute
2929+ *
2930+ * @param string $name Name of the attribute
2931+ * @param string $value Value the attribute should have
2932+ * @param int $offset search from this position onward
2933+ * @return false|int position of element if found, otherwise false
2934+ */
2935+ public function findPositionByAttribute($name, $value, $offset = 0) {
2936+ $len = $this->elementCount();
2937+ for($pos = $offset; $pos < $len; $pos++) {
2938+ if($this->elements[$pos]->attr($name) == $value) {
2939+ return $pos;
2940+ }
2941+ }
2942+ return false;
2943+ }
2944+
2945+ #endregion
2946+
2947+ #region Element positioning functions
2948+
2949+ /**
2950+ * Adds or inserts an element to the form
2951+ *
2952+ * @param Element $element
2953+ * @param int $pos 0-based position in the form, -1 for at the end
2954+ * @return Element
2955+ */
2956+ public function addElement(Element $element, $pos = -1) {
2957+ if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
2958+ if($pos < 0) {
2959+ $this->elements[] = $element;
2960+ } else {
2961+ array_splice($this->elements, $pos, 0, array($element));
2962+ }
2963+ return $element;
2964+ }
2965+
2966+ /**
2967+ * Replaces an existing element with a new one
2968+ *
2969+ * @param Element $element the new element
2970+ * @param $pos 0-based position of the element to replace
2971+ */
2972+ public function replaceElement(Element $element, $pos) {
2973+ if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
2974+ array_splice($this->elements, $pos, 1, array($element));
2975+ }
2976+
2977+ /**
2978+ * Remove an element from the form completely
2979+ *
2980+ * @param $pos 0-based position of the element to remove
2981+ */
2982+ public function removeElement($pos) {
2983+ array_splice($this->elements, $pos, 1);
2984+ }
2985+
2986+ #endregion
2987+
2988+ #region Element adding functions
2989+
2990+ /**
2991+ * Adds a text input field
2992+ *
2993+ * @param $name
2994+ * @param $label
2995+ * @param int $pos
2996+ * @return InputElement
2997+ */
2998+ public function addTextInput($name, $label = '', $pos = -1) {
2999+ return $this->addElement(new InputElement('text', $name, $label), $pos);
3000+ }
3001+
3002+ /**
3003+ * Adds a password input field
3004+ *
3005+ * @param $name
3006+ * @param $label
3007+ * @param int $pos
3008+ * @return InputElement
3009+ */
3010+ public function addPasswordInput($name, $label = '', $pos = -1) {
3011+ return $this->addElement(new InputElement('password', $name, $label), $pos);
3012+ }
3013+
3014+ /**
3015+ * Adds a radio button field
3016+ *
3017+ * @param $name
3018+ * @param $label
3019+ * @param int $pos
3020+ * @return CheckableElement
3021+ */
3022+ public function addRadioButton($name, $label = '', $pos = -1) {
3023+ return $this->addElement(new CheckableElement('radio', $name, $label), $pos);
3024+ }
3025+
3026+ /**
3027+ * Adds a checkbox field
3028+ *
3029+ * @param $name
3030+ * @param $label
3031+ * @param int $pos
3032+ * @return CheckableElement
3033+ */
3034+ public function addCheckbox($name, $label = '', $pos = -1) {
3035+ return $this->addElement(new CheckableElement('checkbox', $name, $label), $pos);
3036+ }
3037+
3038+ /**
3039+ * Adds a textarea field
3040+ *
3041+ * @param $name
3042+ * @param $label
3043+ * @param int $pos
3044+ * @return TextareaElement
3045+ */
3046+ public function addTextarea($name, $label = '', $pos = -1) {
3047+ return $this->addElement(new TextareaElement($name, $label), $pos);
3048+ }
3049+
3050+ /**
3051+ * Adds a simple button, escapes the content for you
3052+ *
3053+ * @param string $name
3054+ * @param string $content
3055+ * @param int $pos
3056+ * @return Element
3057+ */
3058+ public function addButton($name, $content, $pos = -1) {
3059+ return $this->addElement(new ButtonElement($name, hsc($content)), $pos);
3060+ }
3061+
3062+ /**
3063+ * Adds a simple button, allows HTML for content
3064+ *
3065+ * @param string $name
3066+ * @param string $html
3067+ * @param int $pos
3068+ * @return Element
3069+ */
3070+ public function addButtonHTML($name, $html, $pos = -1) {
3071+ return $this->addElement(new ButtonElement($name, $html), $pos);
3072+ }
3073+
3074+ /**
3075+ * Adds a label referencing another input element, escapes the label for you
3076+ *
3077+ * @param $label
3078+ * @param string $for
3079+ * @param int $pos
3080+ * @return Element
3081+ */
3082+ public function addLabel($label, $for='', $pos = -1) {
3083+ return $this->addLabelHTML(hsc($label), $for, $pos);
3084+ }
3085+
3086+ /**
3087+ * Adds a label referencing another input element, allows HTML for content
3088+ *
3089+ * @param string $content
3090+ * @param string|Element $for
3091+ * @param int $pos
3092+ * @return Element
3093+ */
3094+ public function addLabelHTML($content, $for='', $pos = -1) {
3095+ $element = new LabelElement(hsc($content));
3096+
3097+ if(is_a($for, '\dokuwiki\Form\Element')) {
3098+ /** @var Element $for */
3099+ $for = $for->id();
3100+ }
3101+ $for = (string) $for;
3102+ if($for !== '') {
3103+ $element->attr('for', $for);
3104+ }
3105+
3106+ return $this->addElement($element, $pos);
3107+ }
3108+
3109+ /**
3110+ * Add fixed HTML to the form
3111+ *
3112+ * @param $html
3113+ * @param int $pos
3114+ * @return HTMLElement
3115+ */
3116+ public function addHTML($html, $pos = -1) {
3117+ return $this->addElement(new HTMLElement($html), $pos);
3118+ }
3119+
3120+ /**
3121+ * Add a closed HTML tag to the form
3122+ *
3123+ * @param $tag
3124+ * @param int $pos
3125+ * @return TagElement
3126+ */
3127+ public function addTag($tag, $pos = -1) {
3128+ return $this->addElement(new TagElement($tag), $pos);
3129+ }
3130+
3131+ /**
3132+ * Add an open HTML tag to the form
3133+ *
3134+ * Be sure to close it again!
3135+ *
3136+ * @param $tag
3137+ * @param int $pos
3138+ * @return TagOpenElement
3139+ */
3140+ public function addTagOpen($tag, $pos = -1) {
3141+ return $this->addElement(new TagOpenElement($tag), $pos);
3142+ }
3143+
3144+ /**
3145+ * Add a closing HTML tag to the form
3146+ *
3147+ * Be sure it had been opened before
3148+ *
3149+ * @param $tag
3150+ * @param int $pos
3151+ * @return TagCloseElement
3152+ */
3153+ public function addTagClose($tag, $pos = -1) {
3154+ return $this->addElement(new TagCloseElement($tag), $pos);
3155+ }
3156+
3157+ /**
3158+ * Open a Fieldset
3159+ *
3160+ * @param $legend
3161+ * @param int $pos
3162+ * @return FieldsetOpenElement
3163+ */
3164+ public function addFieldsetOpen($legend = '', $pos = -1) {
3165+ return $this->addElement(new FieldsetOpenElement($legend), $pos);
3166+ }
3167+
3168+ /**
3169+ * Close a fieldset
3170+ *
3171+ * @param int $pos
3172+ * @return TagCloseElement
3173+ */
3174+ public function addFieldsetClose($pos = -1) {
3175+ return $this->addElement(new FieldsetCloseElement(), $pos);
3176+ }
3177+
3178+ #endregion
3179+
3180+ /**
3181+ * Adjust the elements so that fieldset open and closes are matching
3182+ */
3183+ protected function balanceFieldsets() {
3184+ $lastclose = 0;
3185+ $isopen = false;
3186+ $len = count($this->elements);
3187+
3188+ for($pos = 0; $pos < $len; $pos++) {
3189+ $type = $this->elements[$pos]->getType();
3190+ if($type == 'fieldsetopen') {
3191+ if($isopen) {
3192+ //close previous fieldset
3193+ $this->addFieldsetClose($pos);
3194+ $lastclose = $pos + 1;
3195+ $pos++;
3196+ $len++;
3197+ }
3198+ $isopen = true;
3199+ } else if($type == 'fieldsetclose') {
3200+ if(!$isopen) {
3201+ // make sure there was a fieldsetopen
3202+ // either right after the last close or at the begining
3203+ $this->addFieldsetOpen('', $lastclose);
3204+ $len++;
3205+ $pos++;
3206+ }
3207+ $lastclose = $pos;
3208+ $isopen = false;
3209+ }
3210+ }
3211+
3212+ // close open fieldset at the end
3213+ if($isopen) {
3214+ $this->addFieldsetClose();
3215+ }
3216+ }
3217+
3218+ /**
3219+ * The HTML representation of the whole form
3220+ *
3221+ * @return string
3222+ */
3223+ public function toHTML() {
3224+ $this->balanceFieldsets();
3225+
3226+ $html = '<form ' . buildAttributes($this->attrs()) . '>' . DOKU_LF;
3227+
3228+ foreach($this->hidden as $name => $value) {
3229+ $html .= '<input type="hidden" name="' . $name . '" value="' . formText($value) . '" />' . DOKU_LF;
3230+ }
3231+
3232+ foreach($this->elements as $element) {
3233+ $html .= $element->toHTML() . DOKU_LF;
3234+ }
3235+
3236+ $html .= '</form>' . DOKU_LF;
3237+
3238+ return $html;
3239+ }
3240+}
3241
3242=== added file 'inc/Form/HTMLElement.php'
3243--- inc/Form/HTMLElement.php 1970-01-01 00:00:00 +0000
3244+++ inc/Form/HTMLElement.php 2015-11-12 19:55:23 +0000
3245@@ -0,0 +1,29 @@
3246+<?php
3247+namespace dokuwiki\Form;
3248+
3249+/**
3250+ * Class HTMLElement
3251+ *
3252+ * Holds arbitrary HTML that is added as is to the Form
3253+ *
3254+ * @package dokuwiki\Form
3255+ */
3256+class HTMLElement extends ValueElement {
3257+
3258+
3259+ /**
3260+ * @param string $html
3261+ */
3262+ public function __construct($html) {
3263+ parent::__construct('html', $html);
3264+ }
3265+
3266+ /**
3267+ * The HTML representation of this element
3268+ *
3269+ * @return string
3270+ */
3271+ public function toHTML() {
3272+ return $this->val();
3273+ }
3274+}
3275
3276=== added file 'inc/Form/InputElement.php'
3277--- inc/Form/InputElement.php 1970-01-01 00:00:00 +0000
3278+++ inc/Form/InputElement.php 2015-11-12 19:55:23 +0000
3279@@ -0,0 +1,161 @@
3280+<?php
3281+namespace dokuwiki\Form;
3282+
3283+/**
3284+ * Class InputElement
3285+ *
3286+ * Base class for all input elements. Uses a wrapping label when label
3287+ * text is given.
3288+ *
3289+ * @todo figure out how to make wrapping or related label configurable
3290+ * @package dokuwiki\Form
3291+ */
3292+class InputElement extends Element {
3293+ /**
3294+ * @var LabelElement
3295+ */
3296+ protected $label = null;
3297+
3298+ /**
3299+ * @var bool if the element should reflect posted values
3300+ */
3301+ protected $useInput = true;
3302+
3303+ /**
3304+ * @param string $type The type of this element
3305+ * @param string $name The name of this form element
3306+ * @param string $label The label text for this element (will be autoescaped)
3307+ */
3308+ public function __construct($type, $name, $label = '') {
3309+ parent::__construct($type, array('name' => $name));
3310+ $this->attr('name', $name);
3311+ $this->attr('type', $type);
3312+ if($label) $this->label = new LabelElement($label);
3313+ }
3314+
3315+ /**
3316+ * Returns the label element if there's one set
3317+ *
3318+ * @return LabelElement|null
3319+ */
3320+ public function getLabel() {
3321+ return $this->label;
3322+ }
3323+
3324+ /**
3325+ * Should the user sent input be used to initialize the input field
3326+ *
3327+ * The default is true. Any set values will be overwritten by the INPUT
3328+ * provided values.
3329+ *
3330+ * @param bool $useinput
3331+ * @return $this
3332+ */
3333+ public function useInput($useinput) {
3334+ $this->useInput = (bool) $useinput;
3335+ return $this;
3336+ }
3337+
3338+ /**
3339+ * Get or set the element's ID
3340+ *
3341+ * @param null|string $id
3342+ * @return string|$this
3343+ */
3344+ public function id($id = null) {
3345+ if($this->label) $this->label->attr('for', $id);
3346+ return parent::id($id);
3347+ }
3348+
3349+ /**
3350+ * Adds a class to the class attribute
3351+ *
3352+ * This is the preferred method of setting the element's class
3353+ *
3354+ * @param string $class the new class to add
3355+ * @return $this
3356+ */
3357+ public function addClass($class) {
3358+ if($this->label) $this->label->addClass($class);
3359+ return parent::addClass($class);
3360+ }
3361+
3362+ /**
3363+ * Figures out how to access the value for this field from INPUT data
3364+ *
3365+ * The element's name could have been given as a simple string ('foo')
3366+ * or in array notation ('foo[bar]').
3367+ *
3368+ * Note: this function only handles one level of arrays. If your data
3369+ * is nested deeper, you should call useInput(false) and set the
3370+ * correct value yourself
3371+ *
3372+ * @return array name and array key (null if not an array)
3373+ */
3374+ protected function getInputName() {
3375+ $name = $this->attr('name');
3376+ parse_str("$name=1", $parsed);
3377+
3378+ $name = array_keys($parsed);
3379+ $name = array_shift($name);
3380+
3381+ if(is_array($parsed[$name])) {
3382+ $key = array_keys($parsed[$name]);
3383+ $key = array_shift($key);
3384+ } else {
3385+ $key = null;
3386+ }
3387+
3388+ return array($name, $key);
3389+ }
3390+
3391+ /**
3392+ * Handles the useInput flag and set the value attribute accordingly
3393+ */
3394+ protected function prefillInput() {
3395+ global $INPUT;
3396+
3397+ list($name, $key) = $this->getInputName();
3398+ if(!$INPUT->has($name)) return;
3399+
3400+ if($key === null) {
3401+ $value = $INPUT->str($name);
3402+ } else {
3403+ $value = $INPUT->arr($name);
3404+ if(isset($value[$key])) {
3405+ $value = $value[$key];
3406+ } else {
3407+ $value = '';
3408+ }
3409+ }
3410+ if($value !== '') {
3411+ $this->val($value);
3412+ }
3413+ }
3414+
3415+ /**
3416+ * The HTML representation of this element
3417+ *
3418+ * @return string
3419+ */
3420+ protected function mainElementHTML() {
3421+ if($this->useInput) $this->prefillInput();
3422+ return '<input ' . buildAttributes($this->attrs()) . ' />';
3423+ }
3424+
3425+ /**
3426+ * The HTML representation of this element wrapped in a label
3427+ *
3428+ * @return string
3429+ */
3430+ public function toHTML() {
3431+ if($this->label) {
3432+ return '<label ' . buildAttributes($this->label->attrs()) . '>' . DOKU_LF .
3433+ '<span>' . hsc($this->label->val()) . '</span>' . DOKU_LF .
3434+ $this->mainElementHTML() . DOKU_LF .
3435+ '</label>';
3436+ } else {
3437+ return $this->mainElementHTML();
3438+ }
3439+ }
3440+}
3441
3442=== added file 'inc/Form/LabelElement.php'
3443--- inc/Form/LabelElement.php 1970-01-01 00:00:00 +0000
3444+++ inc/Form/LabelElement.php 2015-11-12 19:55:23 +0000
3445@@ -0,0 +1,27 @@
3446+<?php
3447+namespace dokuwiki\Form;
3448+
3449+/**
3450+ * Class Label
3451+ * @package dokuwiki\Form
3452+ */
3453+class LabelElement extends ValueElement {
3454+
3455+ /**
3456+ * Creates a new Label
3457+ *
3458+ * @param string $label This is is raw HTML and will not be escaped
3459+ */
3460+ public function __construct($label) {
3461+ parent::__construct('label', $label);
3462+ }
3463+
3464+ /**
3465+ * The HTML representation of this element
3466+ *
3467+ * @return string
3468+ */
3469+ public function toHTML() {
3470+ return '<label ' . buildAttributes($this->attrs()) . '>' . $this->val() . '</label>';
3471+ }
3472+}
3473
3474=== added file 'inc/Form/LegacyForm.php'
3475--- inc/Form/LegacyForm.php 1970-01-01 00:00:00 +0000
3476+++ inc/Form/LegacyForm.php 2015-11-12 19:55:23 +0000
3477@@ -0,0 +1,181 @@
3478+<?php
3479+namespace dokuwiki\Form;
3480+
3481+/**
3482+ * Class LegacyForm
3483+ *
3484+ * Provides a compatibility layer to the old Doku_Form API
3485+ *
3486+ * This can be used to work with the modern API on forms provided by old events for
3487+ * example. When you start new forms, just use Form\Form
3488+ *
3489+ * @package dokuwiki\Form
3490+ */
3491+class LegacyForm extends Form {
3492+
3493+ /**
3494+ * Creates a new modern form from an old legacy Doku_Form
3495+ *
3496+ * @param \Doku_Form $oldform
3497+ */
3498+ public function __construct(\Doku_Form $oldform) {
3499+ parent::__construct($oldform->params);
3500+
3501+ $this->hidden = $oldform->_hidden;
3502+
3503+ foreach($oldform->_content as $element) {
3504+ list($ctl, $attr) = $this->parseLegacyAttr($element);
3505+
3506+ if(is_array($element)) {
3507+ switch($ctl['elem']) {
3508+ case 'wikitext':
3509+ $this->addTextarea('wikitext')
3510+ ->attrs($attr)
3511+ ->id('wiki__text')
3512+ ->val($ctl['text'])
3513+ ->addClass($ctl['class']);
3514+ break;
3515+ case 'textfield':
3516+ $this->addTextInput($ctl['name'], $ctl['text'])
3517+ ->attrs($attr)
3518+ ->id($ctl['id'])
3519+ ->addClass($ctl['class']);
3520+ break;
3521+ case 'passwordfield':
3522+ $this->addPasswordInput($ctl['name'], $ctl['text'])
3523+ ->attrs($attr)
3524+ ->id($ctl['id'])
3525+ ->addClass($ctl['class']);
3526+ break;
3527+ case 'checkboxfield':
3528+ $this->addCheckbox($ctl['name'], $ctl['text'])
3529+ ->attrs($attr)
3530+ ->id($ctl['id'])
3531+ ->addClass($ctl['class']);
3532+ break;
3533+ case 'radiofield':
3534+ $this->addRadioButton($ctl['name'], $ctl['text'])
3535+ ->attrs($attr)
3536+ ->id($ctl['id'])
3537+ ->addClass($ctl['class']);
3538+ break;
3539+ case 'tag':
3540+ $this->addTag($ctl['tag'])
3541+ ->attrs($attr)
3542+ ->attr('name', $ctl['name'])
3543+ ->id($ctl['id'])
3544+ ->addClass($ctl['class']);
3545+ break;
3546+ case 'opentag':
3547+ $this->addTagOpen($ctl['tag'])
3548+ ->attrs($attr)
3549+ ->attr('name', $ctl['name'])
3550+ ->id($ctl['id'])
3551+ ->addClass($ctl['class']);
3552+ break;
3553+ case 'closetag':
3554+ $this->addTagClose($ctl['tag']);
3555+ break;
3556+ case 'openfieldset':
3557+ $this->addFieldsetOpen($ctl['legend'])
3558+ ->attrs($attr)
3559+ ->attr('name', $ctl['name'])
3560+ ->id($ctl['id'])
3561+ ->addClass($ctl['class']);
3562+ break;
3563+ case 'closefieldset':
3564+ $this->addFieldsetClose();
3565+ break;
3566+ case 'button':
3567+ case 'field':
3568+ case 'fieldright':
3569+ case 'filefield':
3570+ case 'menufield':
3571+ case 'listboxfield':
3572+ throw new \UnexpectedValueException('Unsupported legacy field ' . $ctl['elem']);
3573+ break;
3574+ default:
3575+ throw new \UnexpectedValueException('Unknown legacy field ' . $ctl['elem']);
3576+
3577+ }
3578+ } else {
3579+ $this->addHTML($element);
3580+ }
3581+ }
3582+
3583+ }
3584+
3585+ /**
3586+ * Parses out what is the elements attributes and what is control info
3587+ *
3588+ * @param array $legacy
3589+ * @return array
3590+ */
3591+ protected function parseLegacyAttr($legacy) {
3592+ $attributes = array();
3593+ $control = array();
3594+
3595+ foreach($legacy as $key => $val) {
3596+ if($key{0} == '_') {
3597+ $control[substr($key, 1)] = $val;
3598+ } elseif($key == 'name') {
3599+ $control[$key] = $val;
3600+ } elseif($key == 'id') {
3601+ $control[$key] = $val;
3602+ } else {
3603+ $attributes[$key] = $val;
3604+ }
3605+ }
3606+
3607+ return array($control, $attributes);
3608+ }
3609+
3610+ /**
3611+ * Translates our types to the legacy types
3612+ *
3613+ * @param string $type
3614+ * @return string
3615+ */
3616+ protected function legacyType($type) {
3617+ static $types = array(
3618+ 'text' => 'textfield',
3619+ 'password' => 'passwordfield',
3620+ 'checkbox' => 'checkboxfield',
3621+ 'radio' => 'radiofield',
3622+ 'tagopen' => 'opentag',
3623+ 'tagclose' => 'closetag',
3624+ 'fieldsetopen' => 'openfieldset',
3625+ 'fieldsetclose' => 'closefieldset',
3626+ );
3627+ if(isset($types[$type])) return $types[$type];
3628+ return $type;
3629+ }
3630+
3631+ /**
3632+ * Creates an old legacy form from this modern form's data
3633+ *
3634+ * @return \Doku_Form
3635+ */
3636+ public function toLegacy() {
3637+ $this->balanceFieldsets();
3638+
3639+ $legacy = new \Doku_Form($this->attrs());
3640+ $legacy->_hidden = $this->hidden;
3641+ foreach($this->elements as $element) {
3642+ if(is_a($element, 'dokuwiki\Form\HTMLElement')) {
3643+ $legacy->_content[] = $element->toHTML();
3644+ } elseif(is_a($element, 'dokuwiki\Form\InputElement')) {
3645+ /** @var InputElement $element */
3646+ $data = $element->attrs();
3647+ $data['_elem'] = $this->legacyType($element->getType());
3648+ $label = $element->getLabel();
3649+ if($label) {
3650+ $data['_class'] = $label->attr('class');
3651+ }
3652+ $legacy->_content[] = $data;
3653+ }
3654+ }
3655+
3656+ return $legacy;
3657+ }
3658+}
3659
3660=== added file 'inc/Form/TagCloseElement.php'
3661--- inc/Form/TagCloseElement.php 1970-01-01 00:00:00 +0000
3662+++ inc/Form/TagCloseElement.php 2015-11-12 19:55:23 +0000
3663@@ -0,0 +1,76 @@
3664+<?php
3665+namespace dokuwiki\Form;
3666+
3667+/**
3668+ * Class TagCloseElement
3669+ *
3670+ * Creates an HTML close tag. You have to make sure it has been opened
3671+ * before or this will produce invalid HTML
3672+ *
3673+ * @package dokuwiki\Form
3674+ */
3675+class TagCloseElement extends ValueElement {
3676+
3677+ /**
3678+ * @param string $tag
3679+ * @param array $attributes
3680+ */
3681+ public function __construct($tag, $attributes = array()) {
3682+ parent::__construct('tagclose', $tag, $attributes);
3683+ }
3684+
3685+ /**
3686+ * do not call this
3687+ *
3688+ * @param $class
3689+ * @return void
3690+ * @throws \BadMethodCallException
3691+ */
3692+ public function addClass($class) {
3693+ throw new \BadMethodCallException('You can\t add classes to closing tag');
3694+ }
3695+
3696+ /**
3697+ * do not call this
3698+ *
3699+ * @param $id
3700+ * @return void
3701+ * @throws \BadMethodCallException
3702+ */
3703+ public function id($id = null) {
3704+ throw new \BadMethodCallException('You can\t add ID to closing tag');
3705+ }
3706+
3707+ /**
3708+ * do not call this
3709+ *
3710+ * @param $name
3711+ * @param $value
3712+ * @return void
3713+ * @throws \BadMethodCallException
3714+ */
3715+ public function attr($name, $value = null) {
3716+ throw new \BadMethodCallException('You can\t add attributes to closing tag');
3717+ }
3718+
3719+ /**
3720+ * do not call this
3721+ *
3722+ * @param $attributes
3723+ * @return void
3724+ * @throws \BadMethodCallException
3725+ */
3726+ public function attrs($attributes = null) {
3727+ throw new \BadMethodCallException('You can\t add attributes to closing tag');
3728+ }
3729+
3730+ /**
3731+ * The HTML representation of this element
3732+ *
3733+ * @return string
3734+ */
3735+ public function toHTML() {
3736+ return '</'.$this->val().'>';
3737+ }
3738+
3739+}
3740
3741=== added file 'inc/Form/TagElement.php'
3742--- inc/Form/TagElement.php 1970-01-01 00:00:00 +0000
3743+++ inc/Form/TagElement.php 2015-11-12 19:55:23 +0000
3744@@ -0,0 +1,29 @@
3745+<?php
3746+namespace dokuwiki\Form;
3747+
3748+/**
3749+ * Class TagElement
3750+ *
3751+ * Creates a self closing HTML tag
3752+ *
3753+ * @package dokuwiki\Form
3754+ */
3755+class TagElement extends ValueElement {
3756+
3757+ /**
3758+ * @param string $tag
3759+ * @param array $attributes
3760+ */
3761+ public function __construct($tag, $attributes = array()) {
3762+ parent::__construct('tag', $tag, $attributes);
3763+ }
3764+
3765+ /**
3766+ * The HTML representation of this element
3767+ *
3768+ * @return string
3769+ */
3770+ public function toHTML() {
3771+ return '<'.$this->val().' '.buildAttributes($this->attrs()).' />';
3772+ }
3773+}
3774
3775=== added file 'inc/Form/TagOpenElement.php'
3776--- inc/Form/TagOpenElement.php 1970-01-01 00:00:00 +0000
3777+++ inc/Form/TagOpenElement.php 2015-11-12 19:55:23 +0000
3778@@ -0,0 +1,30 @@
3779+<?php
3780+namespace dokuwiki\Form;
3781+
3782+/**
3783+ * Class TagOpenElement
3784+ *
3785+ * Creates an open HTML tag. You have to make sure you close it
3786+ * again or this will produce invalid HTML
3787+ *
3788+ * @package dokuwiki\Form
3789+ */
3790+class TagOpenElement extends ValueElement {
3791+
3792+ /**
3793+ * @param string $tag
3794+ * @param array $attributes
3795+ */
3796+ public function __construct($tag, $attributes = array()) {
3797+ parent::__construct('tagopen', $tag, $attributes);
3798+ }
3799+
3800+ /**
3801+ * The HTML representation of this element
3802+ *
3803+ * @return string
3804+ */
3805+ public function toHTML() {
3806+ return '<'.$this->val().' '.buildAttributes($this->attrs()).'>';
3807+ }
3808+}
3809
3810=== added file 'inc/Form/TextareaElement.php'
3811--- inc/Form/TextareaElement.php 1970-01-01 00:00:00 +0000
3812+++ inc/Form/TextareaElement.php 2015-11-12 19:55:23 +0000
3813@@ -0,0 +1,51 @@
3814+<?php
3815+namespace dokuwiki\Form;
3816+
3817+/**
3818+ * Class TextareaElement
3819+ * @package dokuwiki\Form
3820+ */
3821+class TextareaElement extends InputElement {
3822+
3823+ /**
3824+ * @var string the actual text within the area
3825+ */
3826+ protected $text;
3827+
3828+ /**
3829+ * @param string $name The name of this form element
3830+ * @param string $label The label text for this element
3831+ */
3832+ public function __construct($name, $label) {
3833+ parent::__construct('textarea', $name, $label);
3834+ $this->attr('dir', 'auto');
3835+ }
3836+
3837+ /**
3838+ * Get or set the element's value
3839+ *
3840+ * This is the preferred way of setting the element's value
3841+ *
3842+ * @param null|string $value
3843+ * @return string|$this
3844+ */
3845+ public function val($value = null) {
3846+ if($value !== null) {
3847+ $this->text = $value;
3848+ return $this;
3849+ }
3850+ return $this->text;
3851+ }
3852+
3853+ /**
3854+ * The HTML representation of this element
3855+ *
3856+ * @return string
3857+ */
3858+ protected function mainElementHTML() {
3859+ if($this->useInput) $this->prefillInput();
3860+ return '<textarea ' . buildAttributes($this->attrs()) . '>' .
3861+ formText($this->val()) . '</textarea>';
3862+ }
3863+
3864+}
3865
3866=== added file 'inc/Form/ValueElement.php'
3867--- inc/Form/ValueElement.php 1970-01-01 00:00:00 +0000
3868+++ inc/Form/ValueElement.php 2015-11-12 19:55:23 +0000
3869@@ -0,0 +1,45 @@
3870+<?php
3871+
3872+namespace dokuwiki\Form;
3873+
3874+/**
3875+ * Class ValueElement
3876+ *
3877+ * Just like an Element but it's value is not part of its attributes
3878+ *
3879+ * What the value is (tag name, content, etc) is defined by the actual implementations
3880+ *
3881+ * @package dokuwiki\Form
3882+ */
3883+abstract class ValueElement extends Element {
3884+
3885+ /**
3886+ * @var string holds the element's value
3887+ */
3888+ protected $value = '';
3889+
3890+ /**
3891+ * @param string $type
3892+ * @param array|string $value
3893+ * @param array $attributes
3894+ */
3895+ public function __construct($type, $value, $attributes = array()) {
3896+ parent::__construct($type, $attributes);
3897+ $this->val($value);
3898+ }
3899+
3900+ /**
3901+ * Get or set the element's value
3902+ *
3903+ * @param null|string $value
3904+ * @return string|$this
3905+ */
3906+ public function val($value = null) {
3907+ if($value !== null) {
3908+ $this->value = $value;
3909+ return $this;
3910+ }
3911+ return $this->value;
3912+ }
3913+
3914+}
3915
3916=== modified file 'inc/HTTPClient.php'
3917--- inc/HTTPClient.php 2014-06-08 13:04:43 +0000
3918+++ inc/HTTPClient.php 2015-11-12 19:55:23 +0000
3919@@ -35,6 +35,19 @@
3920 $this->proxy_pass = conf_decodeString($conf['proxy']['pass']);
3921 $this->proxy_ssl = $conf['proxy']['ssl'];
3922 $this->proxy_except = $conf['proxy']['except'];
3923+
3924+ // allow enabling debugging via URL parameter (if debugging allowed)
3925+ if($conf['allowdebug']) {
3926+ if(
3927+ isset($_REQUEST['httpdebug']) ||
3928+ (
3929+ isset($_SERVER['HTTP_REFERER']) &&
3930+ strpos($_SERVER['HTTP_REFERER'], 'httpdebug') !== false
3931+ )
3932+ ) {
3933+ $this->debug = true;
3934+ }
3935+ }
3936 }
3937
3938
3939@@ -44,6 +57,12 @@
3940 * @triggers HTTPCLIENT_REQUEST_SEND
3941 * @author Andreas Gohr <andi@splitbrain.org>
3942 */
3943+ /**
3944+ * @param string $url
3945+ * @param string|array $data the post data either as array or raw data
3946+ * @param string $method
3947+ * @return bool
3948+ */
3949 function sendRequest($url,$data='',$method='GET'){
3950 $httpdata = array('url' => $url,
3951 'data' => $data,
3952@@ -61,6 +80,9 @@
3953
3954 }
3955
3956+/**
3957+ * Class HTTPClientException
3958+ */
3959 class HTTPClientException extends Exception { }
3960
3961 /**
3962@@ -88,7 +110,7 @@
3963 var $header_regexp; // if set this RE must match against the headers, else abort
3964 var $headers;
3965 var $debug;
3966- var $start = 0; // for timings
3967+ var $start = 0.0; // for timings
3968 var $keep_alive = true; // keep alive rocks
3969
3970 // don't set these, read on error
3971@@ -150,7 +172,8 @@
3972 *
3973 * @param string $url The URL to fetch
3974 * @param bool $sloppy304 Return body on 304 not modified
3975- * @return bool|string response body, false on error
3976+ * @return false|string response body, false on error
3977+ *
3978 * @author Andreas Gohr <andi@splitbrain.org>
3979 */
3980 function get($url,$sloppy304=false){
3981@@ -171,7 +194,8 @@
3982 * @param string $url The URL to fetch
3983 * @param array $data Associative array of parameters
3984 * @param bool $sloppy304 Return body on 304 not modified
3985- * @return bool|string response body, false on error
3986+ * @return false|string response body, false on error
3987+ *
3988 * @author Andreas Gohr <andi@splitbrain.org>
3989 */
3990 function dget($url,$data,$sloppy304=false){
3991@@ -191,7 +215,7 @@
3992 *
3993 * @param string $url The URL to fetch
3994 * @param array $data Associative array of parameters
3995- * @return bool|string response body, false on error
3996+ * @return false|string response body, false on error
3997 * @author Andreas Gohr <andi@splitbrain.org>
3998 */
3999 function post($url,$data){
4000@@ -213,6 +237,7 @@
4001 * @param mixed $data - the post data either as array or raw data
4002 * @param string $method - HTTP Method usually GET or POST.
4003 * @return bool - true on success
4004+ *
4005 * @author Andreas Goetz <cpuidle@gmx.de>
4006 * @author Andreas Gohr <andi@splitbrain.org>
4007 */
4008@@ -249,7 +274,6 @@
4009 if (empty($port)) $port = 8080;
4010 }else{
4011 $request_url = $path;
4012- $server = $server;
4013 if (!isset($port)) $port = ($uri['scheme'] == 'https') ? 443 : 80;
4014 }
4015
4016@@ -280,7 +304,6 @@
4017 }
4018 }
4019 $headers['Content-Length'] = strlen($data);
4020- $rmethod = 'POST';
4021 }elseif($method == 'GET'){
4022 $data = ''; //no data allowed on GET requests
4023 }
4024@@ -343,7 +366,7 @@
4025
4026 try {
4027 //set non-blocking
4028- stream_set_blocking($socket, false);
4029+ stream_set_blocking($socket, 0);
4030
4031 // build request
4032 $request = "$method $request_url HTTP/".$this->http.HTTP_NL;
4033@@ -458,7 +481,7 @@
4034
4035 if ($chunk_size > 0) {
4036 $r_body .= $this->_readData($socket, $chunk_size, 'chunk');
4037- $byte = $this->_readData($socket, 2, 'chunk'); // read trailing \r\n
4038+ $this->_readData($socket, 2, 'chunk'); // read trailing \r\n
4039 }
4040 } while ($chunk_size && !$abort);
4041 }elseif(isset($this->resp_headers['content-length']) && !isset($this->resp_headers['transfer-encoding'])){
4042@@ -480,7 +503,6 @@
4043 $r_body = $this->_readData($socket, $this->max_bodysize, 'response (content-length limited)', true);
4044 }else{
4045 // read entire socket
4046- $r_size = 0;
4047 while (!feof($socket)) {
4048 $r_body .= $this->_readData($socket, 4096, 'response (unlimited)', true);
4049 }
4050@@ -509,7 +531,6 @@
4051 if (!$this->keep_alive ||
4052 (isset($this->resp_headers['connection']) && $this->resp_headers['connection'] == 'Close')) {
4053 // close socket
4054- $status = socket_get_status($socket);
4055 fclose($socket);
4056 unset(self::$connections[$connectionId]);
4057 }
4058@@ -568,10 +589,25 @@
4059
4060 $this->_debug('SSL Tunnel Response',$r_headers);
4061 if(preg_match('/^HTTP\/1\.[01] 200/i',$r_headers)){
4062- if (stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv3_CLIENT)) {
4063- $requesturl = $requestinfo['path'];
4064- return true;
4065- }
4066+ // set correct peer name for verification (enabled since PHP 5.6)
4067+ stream_context_set_option($socket, 'ssl', 'peer_name', $requestinfo['host']);
4068+
4069+ // because SSLv3 is mostly broken, we try TLS connections here first.
4070+ // according to https://github.com/splitbrain/dokuwiki/commit/c05ef534 we had problems with certain
4071+ // setups with this solution before, but we have no usable test for that and TLS should be the more
4072+ // common crypto by now
4073+ if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
4074+ $requesturl = $requestinfo['path'];
4075+ return true;
4076+ }
4077+
4078+ // if the above failed, this will most probably not work either, but we can try
4079+ if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv3_CLIENT)) {
4080+ $requesturl = $requestinfo['path'];
4081+ return true;
4082+ }
4083+
4084+ throw new HTTPClientException('Failed to set up crypto for secure connection to '.$requestinfo['host'], -151);
4085 }
4086
4087 throw new HTTPClientException('Failed to establish secure proxy connection', -150);
4088@@ -584,6 +620,7 @@
4089 * @param string $data The data to write
4090 * @param string $message Description of what is being read
4091 * @throws HTTPClientException
4092+ *
4093 * @author Tom N Harris <tnharris@whoopdedo.org>
4094 */
4095 function _sendData($socket, $data, $message) {
4096@@ -628,6 +665,7 @@
4097 * @param bool $ignore_eof End-of-file is not an error if this is set
4098 * @throws HTTPClientException
4099 * @return string
4100+ *
4101 * @author Tom N Harris <tnharris@whoopdedo.org>
4102 */
4103 function _readData($socket, $nbytes, $message, $ignore_eof = false) {
4104@@ -677,6 +715,7 @@
4105 * @param string $message Description of what is being read
4106 * @throws HTTPClientException
4107 * @return string
4108+ *
4109 * @author Tom N Harris <tnharris@whoopdedo.org>
4110 */
4111 function _readLine($socket, $message) {
4112@@ -711,6 +750,9 @@
4113 * Uses _debug_text or _debug_html depending on the SAPI name
4114 *
4115 * @author Andreas Gohr <andi@splitbrain.org>
4116+ *
4117+ * @param string $info
4118+ * @param mixed $var
4119 */
4120 function _debug($info,$var=null){
4121 if(!$this->debug) return;
4122@@ -724,8 +766,8 @@
4123 /**
4124 * print debug info as HTML
4125 *
4126- * @param $info
4127- * @param null $var
4128+ * @param string $info
4129+ * @param mixed $var
4130 */
4131 function _debug_html($info, $var=null){
4132 print '<b>'.$info.'</b> '.($this->_time() - $this->start).'s<br />';
4133@@ -741,8 +783,8 @@
4134 /**
4135 * prints debug info as plain text
4136 *
4137- * @param $info
4138- * @param null $var
4139+ * @param string $info
4140+ * @param mixed $var
4141 */
4142 function _debug_text($info, $var=null){
4143 print '*'.$info.'* '.($this->_time() - $this->start)."s\n";
4144@@ -752,6 +794,8 @@
4145
4146 /**
4147 * Return current timestamp in microsecond resolution
4148+ *
4149+ * @return float
4150 */
4151 static function _time(){
4152 list($usec, $sec) = explode(" ", microtime());
4153@@ -764,6 +808,9 @@
4154 * All Keys are lowercased.
4155 *
4156 * @author Andreas Gohr <andi@splitbrain.org>
4157+ *
4158+ * @param string $string
4159+ * @return array
4160 */
4161 function _parseHeaders($string){
4162 $headers = array();
4163@@ -792,11 +839,14 @@
4164 * convert given header array to header string
4165 *
4166 * @author Andreas Gohr <andi@splitbrain.org>
4167+ *
4168+ * @param array $headers
4169+ * @return string
4170 */
4171 function _buildHeaders($headers){
4172 $string = '';
4173 foreach($headers as $key => $value){
4174- if(empty($value)) continue;
4175+ if($value === '') continue;
4176 $string .= $key.': '.$value.HTTP_NL;
4177 }
4178 return $string;
4179@@ -806,6 +856,8 @@
4180 * get cookies as http header string
4181 *
4182 * @author Andreas Goetz <cpuidle@gmx.de>
4183+ *
4184+ * @return string
4185 */
4186 function _getCookies(){
4187 $headers = '';
4188@@ -821,6 +873,9 @@
4189 * Encode data for posting
4190 *
4191 * @author Andreas Gohr <andi@splitbrain.org>
4192+ *
4193+ * @param array $data
4194+ * @return string
4195 */
4196 function _postEncode($data){
4197 return http_build_query($data,'','&');
4198@@ -831,6 +886,9 @@
4199 *
4200 * @fixme use of urlencode might be wrong here
4201 * @author Andreas Gohr <andi@splitbrain.org>
4202+ *
4203+ * @param array $data
4204+ * @return string
4205 */
4206 function _postMultipartEncode($data){
4207 $boundary = '--'.$this->boundary;
4208
4209=== modified file 'inc/IXR_Library.php'
4210--- inc/IXR_Library.php 2012-10-21 21:14:10 +0000
4211+++ inc/IXR_Library.php 2015-11-12 19:55:23 +0000
4212@@ -1,101 +1,146 @@
4213 <?php
4214+
4215 /**
4216- * IXR - The Inutio XML-RPC Library - (c) Incutio Ltd 2002
4217- *
4218- * @version 1.61
4219- * @author Simon Willison
4220- * @date 11th July 2003
4221- * @link http://scripts.incutio.com/xmlrpc/
4222- * @link http://scripts.incutio.com/xmlrpc/manual.php
4223- * @license Artistic License http://www.opensource.org/licenses/artistic-license.php
4224+ * IXR - The Incutio XML-RPC Library
4225+ *
4226+ * Copyright (c) 2010, Incutio Ltd.
4227+ * All rights reserved.
4228+ *
4229+ * Redistribution and use in source and binary forms, with or without
4230+ * modification, are permitted provided that the following conditions are met:
4231+ *
4232+ * - Redistributions of source code must retain the above copyright notice,
4233+ * this list of conditions and the following disclaimer.
4234+ * - Redistributions in binary form must reproduce the above copyright
4235+ * notice, this list of conditions and the following disclaimer in the
4236+ * documentation and/or other materials provided with the distribution.
4237+ * - Neither the name of Incutio Ltd. nor the names of its contributors
4238+ * may be used to endorse or promote products derived from this software
4239+ * without specific prior written permission.
4240+ *
4241+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
4242+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
4243+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
4244+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
4245+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
4246+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
4247+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
4248+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
4249+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4250+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
4251+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4252+ *
4253+ * @package IXR
4254+ * @since 1.5
4255+ *
4256+ * @copyright Incutio Ltd 2010 (http://www.incutio.com)
4257+ * @version 1.7.4 7th September 2010
4258+ * @author Simon Willison
4259+ * @link http://scripts.incutio.com/xmlrpc/ Site/manual
4260 *
4261 * Modified for DokuWiki
4262 * @author Andreas Gohr <andi@splitbrain.org>
4263 */
4264-
4265-
4266 class IXR_Value {
4267+
4268+ /** @var IXR_Value[]|IXR_Date|IXR_Base64|int|bool|double|string */
4269 var $data;
4270+ /** @var string */
4271 var $type;
4272- function IXR_Value ($data, $type = false) {
4273+
4274+ /**
4275+ * @param mixed $data
4276+ * @param bool $type
4277+ */
4278+ function __construct($data, $type = false) {
4279 $this->data = $data;
4280- if (!$type) {
4281+ if(!$type) {
4282 $type = $this->calculateType();
4283 }
4284 $this->type = $type;
4285- if ($type == 'struct') {
4286- /* Turn all the values in the array in to new IXR_Value objects */
4287- foreach ($this->data as $key => $value) {
4288+ if($type == 'struct') {
4289+ // Turn all the values in the array in to new IXR_Value objects
4290+ foreach($this->data as $key => $value) {
4291 $this->data[$key] = new IXR_Value($value);
4292 }
4293 }
4294- if ($type == 'array') {
4295- for ($i = 0, $j = count($this->data); $i < $j; $i++) {
4296+ if($type == 'array') {
4297+ for($i = 0, $j = count($this->data); $i < $j; $i++) {
4298 $this->data[$i] = new IXR_Value($this->data[$i]);
4299 }
4300 }
4301 }
4302+
4303+ /**
4304+ * @return string
4305+ */
4306 function calculateType() {
4307- if ($this->data === true || $this->data === false) {
4308+ if($this->data === true || $this->data === false) {
4309 return 'boolean';
4310 }
4311- if (is_integer($this->data)) {
4312+ if(is_integer($this->data)) {
4313 return 'int';
4314 }
4315- if (is_double($this->data)) {
4316+ if(is_double($this->data)) {
4317 return 'double';
4318 }
4319+
4320 // Deal with IXR object types base64 and date
4321- if (is_object($this->data) && is_a($this->data, 'IXR_Date')) {
4322+ if(is_object($this->data) && is_a($this->data, 'IXR_Date')) {
4323 return 'date';
4324 }
4325- if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) {
4326+ if(is_object($this->data) && is_a($this->data, 'IXR_Base64')) {
4327 return 'base64';
4328 }
4329+
4330 // If it is a normal PHP object convert it in to a struct
4331- if (is_object($this->data)) {
4332-
4333+ if(is_object($this->data)) {
4334 $this->data = get_object_vars($this->data);
4335 return 'struct';
4336 }
4337- if (!is_array($this->data)) {
4338+ if(!is_array($this->data)) {
4339 return 'string';
4340 }
4341- /* We have an array - is it an array or a struct ? */
4342- if ($this->isStruct($this->data)) {
4343+
4344+ // We have an array - is it an array or a struct?
4345+ if($this->isStruct($this->data)) {
4346 return 'struct';
4347 } else {
4348 return 'array';
4349 }
4350 }
4351+
4352+ /**
4353+ * @return bool|string
4354+ */
4355 function getXml() {
4356- /* Return XML for this value */
4357- switch ($this->type) {
4358+ // Return XML for this value
4359+ switch($this->type) {
4360 case 'boolean':
4361- return '<boolean>'.(($this->data) ? '1' : '0').'</boolean>';
4362+ return '<boolean>' . (($this->data) ? '1' : '0') . '</boolean>';
4363 break;
4364 case 'int':
4365- return '<int>'.$this->data.'</int>';
4366+ return '<int>' . $this->data . '</int>';
4367 break;
4368 case 'double':
4369- return '<double>'.$this->data.'</double>';
4370+ return '<double>' . $this->data . '</double>';
4371 break;
4372 case 'string':
4373- return '<string>'.htmlspecialchars($this->data).'</string>';
4374+ return '<string>' . htmlspecialchars($this->data) . '</string>';
4375 break;
4376 case 'array':
4377- $return = '<array><data>'."\n";
4378- foreach ($this->data as $item) {
4379- $return .= ' <value>'.$item->getXml()."</value>\n";
4380+ $return = '<array><data>' . "\n";
4381+ foreach($this->data as $item) {
4382+ $return .= ' <value>' . $item->getXml() . "</value>\n";
4383 }
4384 $return .= '</data></array>';
4385 return $return;
4386 break;
4387 case 'struct':
4388- $return = '<struct>'."\n";
4389- foreach ($this->data as $name => $value) {
4390+ $return = '<struct>' . "\n";
4391+ foreach($this->data as $name => $value) {
4392 $return .= " <member><name>$name</name><value>";
4393- $return .= $value->getXml()."</value></member>\n";
4394+ $return .= $value->getXml() . "</value></member>\n";
4395 }
4396 $return .= '</struct>';
4397 return $return;
4398@@ -107,11 +152,17 @@
4399 }
4400 return false;
4401 }
4402+
4403+ /**
4404+ * Checks whether or not the supplied array is a struct or not
4405+ *
4406+ * @param array $array
4407+ * @return boolean
4408+ */
4409 function isStruct($array) {
4410- /* Nasty function to check if an array is a struct or not */
4411 $expected = 0;
4412- foreach ($array as $key => $value) {
4413- if ((string)$key != (string)$expected) {
4414+ foreach($array as $key => $value) {
4415+ if((string) $key != (string) $expected) {
4416 return true;
4417 }
4418 $expected++;
4419@@ -120,18 +171,25 @@
4420 }
4421 }
4422
4423-
4424+/**
4425+ * IXR_MESSAGE
4426+ *
4427+ * @package IXR
4428+ * @since 1.5
4429+ *
4430+ */
4431 class IXR_Message {
4432 var $message;
4433- var $messageType; // methodCall / methodResponse / fault
4434+ var $messageType; // methodCall / methodResponse / fault
4435 var $faultCode;
4436 var $faultString;
4437 var $methodName;
4438 var $params;
4439+
4440 // Current variable stacks
4441- var $_arraystructs = array(); // The stack used to keep track of the current array/struct
4442+ var $_arraystructs = array(); // The stack used to keep track of the current array/struct
4443 var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array
4444- var $_currentStructName = array(); // A stack as well
4445+ var $_currentStructName = array(); // A stack as well
4446 var $_param;
4447 var $_value;
4448 var $_currentTag;
4449@@ -139,12 +197,23 @@
4450 var $_lastseen;
4451 // The XML parser
4452 var $_parser;
4453- function IXR_Message ($message) {
4454- $this->message = $message;
4455+
4456+ /**
4457+ * @param string $message
4458+ */
4459+ function __construct($message) {
4460+ $this->message =& $message;
4461 }
4462+
4463+ /**
4464+ * @return bool
4465+ */
4466 function parse() {
4467 // first remove the XML declaration
4468- $this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message);
4469+ // merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages
4470+ $header = preg_replace('/<\?xml.*?\?' . '>/', '', substr($this->message, 0, 100), 1);
4471+ $this->message = substr_replace($this->message, $header, 0, 100);
4472+
4473 // workaround for a bug in PHP/libxml2, see http://bugs.php.net/bug.php?id=45996
4474 $this->message = str_replace('&lt;', '&#60;', $this->message);
4475 $this->message = str_replace('&gt;', '&#62;', $this->message);
4476@@ -152,7 +221,7 @@
4477 $this->message = str_replace('&apos;', '&#39;', $this->message);
4478 $this->message = str_replace('&quot;', '&#34;', $this->message);
4479 $this->message = str_replace("\x0b", ' ', $this->message); //vertical tab
4480- if (trim($this->message) == '') {
4481+ if(trim($this->message) == '') {
4482 return false;
4483 }
4484 $this->_parser = xml_parser_create();
4485@@ -162,23 +231,40 @@
4486 xml_set_object($this->_parser, $this);
4487 xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');
4488 xml_set_character_data_handler($this->_parser, 'cdata');
4489- if (!xml_parse($this->_parser, $this->message)) {
4490- /* die(sprintf('XML error: %s at line %d',
4491- xml_error_string(xml_get_error_code($this->_parser)),
4492- xml_get_current_line_number($this->_parser))); */
4493- return false;
4494- }
4495+ $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages
4496+ $final = false;
4497+ do {
4498+ if(strlen($this->message) <= $chunk_size) {
4499+ $final = true;
4500+ }
4501+ $part = substr($this->message, 0, $chunk_size);
4502+ $this->message = substr($this->message, $chunk_size);
4503+ if(!xml_parse($this->_parser, $part, $final)) {
4504+ return false;
4505+ }
4506+ if($final) {
4507+ break;
4508+ }
4509+ } while(true);
4510 xml_parser_free($this->_parser);
4511+
4512 // Grab the error messages, if any
4513- if ($this->messageType == 'fault') {
4514+ if($this->messageType == 'fault') {
4515 $this->faultCode = $this->params[0]['faultCode'];
4516 $this->faultString = $this->params[0]['faultString'];
4517 }
4518 return true;
4519 }
4520+
4521+ /**
4522+ * @param $parser
4523+ * @param string $tag
4524+ * @param $attr
4525+ */
4526 function tag_open($parser, $tag, $attr) {
4527- $this->currentTag = $tag;
4528 $this->_currentTagContents = '';
4529+ $this->_currentTag = $tag;
4530+
4531 switch($tag) {
4532 case 'methodCall':
4533 case 'methodResponse':
4534@@ -186,7 +272,7 @@
4535 $this->messageType = $tag;
4536 break;
4537 /* Deal with stacks of arrays and structs */
4538- case 'data': // data is to all intents and puposes more interesting than array
4539+ case 'data': // data is to all intents and purposes more interesting than array
4540 $this->_arraystructstypes[] = 'array';
4541 $this->_arraystructs[] = array();
4542 break;
4543@@ -197,50 +283,53 @@
4544 }
4545 $this->_lastseen = $tag;
4546 }
4547+
4548+ /**
4549+ * @param $parser
4550+ * @param string $cdata
4551+ */
4552 function cdata($parser, $cdata) {
4553 $this->_currentTagContents .= $cdata;
4554 }
4555+
4556+ /**
4557+ * @param $parser
4558+ * @param $tag
4559+ */
4560 function tag_close($parser, $tag) {
4561+ $value = null;
4562 $valueFlag = false;
4563 switch($tag) {
4564 case 'int':
4565 case 'i4':
4566- $value = (int)trim($this->_currentTagContents);
4567- $this->_currentTagContents = '';
4568+ $value = (int) trim($this->_currentTagContents);
4569 $valueFlag = true;
4570 break;
4571 case 'double':
4572- $value = (double)trim($this->_currentTagContents);
4573- $this->_currentTagContents = '';
4574+ $value = (double) trim($this->_currentTagContents);
4575 $valueFlag = true;
4576 break;
4577 case 'string':
4578- $value = (string)$this->_currentTagContents;
4579- $this->_currentTagContents = '';
4580+ $value = (string) $this->_currentTagContents;
4581 $valueFlag = true;
4582 break;
4583 case 'dateTime.iso8601':
4584 $value = new IXR_Date(trim($this->_currentTagContents));
4585- // $value = $iso->getTimestamp();
4586- $this->_currentTagContents = '';
4587 $valueFlag = true;
4588 break;
4589 case 'value':
4590 // "If no type is indicated, the type is string."
4591- if($this->_lastseen == 'value'){
4592- $value = (string)$this->_currentTagContents;
4593- $this->_currentTagContents = '';
4594+ if($this->_lastseen == 'value') {
4595+ $value = (string) $this->_currentTagContents;
4596 $valueFlag = true;
4597 }
4598 break;
4599 case 'boolean':
4600- $value = (boolean)trim($this->_currentTagContents);
4601- $this->_currentTagContents = '';
4602+ $value = (boolean) trim($this->_currentTagContents);
4603 $valueFlag = true;
4604 break;
4605 case 'base64':
4606 $value = base64_decode($this->_currentTagContents);
4607- $this->_currentTagContents = '';
4608 $valueFlag = true;
4609 break;
4610 /* Deal with stacks of arrays and structs */
4611@@ -255,75 +344,94 @@
4612 break;
4613 case 'name':
4614 $this->_currentStructName[] = trim($this->_currentTagContents);
4615- $this->_currentTagContents = '';
4616 break;
4617 case 'methodName':
4618 $this->methodName = trim($this->_currentTagContents);
4619- $this->_currentTagContents = '';
4620 break;
4621 }
4622- if ($valueFlag) {
4623- /*
4624- if (!is_array($value) && !is_object($value)) {
4625- $value = trim($value);
4626- }
4627- */
4628- if (count($this->_arraystructs) > 0) {
4629+
4630+ if($valueFlag) {
4631+ if(count($this->_arraystructs) > 0) {
4632 // Add value to struct or array
4633- if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') {
4634+ if($this->_arraystructstypes[count($this->_arraystructstypes) - 1] == 'struct') {
4635 // Add to struct
4636- $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value;
4637+ $this->_arraystructs[count($this->_arraystructs) - 1][$this->_currentStructName[count($this->_currentStructName) - 1]] = $value;
4638 } else {
4639 // Add to array
4640- $this->_arraystructs[count($this->_arraystructs)-1][] = $value;
4641+ $this->_arraystructs[count($this->_arraystructs) - 1][] = $value;
4642 }
4643 } else {
4644- // Just add as a paramater
4645+ // Just add as a parameter
4646 $this->params[] = $value;
4647 }
4648 }
4649+ $this->_currentTagContents = '';
4650 $this->_lastseen = $tag;
4651 }
4652 }
4653
4654-
4655+/**
4656+ * IXR_Server
4657+ *
4658+ * @package IXR
4659+ * @since 1.5
4660+ */
4661 class IXR_Server {
4662 var $data;
4663+ /** @var array */
4664 var $callbacks = array();
4665 var $message;
4666+ /** @var array */
4667 var $capabilities;
4668- function IXR_Server($callbacks = false, $data = false) {
4669+
4670+ /**
4671+ * @param array|bool $callbacks
4672+ * @param bool $data
4673+ * @param bool $wait
4674+ */
4675+ function __construct($callbacks = false, $data = false, $wait = false) {
4676 $this->setCapabilities();
4677- if ($callbacks) {
4678+ if($callbacks) {
4679 $this->callbacks = $callbacks;
4680 }
4681 $this->setCallbacks();
4682- $this->serve($data);
4683+
4684+ if(!$wait) {
4685+ $this->serve($data);
4686+ }
4687 }
4688+
4689+ /**
4690+ * @param bool|string $data
4691+ */
4692 function serve($data = false) {
4693- if (!$data) {
4694+ if(!$data) {
4695
4696 $postData = trim(http_get_raw_post_data());
4697- if (!$postData) {
4698+ if(!$postData) {
4699+ header('Content-Type: text/plain'); // merged from WP #9093
4700 die('XML-RPC server accepts POST requests only.');
4701 }
4702 $data = $postData;
4703 }
4704 $this->message = new IXR_Message($data);
4705- if (!$this->message->parse()) {
4706+ if(!$this->message->parse()) {
4707 $this->error(-32700, 'parse error. not well formed');
4708 }
4709- if ($this->message->messageType != 'methodCall') {
4710+ if($this->message->messageType != 'methodCall') {
4711 $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');
4712 }
4713 $result = $this->call($this->message->methodName, $this->message->params);
4714+
4715 // Is the result an error?
4716- if (is_a($result, 'IXR_Error')) {
4717+ if(is_a($result, 'IXR_Error')) {
4718 $this->error($result);
4719 }
4720+
4721 // Encode the result
4722 $r = new IXR_Value($result);
4723 $resultxml = $r->getXml();
4724+
4725 // Create the XML
4726 $xml = <<<EOD
4727 <methodResponse>
4728@@ -340,16 +448,23 @@
4729 // Send it
4730 $this->output($xml);
4731 }
4732+
4733+ /**
4734+ * @param string $methodname
4735+ * @param array $args
4736+ * @return IXR_Error|mixed
4737+ */
4738 function call($methodname, $args) {
4739- if (!$this->hasMethod($methodname)) {
4740- return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.');
4741+ if(!$this->hasMethod($methodname)) {
4742+ return new IXR_Error(-32601, 'server error. requested method ' . $methodname . ' does not exist.');
4743 }
4744 $method = $this->callbacks[$methodname];
4745+
4746 // Perform the callback and send the response
4747
4748 # Removed for DokuWiki to have a more consistent interface
4749 # if (count($args) == 1) {
4750- # // If only one paramater just send that instead of the whole array
4751+ # // If only one parameter just send that instead of the whole array
4752 # $args = $args[0];
4753 # }
4754
4755@@ -359,16 +474,16 @@
4756 $args = (array) $args;
4757
4758 // Are we dealing with a function or a method?
4759- if (substr($method, 0, 5) == 'this:') {
4760+ if(is_string($method) && substr($method, 0, 5) == 'this:') {
4761 // It's a class method - check it exists
4762 $method = substr($method, 5);
4763- if (!method_exists($this, $method)) {
4764- return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.');
4765+ if(!method_exists($this, $method)) {
4766+ return new IXR_Error(-32601, 'server error. requested class method "' . $method . '" does not exist.');
4767 }
4768 // Call the method
4769 #$result = $this->$method($args);
4770- $result = call_user_func_array(array(&$this,$method),$args);
4771- } elseif (substr($method, 0, 7) == 'plugin:') {
4772+ $result = call_user_func_array(array(&$this, $method), $args);
4773+ } elseif(substr($method, 0, 7) == 'plugin:') {
4774 list($pluginname, $callback) = explode(':', substr($method, 7), 2);
4775 if(!plugin_isdisabled($pluginname)) {
4776 $plugin = plugin_load('action', $pluginname);
4777@@ -378,31 +493,49 @@
4778 }
4779 } else {
4780 // It's a function - does it exist?
4781- if (!function_exists($method)) {
4782- return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.');
4783+ if(is_array($method)) {
4784+ if(!is_callable(array($method[0], $method[1]))) {
4785+ return new IXR_Error(-32601, 'server error. requested object method "' . $method[1] . '" does not exist.');
4786+ }
4787+ } else if(!function_exists($method)) {
4788+ return new IXR_Error(-32601, 'server error. requested function "' . $method . '" does not exist.');
4789 }
4790+
4791 // Call the function
4792- #$result = $method($args);
4793- $result = call_user_func_array($method,$args);
4794+ $result = call_user_func($method, $args);
4795 }
4796 return $result;
4797 }
4798
4799+ /**
4800+ * @param int $error
4801+ * @param string|bool $message
4802+ */
4803 function error($error, $message = false) {
4804 // Accepts either an error object or an error code and message
4805- if ($message && !is_object($error)) {
4806+ if($message && !is_object($error)) {
4807 $error = new IXR_Error($error, $message);
4808 }
4809 $this->output($error->getXml());
4810 }
4811+
4812+ /**
4813+ * @param string $xml
4814+ */
4815 function output($xml) {
4816 header('Content-Type: text/xml; charset=utf-8');
4817 echo '<?xml version="1.0"?>', "\n", $xml;
4818 exit;
4819 }
4820+
4821+ /**
4822+ * @param string $method
4823+ * @return bool
4824+ */
4825 function hasMethod($method) {
4826 return in_array($method, array_keys($this->callbacks));
4827 }
4828+
4829 function setCapabilities() {
4830 // Initialises capabilities array
4831 $this->capabilities = array(
4832@@ -420,31 +553,45 @@
4833 ),
4834 );
4835 }
4836+
4837+ /**
4838+ * @return mixed
4839+ */
4840 function getCapabilities() {
4841 return $this->capabilities;
4842 }
4843+
4844 function setCallbacks() {
4845 $this->callbacks['system.getCapabilities'] = 'this:getCapabilities';
4846 $this->callbacks['system.listMethods'] = 'this:listMethods';
4847 $this->callbacks['system.multicall'] = 'this:multiCall';
4848 }
4849+
4850+ /**
4851+ * @return array
4852+ */
4853 function listMethods() {
4854 // Returns a list of methods - uses array_reverse to ensure user defined
4855 // methods are listed before server defined methods
4856 return array_reverse(array_keys($this->callbacks));
4857 }
4858+
4859+ /**
4860+ * @param array $methodcalls
4861+ * @return array
4862+ */
4863 function multiCall($methodcalls) {
4864 // See http://www.xmlrpc.com/discuss/msgReader$1208
4865 $return = array();
4866- foreach ($methodcalls as $call) {
4867+ foreach($methodcalls as $call) {
4868 $method = $call['methodName'];
4869 $params = $call['params'];
4870- if ($method == 'system.multicall') {
4871+ if($method == 'system.multicall') {
4872 $result = new IXR_Error(-32800, 'Recursive calls to system.multicall are forbidden');
4873 } else {
4874 $result = $this->call($method, $params);
4875 }
4876- if (is_a($result, 'IXR_Error')) {
4877+ if(is_a($result, 'IXR_Error')) {
4878 $return[] = array(
4879 'faultCode' => $result->code,
4880 'faultString' => $result->message
4881@@ -457,11 +604,25 @@
4882 }
4883 }
4884
4885+/**
4886+ * IXR_Request
4887+ *
4888+ * @package IXR
4889+ * @since 1.5
4890+ */
4891 class IXR_Request {
4892+ /** @var string */
4893 var $method;
4894+ /** @var array */
4895 var $args;
4896+ /** @var string */
4897 var $xml;
4898- function IXR_Request($method, $args) {
4899+
4900+ /**
4901+ * @param string $method
4902+ * @param array $args
4903+ */
4904+ function __construct($method, $args) {
4905 $this->method = $method;
4906 $this->args = $args;
4907 $this->xml = <<<EOD
4908@@ -471,7 +632,7 @@
4909 <params>
4910
4911 EOD;
4912- foreach ($this->args as $arg) {
4913+ foreach($this->args as $arg) {
4914 $this->xml .= '<param><value>';
4915 $v = new IXR_Value($arg);
4916 $this->xml .= $v->getXml();
4917@@ -479,15 +640,28 @@
4918 }
4919 $this->xml .= '</params></methodCall>';
4920 }
4921+
4922+ /**
4923+ * @return int
4924+ */
4925 function getLength() {
4926 return strlen($this->xml);
4927 }
4928+
4929+ /**
4930+ * @return string
4931+ */
4932 function getXml() {
4933 return $this->xml;
4934 }
4935 }
4936
4937 /**
4938+ * IXR_Client
4939+ *
4940+ * @package IXR
4941+ * @since 1.5
4942+ *
4943 * Changed for DokuWiki to use DokuHTTPClient
4944 *
4945 * This should be compatible to the original class, but uses DokuWiki's
4946@@ -498,19 +672,34 @@
4947 */
4948 class IXR_Client extends DokuHTTPClient {
4949 var $posturl = '';
4950+ /** @var IXR_Message|bool */
4951 var $message = false;
4952+
4953+ // Storage place for an error message
4954+ /** @var IXR_Error|bool */
4955 var $xmlerror = false;
4956
4957- function IXR_Client($server, $path = false, $port = 80) {
4958+ /**
4959+ * @param string $server
4960+ * @param string|bool $path
4961+ * @param int $port
4962+ * @param int $timeout
4963+ */
4964+ function __construct($server, $path = false, $port = 80, $timeout = 15) {
4965 parent::__construct();
4966- if (!$path) {
4967+ if(!$path) {
4968 // Assume we have been given a URL instead
4969 $this->posturl = $server;
4970- }else{
4971- $this->posturl = 'http://'.$server.':'.$port.$path;
4972+ } else {
4973+ $this->posturl = 'http://' . $server . ':' . $port . $path;
4974 }
4975+ $this->timeout = $timeout;
4976 }
4977
4978+ /**
4979+ * parameters: method and arguments
4980+ * @return bool success or error
4981+ */
4982 function query() {
4983 $args = func_get_args();
4984 $method = array_shift($args);
4985@@ -518,55 +707,87 @@
4986 $xml = $request->getXml();
4987
4988 $this->headers['Content-Type'] = 'text/xml';
4989- if(!$this->sendRequest($this->posturl,$xml,'POST')){
4990- $this->xmlerror = new IXR_Error(-32300, 'transport error - '.$this->error);
4991+ if(!$this->sendRequest($this->posturl, $xml, 'POST')) {
4992+ $this->xmlerror = new IXR_Error(-32300, 'transport error - ' . $this->error);
4993 return false;
4994 }
4995
4996 // Check HTTP Response code
4997- if($this->status < 200 || $this->status > 206){
4998- $this->xmlerror = new IXR_Error(-32300, 'transport error - HTTP status '.$this->status);
4999+ if($this->status < 200 || $this->status > 206) {
5000+ $this->xmlerror = new IXR_Error(-32300, 'transport error - HTTP status ' . $this->status);
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: