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
=== modified file 'README'
--- README 2014-06-08 13:04:43 +0000
+++ README 2015-11-12 19:55:23 +0000
@@ -4,7 +4,7 @@
4For Installation Instructions see4For Installation Instructions see
5http://www.dokuwiki.org/install5http://www.dokuwiki.org/install
66
7DokuWiki - 2004-2014 (c) Andreas Gohr <andi@splitbrain.org>7DokuWiki - 2004-2015 (c) Andreas Gohr <andi@splitbrain.org>
8 and the DokuWiki Community8 and the DokuWiki Community
9See COPYING and file headers for license info9See COPYING and file headers for license info
1010
1111
=== modified file 'VERSION'
--- VERSION 2014-06-08 13:04:43 +0000
+++ VERSION 2015-11-12 19:55:23 +0000
@@ -1,1 +1,1 @@
12014-05-05 "Ponder Stibbons"12015-08-10a "Detritus"
22
=== modified file 'bin/dwpage.php'
--- bin/dwpage.php 2014-06-08 13:04:43 +0000
+++ bin/dwpage.php 2015-11-12 19:55:23 +0000
@@ -1,378 +1,318 @@
1#!/usr/bin/php1#!/usr/bin/php
2<?php2<?php
3#------------------------------------------------------------------------------3if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
4if ('cli' != php_sapi_name()) die();4define('NOSESSION', 1);
55require_once(DOKU_INC.'inc/init.php');
6ini_set('memory_limit','128M');6
7if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');7/**
8require_once DOKU_INC.'inc/init.php';8 * Checkout and commit pages from the command line while maintaining the history
9require_once DOKU_INC.'inc/common.php';9 */
10require_once DOKU_INC.'inc/cliopts.php';10class PageCLI extends DokuCLI {
1111
12#------------------------------------------------------------------------------12 protected $force = false;
13function usage($action) {13 protected $username = '';
14 switch ( $action ) {14
15 case 'checkout':15 /**
16 print "Usage: dwpage.php [opts] checkout <wiki:page> [working_file]16 * Register options and arguments on the given $options object
1717 *
18 Checks out a file from the repository, using the wiki id and obtaining18 * @param DokuCLI_Options $options
19 a lock for the page.19 * @return void
20 If a working_file is specified, this is where the page is copied to.20 */
21 Otherwise defaults to the same as the wiki page in the current21 protected function setup(DokuCLI_Options $options) {
22 working directory.22 /* global */
2323 $options->registerOption(
24 EXAMPLE24 'force',
25 $ ./dwpage.php checkout wiki:syntax ./new_syntax.txt25 'force obtaining a lock for the page (generally bad idea)',
2626 'f'
27 OPTIONS27 );
28 -h, --help=<action>: get help28 $options->registerOption(
29 -f: force obtaining a lock for the page (generally bad idea)29 'user',
30";30 'work as this user. defaults to current CLI user',
31 break;31 'u',
32 case 'commit':32 'username'
33 print "Usage: dwpage.php [opts] -m \"Msg\" commit <working_file> <wiki:page>33 );
3434 $options->setHelp(
35 Checks in the working_file into the repository using the specified35 'Utility to help command line Dokuwiki page editing, allow '.
36 wiki id, archiving the previous version.36 'pages to be checked out for editing then committed after changes'
3737 );
38 EXAMPLE38
39 $ ./dwpage.php -m \"Some message\" commit ./new_syntax.txt wiki:syntax39 /* checkout command */
4040 $options->registerCommand(
41 OPTIONS41 'checkout',
42 -h, --help=<action>: get help42 'Checks out a file from the repository, using the wiki id and obtaining '.
43 -f: force obtaining a lock for the page (generally bad idea)43 'a lock for the page. '."\n".
44 -t, trivial: minor change44 'If a working_file is specified, this is where the page is copied to. '.
45 -m (required): Summary message describing the change45 'Otherwise defaults to the same as the wiki page in the current '.
46";46 'working directory.'
47 break;47 );
48 case 'lock':48 $options->registerArgument(
49 print "Usage: dwpage.php [opts] lock <wiki:page>49 'wikipage',
5050 'The wiki page to checkout',
51 Obtains or updates a lock for a wiki page51 true,
5252 'checkout'
53 EXAMPLE53 );
54 $ ./dwpage.php lock wiki:syntax54 $options->registerArgument(
5555 'workingfile',
56 OPTIONS56 'How to name the local checkout',
57 -h, --help=<action>: get help57 false,
58 -f: force obtaining a lock for the page (generally bad idea)58 'checkout'
59";59 );
60 break;60
61 case 'unlock':61 /* commit command */
62 print "Usage: dwpage.php [opts] unlock <wiki:page>62 $options->registerCommand(
6363 'commit',
64 Removes a lock for a wiki page.64 'Checks in the working_file into the repository using the specified '.
6565 'wiki id, archiving the previous version.'
66 EXAMPLE66 );
67 $ ./dwpage.php unlock wiki:syntax67 $options->registerArgument(
6868 'workingfile',
69 OPTIONS69 'The local file to commit',
70 -h, --help=<action>: get help70 true,
71 -f: force obtaining a lock for the page (generally bad idea)71 'commit'
72";72 );
73 break;73 $options->registerArgument(
74 default:74 'wikipage',
75 print "Usage: dwpage.php [opts] <action>75 'The wiki page to create or update',
7676 true,
77 Utility to help command line Dokuwiki page editing, allow77 'commit'
78 pages to be checked out for editing then committed after changes78 );
7979 $options->registerOption(
80 Normal operation would be;80 'message',
8181 'Summary describing the change (required)',
8282 'm',
8383 'summary',
84 ACTIONS84 'commit'
85 checkout: see $ dwpage.php --help=checkout85 );
86 commit: see $ dwpage.php --help=commit86 $options->registerOption(
87 lock: see $ dwpage.php --help=lock87 'trivial',
8888 'minor change',
89 OPTIONS89 't',
90 -h, --help=<action>: get help90 false,
91 e.g. $ ./dwpage.php -hcommit91 'commit'
92 e.g. $ ./dwpage.php --help=commit92 );
93";93
94 break;94 /* lock command */
95 }95 $options->registerCommand(
96}96 'lock',
9797 'Obtains or updates a lock for a wiki page'
98#------------------------------------------------------------------------------98 );
99function getUser() {99 $options->registerArgument(
100 $user = getenv('USER');100 'wikipage',
101 if (empty ($user)) {101 'The wiki page to lock',
102 $user = getenv('USERNAME');102 true,
103 } else {103 'lock'
104 );
105
106 /* unlock command */
107 $options->registerCommand(
108 'unlock',
109 'Removes a lock for a wiki page.'
110 );
111 $options->registerArgument(
112 'wikipage',
113 'The wiki page to unlock',
114 true,
115 'unlock'
116 );
117 }
118
119 /**
120 * Your main program
121 *
122 * Arguments and options have been parsed when this is run
123 *
124 * @param DokuCLI_Options $options
125 * @return void
126 */
127 protected function main(DokuCLI_Options $options) {
128 $this->force = $options->getOpt('force', false);
129 $this->username = $options->getOpt('user', $this->getUser());
130
131 $command = $options->getCmd();
132 switch($command) {
133 case 'checkout':
134 $wiki_id = array_shift($options->args);
135 $localfile = array_shift($options->args);
136 $this->commandCheckout($wiki_id, $localfile);
137 break;
138 case 'commit':
139 $localfile = array_shift($options->args);
140 $wiki_id = array_shift($options->args);
141 $this->commandCommit(
142 $localfile,
143 $wiki_id,
144 $options->getOpt('message', ''),
145 $options->getOpt('trivial', false)
146 );
147 break;
148 case 'lock':
149 $wiki_id = array_shift($options->args);
150 $this->obtainLock($wiki_id);
151 $this->success("$wiki_id locked");
152 break;
153 case 'unlock':
154 $wiki_id = array_shift($options->args);
155 $this->clearLock($wiki_id);
156 $this->success("$wiki_id unlocked");
157 break;
158 default:
159 echo $options->help();
160 }
161 }
162
163 /**
164 * Check out a file
165 *
166 * @param string $wiki_id
167 * @param string $localfile
168 */
169 protected function commandCheckout($wiki_id, $localfile) {
170 global $conf;
171
172 $wiki_id = cleanID($wiki_id);
173 $wiki_fn = wikiFN($wiki_id);
174
175 if(!file_exists($wiki_fn)) {
176 $this->fatal("$wiki_id does not yet exist");
177 }
178
179 if(empty($localfile)) {
180 $localfile = getcwd().'/'.utf8_basename($wiki_fn);
181 }
182
183 if(!file_exists(dirname($localfile))) {
184 $this->fatal("Directory ".dirname($localfile)." does not exist");
185 }
186
187 if(stristr(realpath(dirname($localfile)), realpath($conf['datadir'])) !== false) {
188 $this->fatal("Attempt to check out file into data directory - not allowed");
189 }
190
191 $this->obtainLock($wiki_id);
192
193 if(!copy($wiki_fn, $localfile)) {
194 $this->clearLock($wiki_id);
195 $this->fatal("Unable to copy $wiki_fn to $localfile");
196 }
197
198 $this->success("$wiki_id > $localfile");
199 }
200
201 /**
202 * Save a file as a new page revision
203 *
204 * @param string $localfile
205 * @param string $wiki_id
206 * @param string $message
207 * @param bool $minor
208 */
209 protected function commandCommit($localfile, $wiki_id, $message, $minor) {
210 $wiki_id = cleanID($wiki_id);
211 $message = trim($message);
212
213 if(!file_exists($localfile)) {
214 $this->fatal("$localfile does not exist");
215 }
216
217 if(!is_readable($localfile)) {
218 $this->fatal("Cannot read from $localfile");
219 }
220
221 if(!$message) {
222 $this->fatal("Summary message required");
223 }
224
225 $this->obtainLock($wiki_id);
226
227 saveWikiText($wiki_id, file_get_contents($localfile), $message, $minor);
228
229 $this->clearLock($wiki_id);
230
231 $this->success("$localfile > $wiki_id");
232 }
233
234 /**
235 * Lock the given page or exit
236 *
237 * @param string $wiki_id
238 */
239 protected function obtainLock($wiki_id) {
240 if($this->force) $this->deleteLock($wiki_id);
241
242 $_SERVER['REMOTE_USER'] = $this->username;
243
244 if(checklock($wiki_id)) {
245 $this->error("Page $wiki_id is already locked by another user");
246 exit(1);
247 }
248
249 lock($wiki_id);
250
251 if(checklock($wiki_id) != $this->username) {
252 $this->error("Unable to obtain lock for $wiki_id ");
253 var_dump(checklock($wiki_id));
254 exit(1);
255 }
256 }
257
258 /**
259 * Clear the lock on the given page
260 *
261 * @param string $wiki_id
262 */
263 protected function clearLock($wiki_id) {
264 if($this->force) $this->deleteLock($wiki_id);
265
266 $_SERVER['REMOTE_USER'] = $this->username;
267 if(checklock($wiki_id)) {
268 $this->error("Page $wiki_id is locked by another user");
269 exit(1);
270 }
271
272 unlock($wiki_id);
273
274 if(file_exists(wikiLockFN($wiki_id))) {
275 $this->error("Unable to clear lock for $wiki_id");
276 exit(1);
277 }
278 }
279
280 /**
281 * Forcefully remove a lock on the page given
282 *
283 * @param string $wiki_id
284 */
285 protected function deleteLock($wiki_id) {
286 $wikiLockFN = wikiLockFN($wiki_id);
287
288 if(file_exists($wikiLockFN)) {
289 if(!unlink($wikiLockFN)) {
290 $this->error("Unable to delete $wikiLockFN");
291 exit(1);
292 }
293 }
294 }
295
296 /**
297 * Get the current user's username from the environment
298 *
299 * @return string
300 */
301 protected function getUser() {
302 $user = getenv('USER');
303 if(empty ($user)) {
304 $user = getenv('USERNAME');
305 } else {
306 return $user;
307 }
308 if(empty ($user)) {
309 $user = 'admin';
310 }
104 return $user;311 return $user;
105 }312 }
106 if (empty ($user)) {313}
107 $user = 'admin';314
108 }315
109 return $user;316// Main
110}317$cli = new PageCLI();
111318$cli->run();
112#------------------------------------------------------------------------------
113function getSuppliedArgument($OPTS, $short, $long) {
114 $arg = $OPTS->get($short);
115 if ( is_null($arg) ) {
116 $arg = $OPTS->get($long);
117 }
118 return $arg;
119}
120
121#------------------------------------------------------------------------------
122function obtainLock($WIKI_ID) {
123
124 global $USERNAME;
125
126 if ( !file_exists(wikiFN($WIKI_ID)) ) {
127 fwrite( STDERR, "$WIKI_ID does not yet exist\n");
128 }
129
130 $_SERVER['REMOTE_USER'] = $USERNAME;
131 if ( checklock($WIKI_ID) ) {
132 fwrite( STDERR, "Page $WIKI_ID is already locked by another user\n");
133 exit(1);
134 }
135
136 lock($WIKI_ID);
137
138 $_SERVER['REMOTE_USER'] = '_'.$USERNAME.'_';
139
140 if ( checklock($WIKI_ID) != $USERNAME ) {
141
142 fwrite( STDERR, "Unable to obtain lock for $WIKI_ID\n" );
143 exit(1);
144
145 }
146}
147
148#------------------------------------------------------------------------------
149function clearLock($WIKI_ID) {
150
151 global $USERNAME ;
152
153 if ( !file_exists(wikiFN($WIKI_ID)) ) {
154 fwrite( STDERR, "$WIKI_ID does not yet exist\n");
155 }
156
157 $_SERVER['REMOTE_USER'] = $USERNAME;
158 if ( checklock($WIKI_ID) ) {
159 fwrite( STDERR, "Page $WIKI_ID is locked by another user\n");
160 exit(1);
161 }
162
163 unlock($WIKI_ID);
164
165 if ( file_exists(wikiLockFN($WIKI_ID)) ) {
166 fwrite( STDERR, "Unable to clear lock for $WIKI_ID\n" );
167 exit(1);
168 }
169
170}
171
172#------------------------------------------------------------------------------
173function deleteLock($WIKI_ID) {
174
175 $wikiLockFN = wikiLockFN($WIKI_ID);
176
177 if ( file_exists($wikiLockFN) ) {
178 if ( !unlink($wikiLockFN) ) {
179 fwrite( STDERR, "Unable to delete $wikiLockFN\n" );
180 exit(1);
181 }
182 }
183
184}
185
186#------------------------------------------------------------------------------
187$USERNAME = getUser();
188$CWD = getcwd();
189$SYSTEM_ID = '127.0.0.1';
190
191#------------------------------------------------------------------------------
192$OPTS = Doku_Cli_Opts::getOptions(
193 __FILE__,
194 'h::fm:u:s:t',
195 array(
196 'help==',
197 'user=',
198 'system=',
199 'trivial',
200 )
201);
202
203if ( $OPTS->isError() ) {
204 print $OPTS->getMessage()."\n";
205 exit(1);
206}
207
208if ( $OPTS->has('h') or $OPTS->has('help') or !$OPTS->hasArgs() ) {
209 usage(getSuppliedArgument($OPTS,'h','help'));
210 exit(0);
211}
212
213if ( $OPTS->has('u') or $OPTS->has('user') ) {
214 $USERNAME = getSuppliedArgument($OPTS,'u','user');
215}
216
217if ( $OPTS->has('s') or $OPTS->has('system') ) {
218 $SYSTEM_ID = getSuppliedArgument($OPTS,'s','system');
219}
220
221#------------------------------------------------------------------------------
222switch ( $OPTS->arg(0) ) {
223
224 #----------------------------------------------------------------------
225 case 'checkout':
226
227 $WIKI_ID = $OPTS->arg(1);
228
229 if ( !$WIKI_ID ) {
230 fwrite( STDERR, "Wiki page ID required\n");
231 exit(1);
232 }
233
234 $WIKI_FN = wikiFN($WIKI_ID);
235
236 if ( !file_exists($WIKI_FN) ) {
237 fwrite( STDERR, "$WIKI_ID does not yet exist\n");
238 exit(1);
239 }
240
241 $TARGET_FN = $OPTS->arg(2);
242
243 if ( empty($TARGET_FN) ) {
244 $TARGET_FN = getcwd().'/'.utf8_basename($WIKI_FN);
245 }
246
247 if ( !file_exists(dirname($TARGET_FN)) ) {
248 fwrite( STDERR, "Directory ".dirname($TARGET_FN)." does not exist\n");
249 exit(1);
250 }
251
252 if ( stristr( realpath(dirname($TARGET_FN)), realpath($conf['datadir']) ) !== false ) {
253 fwrite( STDERR, "Attempt to check out file into data directory - not allowed\n");
254 exit(1);
255 }
256
257 if ( $OPTS->has('f') ) {
258 deleteLock($WIKI_ID);
259 }
260
261 obtainLock($WIKI_ID);
262
263 # Need to lock the file first?
264 if ( !copy($WIKI_FN, $TARGET_FN) ) {
265 fwrite( STDERR, "Unable to copy $WIKI_FN to $TARGET_FN\n");
266 clearLock($WIKI_ID);
267 exit(1);
268 }
269
270 print "$WIKI_ID > $TARGET_FN\n";
271 exit(0);
272
273 break;
274
275 #----------------------------------------------------------------------
276 case 'commit':
277
278 $TARGET_FN = $OPTS->arg(1);
279
280 if ( !$TARGET_FN ) {
281 fwrite( STDERR, "Target filename required\n");
282 exit(1);
283 }
284
285 if ( !file_exists($TARGET_FN) ) {
286 fwrite( STDERR, "$TARGET_FN does not exist\n");
287 exit(1);
288 }
289
290 if ( !is_readable($TARGET_FN) ) {
291 fwrite( STDERR, "Cannot read from $TARGET_FN\n");
292 exit(1);
293 }
294
295 $WIKI_ID = $OPTS->arg(2);
296
297 if ( !$WIKI_ID ) {
298 fwrite( STDERR, "Wiki page ID required\n");
299 exit(1);
300 }
301
302 if ( !$OPTS->has('m') ) {
303 fwrite( STDERR, "Summary message required\n");
304 exit(1);
305 }
306
307 if ( $OPTS->has('f') ) {
308 deleteLock($WIKI_ID);
309 }
310
311 $_SERVER['REMOTE_USER'] = $USERNAME;
312 if ( checklock($WIKI_ID) ) {
313 fwrite( STDERR, "$WIKI_ID is locked by another user\n");
314 exit(1);
315 }
316
317 obtainLock($WIKI_ID);
318
319 saveWikiText($WIKI_ID, file_get_contents($TARGET_FN), $OPTS->get('m'), $OPTS->has('t'));
320
321 clearLock($WIKI_ID);
322
323 exit(0);
324
325 break;
326
327 #----------------------------------------------------------------------
328 case 'lock':
329
330 $WIKI_ID = $OPTS->arg(1);
331
332 if ( !$WIKI_ID ) {
333 fwrite( STDERR, "Wiki page ID required\n");
334 exit(1);
335 }
336
337 if ( $OPTS->has('f') ) {
338 deleteLock($WIKI_ID);
339 }
340
341 obtainLock($WIKI_ID);
342
343 print "Locked : $WIKI_ID\n";
344 exit(0);
345
346 break;
347
348 #----------------------------------------------------------------------
349 case 'unlock':
350
351 $WIKI_ID = $OPTS->arg(1);
352
353 if ( !$WIKI_ID ) {
354 fwrite( STDERR, "Wiki page ID required\n");
355 exit(1);
356 }
357
358 if ( $OPTS->has('f') ) {
359 deleteLock($WIKI_ID);
360 } else {
361 clearLock($WIKI_ID);
362 }
363
364 print "Unlocked : $WIKI_ID\n";
365 exit(0);
366
367 break;
368
369 #----------------------------------------------------------------------
370 default:
371
372 fwrite( STDERR, "Invalid action ".$OPTS->arg(0)."\n" );
373 exit(1);
374
375 break;
376
377}
378
379\ No newline at end of file319\ No newline at end of file
380320
=== modified file 'bin/gittool.php'
--- bin/gittool.php 2014-06-08 13:04:43 +0000
+++ bin/gittool.php 2015-11-12 19:55:23 +0000
@@ -1,84 +1,107 @@
1#!/usr/bin/php1#!/usr/bin/php
2<?php2<?php
3
4if('cli' != php_sapi_name()) die();
5ini_set('memory_limit', '128M');
6if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');3if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
7define('NOSESSION', 1);4define('NOSESSION', 1);
8require_once(DOKU_INC.'inc/init.php');5require_once(DOKU_INC.'inc/init.php');
96
10$GitToolCLI = new GitToolCLI();
11
12array_shift($argv);
13$command = array_shift($argv);
14
15switch($command) {
16 case '':
17 case 'help':
18 $GitToolCLI->cmd_help();
19 break;
20 case 'clone':
21 $GitToolCLI->cmd_clone($argv);
22 break;
23 case 'install':
24 $GitToolCLI->cmd_install($argv);
25 break;
26 case 'repo':
27 case 'repos':
28 $GitToolCLI->cmd_repos();
29 break;
30 default:
31 $GitToolCLI->cmd_git($command, $argv);
32}
33
34/**7/**
35 * Easily manage DokuWiki git repositories8 * Easily manage DokuWiki git repositories
36 *9 *
37 * @author Andreas Gohr <andi@splitbrain.org>10 * @author Andreas Gohr <andi@splitbrain.org>
38 */11 */
39class GitToolCLI {12class GitToolCLI extends DokuCLI {
40 private $color = true;13
4114 /**
42 public function cmd_help() {15 * Register options and arguments on the given $options object
43 echo <<<EOF16 *
44Usage: gittool.php <command> [parameters]17 * @param DokuCLI_Options $options
4518 * @return void
46Manage git repositories for DokuWiki and its plugins and templates.19 */
4720 protected function setup(DokuCLI_Options $options) {
48EXAMPLE21 $options->setHelp(
4922 "Manage git repositories for DokuWiki and its plugins and templates.\n\n".
50$> ./bin/gittool.php clone gallery template:ach23 "$> ./bin/gittool.php clone gallery template:ach\n".
51$> ./bin/gittool.php repos24 "$> ./bin/gittool.php repos\n".
52$> ./bin/gittool.php origin -v25 "$> ./bin/gittool.php origin -v"
5326 );
54COMMANDS27
5528 $options->registerArgument(
56help29 'command',
57 This help screen30 'Command to execute. See below',
5831 true
59clone <extensions>32 );
60 Tries to install a known plugin or template (prefix with template:) via33
61 git. Uses the DokuWiki.org plugin repository to find the proper git34 $options->registerCommand(
62 repository. Multiple extensions can be given as parameters35 'clone',
6336 'Tries to install a known plugin or template (prefix with template:) via git. Uses the DokuWiki.org '.
64install <extensions>37 'plugin repository to find the proper git repository. Multiple extensions can be given as parameters'
65 The same as clone, but when no git source repository can be found, the38 );
66 extension is installed via download39 $options->registerArgument(
6740 'extension',
68repos41 'name of the extension to install, prefix with \'template:\' for templates',
69 Lists all git repositories found in this DokuWiki installation42 true,
7043 'clone'
71<any>44 );
72 Any unknown commands are assumed to be arguments to git and will be45
73 executed in all repositories found within this DokuWiki installation46 $options->registerCommand(
7447 'install',
75EOF;48 'The same as clone, but when no git source repository can be found, the extension is installed via '.
49 'download'
50 );
51 $options->registerArgument(
52 'extension',
53 'name of the extension to install, prefix with \'template:\' for templates',
54 true,
55 'install'
56 );
57
58 $options->registerCommand(
59 'repos',
60 'Lists all git repositories found in this DokuWiki installation'
61 );
62
63 $options->registerCommand(
64 '*',
65 'Any unknown commands are assumed to be arguments to git and will be executed in all repositories '.
66 'found within this DokuWiki installation'
67 );
68 }
69
70 /**
71 * Your main program
72 *
73 * Arguments and options have been parsed when this is run
74 *
75 * @param DokuCLI_Options $options
76 * @return void
77 */
78 protected function main(DokuCLI_Options $options) {
79 $command = $options->getCmd();
80 if(!$command) $command = array_shift($options->args);
81
82 switch($command) {
83 case '':
84 echo $options->help();
85 break;
86 case 'clone':
87 $this->cmd_clone($options->args);
88 break;
89 case 'install':
90 $this->cmd_install($options->args);
91 break;
92 case 'repo':
93 case 'repos':
94 $this->cmd_repos();
95 break;
96 default:
97 $this->cmd_git($command, $options->args);
98 }
76 }99 }
77100
78 /**101 /**
79 * Tries to install the given extensions using git clone102 * Tries to install the given extensions using git clone
80 *103 *
81 * @param $extensions104 * @param array $extensions
82 */105 */
83 public function cmd_clone($extensions) {106 public function cmd_clone($extensions) {
84 $errors = array();107 $errors = array();
@@ -88,7 +111,7 @@
88 $repo = $this->getSourceRepo($ext);111 $repo = $this->getSourceRepo($ext);
89112
90 if(!$repo) {113 if(!$repo) {
91 $this->msg_error("could not find a repository for $ext");114 $this->error("could not find a repository for $ext");
92 $errors[] = $ext;115 $errors[] = $ext;
93 } else {116 } else {
94 if($this->cloneExtension($ext, $repo)) {117 if($this->cloneExtension($ext, $repo)) {
@@ -100,14 +123,14 @@
100 }123 }
101124
102 echo "\n";125 echo "\n";
103 if($succeeded) $this->msg_success('successfully cloned the following extensions: '.join(', ', $succeeded));126 if($succeeded) $this->success('successfully cloned the following extensions: '.join(', ', $succeeded));
104 if($errors) $this->msg_error('failed to clone the following extensions: '.join(', ', $errors));127 if($errors) $this->error('failed to clone the following extensions: '.join(', ', $errors));
105 }128 }
106129
107 /**130 /**
108 * Tries to install the given extensions using git clone with fallback to install131 * Tries to install the given extensions using git clone with fallback to install
109 *132 *
110 * @param $extensions133 * @param array $extensions
111 */134 */
112 public function cmd_install($extensions) {135 public function cmd_install($extensions) {
113 $errors = array();136 $errors = array();
@@ -117,7 +140,7 @@
117 $repo = $this->getSourceRepo($ext);140 $repo = $this->getSourceRepo($ext);
118141
119 if(!$repo) {142 if(!$repo) {
120 $this->msg_info("could not find a repository for $ext");143 $this->info("could not find a repository for $ext");
121 if($this->downloadExtension($ext)) {144 if($this->downloadExtension($ext)) {
122 $succeeded[] = $ext;145 $succeeded[] = $ext;
123 } else {146 } else {
@@ -133,8 +156,8 @@
133 }156 }
134157
135 echo "\n";158 echo "\n";
136 if($succeeded) $this->msg_success('successfully installed the following extensions: '.join(', ', $succeeded));159 if($succeeded) $this->success('successfully installed the following extensions: '.join(', ', $succeeded));
137 if($errors) $this->msg_error('failed to install the following extensions: '.join(', ', $errors));160 if($errors) $this->error('failed to install the following extensions: '.join(', ', $errors));
138 }161 }
139162
140 /**163 /**
@@ -152,19 +175,19 @@
152175
153 foreach($repos as $repo) {176 foreach($repos as $repo) {
154 if(!@chdir($repo)) {177 if(!@chdir($repo)) {
155 $this->msg_error("Could not change into $repo");178 $this->error("Could not change into $repo");
156 continue;179 continue;
157 }180 }
158181
159 echo "\n";182 echo "\n";
160 $this->msg_info("executing $shell in $repo");183 $this->info("executing $shell in $repo");
161 $ret = 0;184 $ret = 0;
162 system($shell, $ret);185 system($shell, $ret);
163186
164 if($ret == 0) {187 if($ret == 0) {
165 $this->msg_success("git succeeded in $repo");188 $this->success("git succeeded in $repo");
166 } else {189 } else {
167 $this->msg_error("git failed in $repo");190 $this->error("git failed in $repo");
168 }191 }
169 }192 }
170 }193 }
@@ -183,33 +206,34 @@
183 * Install extension from the given download URL206 * Install extension from the given download URL
184 *207 *
185 * @param string $ext208 * @param string $ext
186 * @return bool209 * @return bool|null
187 */210 */
188 private function downloadExtension($ext) {211 private function downloadExtension($ext) {
189 /** @var helper_plugin_extension_extension $plugin */212 /** @var helper_plugin_extension_extension $plugin */
190 $plugin = plugin_load('helper', 'extension_extension');213 $plugin = plugin_load('helper', 'extension_extension');
191 if(!$ext) die("extension plugin not available, can't continue");214 if(!$ext) die("extension plugin not available, can't continue");
215
192 $plugin->setExtension($ext);216 $plugin->setExtension($ext);
193217
194 $url = $plugin->getDownloadURL();218 $url = $plugin->getDownloadURL();
195 if(!$url) {219 if(!$url) {
196 $this->msg_error("no download URL for $ext");220 $this->error("no download URL for $ext");
197 return false;221 return false;
198 }222 }
199223
200 $ok = false;224 $ok = false;
201 try {225 try {
202 $this->msg_info("installing $ext via download from $url");226 $this->info("installing $ext via download from $url");
203 $ok = $plugin->installFromURL($url);227 $ok = $plugin->installFromURL($url);
204 } catch(Exception $e) {228 } catch(Exception $e) {
205 $this->msg_error($e->getMessage());229 $this->error($e->getMessage());
206 }230 }
207231
208 if($ok) {232 if($ok) {
209 $this->msg_success("installed $ext via download");233 $this->success("installed $ext via download");
210 return true;234 return true;
211 } else {235 } else {
212 $this->msg_success("failed to install $ext via download");236 $this->success("failed to install $ext via download");
213 return false;237 return false;
214 }238 }
215 }239 }
@@ -228,14 +252,14 @@
228 $target = DOKU_PLUGIN.$ext;252 $target = DOKU_PLUGIN.$ext;
229 }253 }
230254
231 $this->msg_info("cloning $ext from $repo to $target");255 $this->info("cloning $ext from $repo to $target");
232 $ret = 0;256 $ret = 0;
233 system("git clone $repo $target", $ret);257 system("git clone $repo $target", $ret);
234 if($ret === 0) {258 if($ret === 0) {
235 $this->msg_success("cloning of $ext succeeded");259 $this->success("cloning of $ext succeeded");
236 return true;260 return true;
237 } else {261 } else {
238 $this->msg_error("cloning of $ext failed");262 $this->error("cloning of $ext failed");
239 return false;263 return false;
240 }264 }
241 }265 }
@@ -248,7 +272,7 @@
248 * @return array272 * @return array
249 */273 */
250 private function findRepos() {274 private function findRepos() {
251 $this->msg_info('Looking for .git directories');275 $this->info('Looking for .git directories');
252 $data = array_merge(276 $data = array_merge(
253 glob(DOKU_INC.'.git', GLOB_ONLYDIR),277 glob(DOKU_INC.'.git', GLOB_ONLYDIR),
254 glob(DOKU_PLUGIN.'*/.git', GLOB_ONLYDIR),278 glob(DOKU_PLUGIN.'*/.git', GLOB_ONLYDIR),
@@ -256,9 +280,9 @@
256 );280 );
257281
258 if(!$data) {282 if(!$data) {
259 $this->msg_error('Found no .git directories');283 $this->error('Found no .git directories');
260 } else {284 } else {
261 $this->msg_success('Found '.count($data).' .git directories');285 $this->success('Found '.count($data).' .git directories');
262 }286 }
263 $data = array_map('fullpath', array_map('dirname', $data));287 $data = array_map('fullpath', array_map('dirname', $data));
264 return $data;288 return $data;
@@ -268,12 +292,13 @@
268 * Returns the repository for the given extension292 * Returns the repository for the given extension
269 *293 *
270 * @param $extension294 * @param $extension
271 * @return bool|string295 * @return false|string
272 */296 */
273 private function getSourceRepo($extension) {297 private function getSourceRepo($extension) {
274 /** @var helper_plugin_extension_extension $ext */298 /** @var helper_plugin_extension_extension $ext */
275 $ext = plugin_load('helper', 'extension_extension');299 $ext = plugin_load('helper', 'extension_extension');
276 if(!$ext) die("extension plugin not available, can't continue");300 if(!$ext) die("extension plugin not available, can't continue");
301
277 $ext->setExtension($extension);302 $ext->setExtension($extension);
278303
279 $repourl = $ext->getSourcerepoURL();304 $repourl = $ext->getSourcerepoURL();
@@ -304,37 +329,8 @@
304329
305 return false;330 return false;
306 }331 }
307
308 /**
309 * Print an error message
310 *
311 * @param $string
312 */
313 private function msg_error($string) {
314 if($this->color) echo "\033[31m"; // red
315 echo "E: $string\n";
316 if($this->color) echo "\033[37m"; // reset
317 }
318
319 /**
320 * Print a success message
321 *
322 * @param $string
323 */
324 private function msg_success($string) {
325 if($this->color) echo "\033[32m"; // green
326 echo "S: $string\n";
327 if($this->color) echo "\033[37m"; // reset
328 }
329
330 /**
331 * Print an info message
332 *
333 * @param $string
334 */
335 private function msg_info($string) {
336 if($this->color) echo "\033[36m"; // cyan
337 echo "I: $string\n";
338 if($this->color) echo "\033[37m"; // reset
339 }
340}
341\ No newline at end of file332\ No newline at end of file
333}
334
335// Main
336$cli = new GitToolCLI();
337$cli->run();
342\ No newline at end of file338\ No newline at end of file
343339
=== modified file 'bin/indexer.php'
--- bin/indexer.php 2014-06-08 13:04:43 +0000
+++ bin/indexer.php 2015-11-12 19:55:23 +0000
@@ -1,98 +1,103 @@
1#!/usr/bin/php1#!/usr/bin/php
2<?php2<?php
3if ('cli' != php_sapi_name()) die();3if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
44define('NOSESSION', 1);
5ini_set('memory_limit','128M');
6if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
7require_once(DOKU_INC.'inc/init.php');5require_once(DOKU_INC.'inc/init.php');
8require_once(DOKU_INC.'inc/cliopts.php');
9session_write_close();
10
11// handle options
12$short_opts = 'hcuq';
13$long_opts = array('help', 'clear', 'update', 'quiet');
14$OPTS = Doku_Cli_Opts::getOptions(__FILE__,$short_opts,$long_opts);
15if ( $OPTS->isError() ) {
16 fwrite( STDERR, $OPTS->getMessage() . "\n");
17 _usage();
18 exit(1);
19}
20$CLEAR = false;
21$QUIET = false;
22$INDEXER = null;
23foreach ($OPTS->options as $key => $val) {
24 switch ($key) {
25 case 'h':
26 case 'help':
27 _usage();
28 exit;
29 case 'c':
30 case 'clear':
31 $CLEAR = true;
32 break;
33 case 'q':
34 case 'quiet':
35 $QUIET = true;
36 break;
37 }
38}
39
40#------------------------------------------------------------------------------
41# Action
42
43if($CLEAR) _clearindex();
44_update();
45
46
47
48#------------------------------------------------------------------------------
49
50function _usage() {
51 print "Usage: indexer.php <options>
52
53 Updates the searchindex by indexing all new or changed pages
54 when the -c option is given the index is cleared first.
55
56 OPTIONS
57 -h, --help show this help and exit
58 -c, --clear clear the index before updating
59 -q, --quiet don't produce any output
60";
61}
62
63function _update(){
64 global $conf;
65 $data = array();
66 _quietecho("Searching pages... ");
67 search($data,$conf['datadir'],'search_allpages',array('skipacl' => true));
68 _quietecho(count($data)." pages found.\n");
69
70 foreach($data as $val){
71 _index($val['id']);
72 }
73}
74
75function _index($id){
76 global $CLEAR;
77 global $QUIET;
78
79 _quietecho("$id... ");
80 idx_addPage($id, !$QUIET, $CLEAR);
81 _quietecho("done.\n");
82}
836
84/**7/**
85 * Clear all index files8 * Update the Search Index from command line
86 */9 */
87function _clearindex(){10class IndexerCLI extends DokuCLI {
88 _quietecho("Clearing index... ");11
89 idx_get_indexer()->clear();12 private $quiet = false;
90 _quietecho("done.\n");13 private $clear = false;
91}14
9215 /**
93function _quietecho($msg) {16 * Register options and arguments on the given $options object
94 global $QUIET;17 *
95 if(!$QUIET) echo $msg;18 * @param DokuCLI_Options $options
96}19 * @return void
9720 */
98//Setup VIM: ex: et ts=2 :21 protected function setup(DokuCLI_Options $options) {
22 $options->setHelp(
23 'Updates the searchindex by indexing all new or changed pages. When the -c option is '.
24 'given the index is cleared first.'
25 );
26
27 $options->registerOption(
28 'clear',
29 'clear the index before updating',
30 'c'
31 );
32 $options->registerOption(
33 'quiet',
34 'don\'t produce any output',
35 'q'
36 );
37 }
38
39 /**
40 * Your main program
41 *
42 * Arguments and options have been parsed when this is run
43 *
44 * @param DokuCLI_Options $options
45 * @return void
46 */
47 protected function main(DokuCLI_Options $options) {
48 $this->clear = $options->getOpt('clear');
49 $this->quiet = $options->getOpt('quiet');
50
51 if($this->clear) $this->clearindex();
52
53 $this->update();
54 }
55
56 /**
57 * Update the index
58 */
59 function update() {
60 global $conf;
61 $data = array();
62 $this->quietecho("Searching pages... ");
63 search($data, $conf['datadir'], 'search_allpages', array('skipacl' => true));
64 $this->quietecho(count($data)." pages found.\n");
65
66 foreach($data as $val) {
67 $this->index($val['id']);
68 }
69 }
70
71 /**
72 * Index the given page
73 *
74 * @param string $id
75 */
76 function index($id) {
77 $this->quietecho("$id... ");
78 idx_addPage($id, !$this->quiet, $this->clear);
79 $this->quietecho("done.\n");
80 }
81
82 /**
83 * Clear all index files
84 */
85 function clearindex() {
86 $this->quietecho("Clearing index... ");
87 idx_get_indexer()->clear();
88 $this->quietecho("done.\n");
89 }
90
91 /**
92 * Print message if not supressed
93 *
94 * @param string $msg
95 */
96 function quietecho($msg) {
97 if(!$this->quiet) echo $msg;
98 }
99}
100
101// Main
102$cli = new IndexerCLI();
103$cli->run();
99\ No newline at end of file104\ No newline at end of file
100105
=== modified file 'bin/render.php'
--- bin/render.php 2011-01-24 08:52:15 +0000
+++ bin/render.php 2015-11-12 19:55:23 +0000
@@ -1,5 +1,10 @@
1#!/usr/bin/php1#!/usr/bin/php
2<?php2<?php
3if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
4define('NOSESSION', 1);
5require_once(DOKU_INC.'inc/init.php');
6
7
3/**8/**
4 * A simple commandline tool to render some DokuWiki syntax with a given9 * A simple commandline tool to render some DokuWiki syntax with a given
5 * renderer.10 * renderer.
@@ -9,59 +14,48 @@
9 * DokuWiki markup14 * DokuWiki markup
10 *15 *
11 * @license GPL216 * @license GPL2
12 * @author Andreas Gohr <andi@splitbrain.org>17 * @author Andreas Gohr <andi@splitbrain.org>
13 */18 */
14if ('cli' != php_sapi_name()) die();19class RenderCLI extends DokuCLI {
1520
16ini_set('memory_limit','128M');21 /**
17if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');22 * Register options and arguments on the given $options object
18define('NOSESSION',1);23 *
19require_once(DOKU_INC.'inc/init.php');24 * @param DokuCLI_Options $options
20require_once(DOKU_INC.'inc/common.php');25 * @return void
21require_once(DOKU_INC.'inc/parserutils.php');26 */
22require_once(DOKU_INC.'inc/cliopts.php');27 protected function setup(DokuCLI_Options $options) {
2328 $options->setHelp(
24// handle options29 'A simple commandline tool to render some DokuWiki syntax with a given renderer.'.
25$short_opts = 'hr:';30 "\n\n".
26$long_opts = array('help','renderer:');31 'This may not work for plugins that expect a certain environment to be '.
27$OPTS = Doku_Cli_Opts::getOptions(__FILE__,$short_opts,$long_opts);32 'set up before rendering, but should work for most or even all standard '.
28if ( $OPTS->isError() ) {33 'DokuWiki markup'
29 fwrite( STDERR, $OPTS->getMessage() . "\n");34 );
30 _usage();35 $options->registerOption('renderer', 'The renderer mode to use. Defaults to xhtml', 'r', 'mode');
31 exit(1);36 }
32}37
33$RENDERER = 'xhtml';38 /**
34foreach ($OPTS->options as $key => $val) {39 * Your main program
35 switch ($key) {40 *
36 case 'h':41 * Arguments and options have been parsed when this is run
37 case 'help':42 *
38 _usage();43 * @param DokuCLI_Options $options
39 exit;44 * @throws DokuCLI_Exception
40 case 'r':45 * @return void
41 case 'renderer':46 */
42 $RENDERER = $val;47 protected function main(DokuCLI_Options $options) {
43 }48 $renderer = $options->getOpt('renderer', 'xhtml');
44}49
4550 // do the action
4651 $source = stream_get_contents(STDIN);
47// do the action52 $info = array();
48$source = stream_get_contents(STDIN);53 $result = p_render($renderer, p_get_instructions($source), $info);
49$info = array();54 if(is_null($result)) throw new DokuCLI_Exception("No such renderer $renderer");
50$result = p_render($RENDERER,p_get_instructions($source),$info);55 echo $result;
51if(is_null($result)) die("No such renderer $RENDERER\n");56 }
52echo $result;57}
5358
54/**59// Main
55 * Print usage info60$cli = new RenderCLI();
56 */61$cli->run();
57function _usage(){
58 print "Usage: render.php <options>
59
60 Reads DokuWiki syntax from STDIN and renders it with the given renderer
61 to STDOUT
62
63 OPTIONS
64 -h, --help show this help and exit
65 -r, --renderer <renderer> the render mode (default: xhtml)
66";
67}
68\ No newline at end of file62\ No newline at end of file
6963
=== modified file 'bin/striplangs.php'
--- bin/striplangs.php 2014-06-08 13:04:43 +0000
+++ bin/striplangs.php 2015-11-12 19:55:23 +0000
@@ -1,148 +1,111 @@
1#!/usr/bin/php1#!/usr/bin/php
2<?php2<?php
3if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
4define('NOSESSION', 1);
5require_once(DOKU_INC.'inc/init.php');
6
7
3/**8/**
4 * Strip unwanted languages from the DokuWiki install9 * Remove unwanted languages from a DokuWiki install
5 *
6 * @author Martin 'E.T.' Misuth <et.github@ethome.sk>
7 */10 */
8if ('cli' != php_sapi_name()) die();11class StripLangsCLI extends DokuCLI {
912
10#------------------------------------------------------------------------------13 /**
11if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');14 * Register options and arguments on the given $options object
12require_once DOKU_INC.'inc/cliopts.php';15 *
1316 * @param DokuCLI_Options $options
14#------------------------------------------------------------------------------17 * @return void
15function usage($show_examples = false) {18 */
16 print "Usage: striplangs.php [-h [-x]] [-e] [-k lang1[,lang2]..[,langN]]19 protected function setup(DokuCLI_Options $options) {
1720
18 Removes all languages from the installation, besides the ones21 $options->setHelp(
19 after the -k option. English language is never removed!22 'Remove all languages from the installation, besides the ones specified. English language '.
2023 'is never removed!'
21 OPTIONS24 );
22 -h, --help get this help25
23 -x, --examples get also usage examples26 $options->registerOption(
24 -k, --keep comma separated list of languages, -e is always implied27 'keep',
25 -e, --english keeps english, dummy to use without -k\n";28 'Comma separated list of languages to keep in addition to English.',
26 if ( $show_examples ) {29 'k',
27 print "\n30 'langcodes'
28 EXAMPLES31 );
29 Strips all languages, but keeps 'en' and 'de':32 $options->registerOption(
30 striplangs -k de33 'english-only',
3134 'Remove all languages except English',
32 Strips all but 'en','ca-valencia','cs','de','is','sk':35 'e'
33 striplangs --keep ca-valencia,cs,de,is,sk36 );
3437 }
35 Strips all but 'en':38
36 striplangs -e39 /**
3740 * Your main program
38 No option specified, prints usage and throws error:41 *
39 striplangs\n";42 * Arguments and options have been parsed when this is run
40 }43 *
41}44 * @param DokuCLI_Options $options
4245 * @return void
43function getSuppliedArgument($OPTS, $short, $long) {46 */
44 $arg = $OPTS->get($short);47 protected function main(DokuCLI_Options $options) {
45 if ( is_null($arg) ) {48 if($options->getOpt('keep')) {
46 $arg = $OPTS->get($long);49 $keep = explode(',', $options->getOpt('keep'));
47 }50 if(!in_array('en', $keep)) $keep[] = 'en';
48 return $arg;51 } elseif($options->getOpt('english-only')) {
49}52 $keep = array('en');
5053 } else {
51function processPlugins($path, $keep_langs) {54 echo $options->help();
52 if (is_dir($path)) {55 exit(0);
53 $entries = scandir($path);56 }
5457
55 foreach ($entries as $entry) {58 // Kill all language directories in /inc/lang and /lib/plugins besides those in $langs array
56 if ($entry != "." && $entry != "..") {59 $this->stripDirLangs(realpath(dirname(__FILE__).'/../inc/lang'), $keep);
57 if ( is_dir($path.'/'.$entry) ) {60 $this->processExtensions(realpath(dirname(__FILE__).'/../lib/plugins'), $keep);
5861 $this->processExtensions(realpath(dirname(__FILE__).'/../lib/tpl'), $keep);
59 $plugin_langs = $path.'/'.$entry.'/lang';62 }
6063
61 if ( is_dir( $plugin_langs ) ) {64 /**
62 stripDirLangs($plugin_langs, $keep_langs);65 * Strip languages from extensions
66 *
67 * @param string $path path to plugin or template dir
68 * @param array $keep_langs languages to keep
69 */
70 protected function processExtensions($path, $keep_langs) {
71 if(is_dir($path)) {
72 $entries = scandir($path);
73
74 foreach($entries as $entry) {
75 if($entry != "." && $entry != "..") {
76 if(is_dir($path.'/'.$entry)) {
77
78 $plugin_langs = $path.'/'.$entry.'/lang';
79
80 if(is_dir($plugin_langs)) {
81 $this->stripDirLangs($plugin_langs, $keep_langs);
82 }
63 }83 }
64 }84 }
65 }85 }
66 }86 }
67 }87 }
68}88
6989 /**
70function stripDirLangs($path, $keep_langs) {90 * Strip languages from path
71 $dir = dir($path);91 *
7292 * @param string $path path to lang dir
73 while(($cur_dir = $dir->read()) !== false) {93 * @param array $keep_langs languages to keep
74 if( $cur_dir != '.' and $cur_dir != '..' and is_dir($path.'/'.$cur_dir)) {94 */
7595 protected function stripDirLangs($path, $keep_langs) {
76 if ( !in_array($cur_dir, $keep_langs, true ) ) {96 $dir = dir($path);
77 killDir($path.'/'.$cur_dir);97
78 }98 while(($cur_dir = $dir->read()) !== false) {
79 }99 if($cur_dir != '.' and $cur_dir != '..' and is_dir($path.'/'.$cur_dir)) {
80 }100
81 $dir->close();101 if(!in_array($cur_dir, $keep_langs, true)) {
82}102 io_rmdir($path.'/'.$cur_dir, true);
83
84function killDir($dir) {
85 if (is_dir($dir)) {
86 $entries = scandir($dir);
87
88 foreach ($entries as $entry) {
89 if ($entry != "." && $entry != "..") {
90 if ( is_dir($dir.'/'.$entry) ) {
91 killDir($dir.'/'.$entry);
92 } else {
93 unlink($dir.'/'.$entry);
94 }103 }
95 }104 }
96 }105 }
97 reset($entries);106 $dir->close();
98 rmdir($dir);107 }
99 }108}
100}109
101#------------------------------------------------------------------------------110$cli = new StripLangsCLI();
102111$cli->run();
103// handle options
104$short_opts = 'hxk:e';
105$long_opts = array('help', 'examples', 'keep=','english');
106
107$OPTS = Doku_Cli_Opts::getOptions(__FILE__, $short_opts, $long_opts);
108
109if ( $OPTS->isError() ) {
110 fwrite( STDERR, $OPTS->getMessage() . "\n");
111 exit(1);
112}
113
114// handle '--examples' option
115$show_examples = ( $OPTS->has('x') or $OPTS->has('examples') ) ? true : false;
116
117// handle '--help' option
118if ( $OPTS->has('h') or $OPTS->has('help') ) {
119 usage($show_examples);
120 exit(0);
121}
122
123// handle both '--keep' and '--english' options
124if ( $OPTS->has('k') or $OPTS->has('keep') ) {
125 $preserved_langs = getSuppliedArgument($OPTS,'k','keep');
126 $langs = explode(',', $preserved_langs);
127
128 // ! always enforce 'en' lang when using '--keep' (DW relies on it)
129 if ( !isset($langs['en']) ) {
130 $langs[]='en';
131 }
132} elseif ( $OPTS->has('e') or $OPTS->has('english') ) {
133 // '--english' was specified strip everything besides 'en'
134 $langs = array ('en');
135} else {
136 // no option was specified, print usage but don't do anything as
137 // this run might not be intented
138 usage();
139 print "\n
140 ERROR
141 No option specified, use either -h -x to get more info,
142 or -e to strip every language besides english.\n";
143 exit(1);
144}
145
146// Kill all language directories in /inc/lang and /lib/plugins besides those in $langs array
147stripDirLangs(realpath(dirname(__FILE__).'/../inc/lang'), $langs);
148processPlugins(realpath(dirname(__FILE__).'/../lib/plugins'), $langs);
149\ No newline at end of file112\ No newline at end of file
150113
=== modified file 'bin/wantedpages.php'
--- bin/wantedpages.php 2014-06-08 13:04:43 +0000
+++ bin/wantedpages.php 2015-11-12 19:55:23 +0000
@@ -1,134 +1,153 @@
1#!/usr/bin/php1#!/usr/bin/php
2<?php2<?php
3if ('cli' != php_sapi_name()) die();3if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
44define('NOSESSION', 1);
5#------------------------------------------------------------------------------5require_once(DOKU_INC.'inc/init.php');
6ini_set('memory_limit','128M');6
7if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');7/**
8require_once DOKU_INC.'inc/init.php';8 * Find wanted pages
9require_once DOKU_INC.'inc/common.php';9 */
10require_once DOKU_INC.'inc/search.php';10class WantedPagesCLI extends DokuCLI {
11require_once DOKU_INC.'inc/cliopts.php';11
1212 const DIR_CONTINUE = 1;
13#------------------------------------------------------------------------------13 const DIR_NS = 2;
14function usage() {14 const DIR_PAGE = 3;
15 print "Usage: wantedpages.php [wiki:namespace]15
1616 /**
17 Outputs a list of wanted pages (pages which have17 * Register options and arguments on the given $options object
18 internal links but do not yet exist).18 *
1919 * @param DokuCLI_Options $options
20 If the optional [wiki:namespace] is not provided,20 * @return void
21 defaults to the root wiki namespace21 */
2222 protected function setup(DokuCLI_Options $options) {
23 OPTIONS23 $options->setHelp(
24 -h, --help get help24 'Outputs a list of wanted pages (pages which have internal links but do not yet exist).'
25";25 );
26}26 $options->registerArgument(
2727 'namespace',
28#------------------------------------------------------------------------------28 'The namespace to lookup. Defaults to root namespace',
29define ('DW_DIR_CONTINUE',1);29 false
30define ('DW_DIR_NS',2);30 );
31define ('DW_DIR_PAGE',3);31 }
3232
33#------------------------------------------------------------------------------33 /**
34function dw_dir_filter($entry, $basepath) {34 * Your main program
35 if ($entry == '.' || $entry == '..' ) {35 *
36 return DW_DIR_CONTINUE;36 * Arguments and options have been parsed when this is run
37 }37 *
38 if ( is_dir($basepath . '/' . $entry) ) {38 * @param DokuCLI_Options $options
39 if ( strpos($entry, '_') === 0 ) {39 * @return void
40 return DW_DIR_CONTINUE;40 */
41 }41 protected function main(DokuCLI_Options $options) {
42 return DW_DIR_NS;42
43 }43 if($options->args) {
44 if ( preg_match('/\.txt$/',$entry) ) {44 $startdir = dirname(wikiFN($options->args[0].':xxx'));
45 return DW_DIR_PAGE;
46 }
47 return DW_DIR_CONTINUE;
48}
49
50#------------------------------------------------------------------------------
51function dw_get_pages($dir) {
52 static $trunclen = null;
53 if ( !$trunclen ) {
54 global $conf;
55 $trunclen = strlen($conf['datadir'].':');
56 }
57
58 if ( !is_dir($dir) ) {
59 fwrite( STDERR, "Unable to read directory $dir\n");
60 exit(1);
61 }
62
63 $pages = array();
64 $dh = opendir($dir);
65 while ( false !== ( $entry = readdir($dh) ) ) {
66 $status = dw_dir_filter($entry, $dir);
67 if ( $status == DW_DIR_CONTINUE ) {
68 continue;
69 } else if ( $status == DW_DIR_NS ) {
70 $pages = array_merge($pages, dw_get_pages($dir . '/' . $entry));
71 } else {45 } else {
72 $page = array(46 $startdir = dirname(wikiFN('xxx'));
73 'id' => pathID(substr($dir.'/'.$entry,$trunclen)),47 }
74 'file'=> $dir.'/'.$entry,48
49 $this->info("searching $startdir");
50
51 $wanted_pages = array();
52
53 foreach($this->get_pages($startdir) as $page) {
54 $wanted_pages = array_merge($wanted_pages, $this->internal_links($page));
55 }
56 $wanted_pages = array_unique($wanted_pages);
57 sort($wanted_pages);
58
59 foreach($wanted_pages as $page) {
60 print $page."\n";
61 }
62 }
63
64 /**
65 * Determine directions of the search loop
66 *
67 * @param string $entry
68 * @param string $basepath
69 * @return int
70 */
71 protected function dir_filter($entry, $basepath) {
72 if($entry == '.' || $entry == '..') {
73 return WantedPagesCLI::DIR_CONTINUE;
74 }
75 if(is_dir($basepath.'/'.$entry)) {
76 if(strpos($entry, '_') === 0) {
77 return WantedPagesCLI::DIR_CONTINUE;
78 }
79 return WantedPagesCLI::DIR_NS;
80 }
81 if(preg_match('/\.txt$/', $entry)) {
82 return WantedPagesCLI::DIR_PAGE;
83 }
84 return WantedPagesCLI::DIR_CONTINUE;
85 }
86
87 /**
88 * Collects recursively the pages in a namespace
89 *
90 * @param string $dir
91 * @return array
92 * @throws DokuCLI_Exception
93 */
94 protected function get_pages($dir) {
95 static $trunclen = null;
96 if(!$trunclen) {
97 global $conf;
98 $trunclen = strlen($conf['datadir'].':');
99 }
100
101 if(!is_dir($dir)) {
102 throw new DokuCLI_Exception("Unable to read directory $dir");
103 }
104
105 $pages = array();
106 $dh = opendir($dir);
107 while(false !== ($entry = readdir($dh))) {
108 $status = $this->dir_filter($entry, $dir);
109 if($status == WantedPagesCLI::DIR_CONTINUE) {
110 continue;
111 } else if($status == WantedPagesCLI::DIR_NS) {
112 $pages = array_merge($pages, $this->get_pages($dir.'/'.$entry));
113 } else {
114 $page = array(
115 'id' => pathID(substr($dir.'/'.$entry, $trunclen)),
116 'file' => $dir.'/'.$entry,
75 );117 );
76 $pages[] = $page;118 $pages[] = $page;
77 }119 }
78 }120 }
79 closedir($dh);121 closedir($dh);
80 return $pages;122 return $pages;
81}123 }
82124
83#------------------------------------------------------------------------------125 /**
84function dw_internal_links($page) {126 * Parse instructions and returns the non-existing links
85 global $conf;127 *
86 $instructions = p_get_instructions(file_get_contents($page['file']));128 * @param array $page array with page id and file path
87 $links = array();129 * @return array
88 $cns = getNS($page['id']);130 */
89 $exists = false;131 function internal_links($page) {
90 foreach($instructions as $ins){132 global $conf;
91 if($ins[0] == 'internallink' || ($conf['camelcase'] && $ins[0] == 'camelcaselink') ){133 $instructions = p_get_instructions(file_get_contents($page['file']));
92 $mid = $ins[1][0];134 $links = array();
93 resolve_pageid($cns,$mid,$exists);135 $cns = getNS($page['id']);
94 if ( !$exists ) {136 $exists = false;
95 list($mid) = explode('#',$mid); //record pages without hashs137 foreach($instructions as $ins) {
96 $links[] = $mid;138 if($ins[0] == 'internallink' || ($conf['camelcase'] && $ins[0] == 'camelcaselink')) {
97 }139 $mid = $ins[1][0];
98 }140 resolve_pageid($cns, $mid, $exists);
99 }141 if(!$exists) {
100 return $links;142 list($mid) = explode('#', $mid); //record pages without hashs
101}143 $links[] = $mid;
102144 }
103#------------------------------------------------------------------------------145 }
104$OPTS = Doku_Cli_Opts::getOptions(__FILE__,'h',array('help'));146 }
105147 return $links;
106if ( $OPTS->isError() ) {148 }
107 fwrite( STDERR, $OPTS->getMessage() . "\n");149}
108 exit(1);150
109}151// Main
110152$cli = new WantedPagesCLI();
111if ( $OPTS->has('h') or $OPTS->has('help') ) {153$cli->run();
112 usage();
113 exit(0);
114}
115
116$START_DIR = $conf['datadir'];
117
118if ( $OPTS->numArgs() == 1 ) {
119 $START_DIR .= '/' . $OPTS->arg(0);
120}
121
122#------------------------------------------------------------------------------
123$WANTED_PAGES = array();
124
125foreach ( dw_get_pages($START_DIR) as $WIKI_PAGE ) {
126 $WANTED_PAGES = array_merge($WANTED_PAGES,dw_internal_links($WIKI_PAGE));
127}
128$WANTED_PAGES = array_unique($WANTED_PAGES);
129sort($WANTED_PAGES);
130
131foreach ( $WANTED_PAGES as $WANTED_PAGE ) {
132 print $WANTED_PAGE."\n";
133}
134exit(0);
135\ No newline at end of file154\ No newline at end of file
136155
=== modified file 'conf/interwiki.conf'
--- conf/interwiki.conf 2014-06-08 13:04:43 +0000
+++ conf/interwiki.conf 2015-11-12 19:55:23 +0000
@@ -1,37 +1,41 @@
1# Each URL may contain one of the placeholders {URL} or {NAME}1# Each URL may contain one of these placeholders
2# {URL} is replaced by the URL encoded representation of the wikiname2# {URL} is replaced by the URL encoded representation of the wikiname
3# this is the right thing to do in most cases3# this is the right thing to do in most cases
4# {NAME} this is replaced by the wikiname as given in the document4# {NAME} this is replaced by the wikiname as given in the document
5# no further encoding is done5# only mandatory encoded is done, urlencoding if the link
6# is an external URL, or encoding as a wikiname if it is an
7# internal link (begins with a colon)
8# {SCHEME}
9# {HOST}
10# {PORT}
11# {PATH}
12# {QUERY} these placeholders will be replaced with the appropriate part
13# of the link when parsed as a URL
6# If no placeholder is defined the urlencoded name is appended to the URL14# If no placeholder is defined the urlencoded name is appended to the URL
715
8# To prevent losing your added InterWiki shortcuts after an upgrade,16# To prevent losing your added InterWiki shortcuts after an upgrade,
9# you should add new ones to interwiki.local.conf17# you should add new ones to interwiki.local.conf
1018
11wp http://en.wikipedia.org/wiki/{NAME}19wp https://en.wikipedia.org/wiki/{NAME}
12wpfr http://fr.wikipedia.org/wiki/{NAME}20wpfr https://fr.wikipedia.org/wiki/{NAME}
13wpde http://de.wikipedia.org/wiki/{NAME}21wpde https://de.wikipedia.org/wiki/{NAME}
14wpes http://es.wikipedia.org/wiki/{NAME}22wpes https://es.wikipedia.org/wiki/{NAME}
15wppl http://pl.wikipedia.org/wiki/{NAME}23wppl https://pl.wikipedia.org/wiki/{NAME}
16wpjp http://ja.wikipedia.org/wiki/{NAME}24wpjp https://ja.wikipedia.org/wiki/{NAME}
17wpmeta http://meta.wikipedia.org/wiki/{NAME}25wpmeta https://meta.wikipedia.org/wiki/{NAME}
18doku http://www.dokuwiki.org/26doku https://www.dokuwiki.org/
19dokubug http://bugs.dokuwiki.org/index.php?do=details&amp;task_id=27rfc https://tools.ietf.org/html/rfc
20rfc http://tools.ietf.org/html/rfc
21man http://man.cx/28man http://man.cx/
22amazon http://www.amazon.com/exec/obidos/ASIN/{URL}/splitbrain-20/29amazon https://www.amazon.com/exec/obidos/ASIN/{URL}/splitbrain-20/
23amazon.de http://www.amazon.de/exec/obidos/ASIN/{URL}/splitbrain-21/30amazon.de https://www.amazon.de/exec/obidos/ASIN/{URL}/splitbrain-21/
24amazon.uk http://www.amazon.co.uk/exec/obidos/ASIN/31amazon.uk https://www.amazon.co.uk/exec/obidos/ASIN/
25paypal https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=32paypal https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=
26phpfn http://www.php.net/{NAME}33phpfn https://www.php.net/{NAME}
27coral http://{HOST}.{PORT}.nyud.net:8090{PATH}?{QUERY}
28freecache http://freecache.org/{NAME}
29sb http://www.splitbrain.org/go/
30skype skype:{NAME}34skype skype:{NAME}
31google.de http://www.google.de/search?q=35google.de https://www.google.de/search?q=
32go http://www.google.com/search?q={URL}&amp;btnI=lucky36go https://www.google.com/search?q={URL}&amp;btnI=lucky
33user :user:{NAME}37user :user:{NAME}
3438
35# To support VoIP/SIP links39# To support VoIP/SIP/TEL links
36callto callto://{NAME}40callto callto://{NAME}
3741tel tel:{NAME}
3842
=== modified file 'conf/mime.conf'
--- conf/mime.conf 2014-06-08 13:15:48 +0000
+++ conf/mime.conf 2015-11-12 19:55:23 +0000
@@ -9,7 +9,6 @@
9png image/png9png image/png
10ico image/vnd.microsoft.icon10ico image/vnd.microsoft.icon
1111
12#swf application/x-shockwave-flash
13mp3 audio/mpeg12mp3 audio/mpeg
14ogg audio/ogg13ogg audio/ogg
15wav audio/wav14wav audio/wav
@@ -66,3 +65,7 @@
66#xml text/xml65#xml text/xml
67#csv text/csv66#csv text/csv
6867
68# Also flash may be able to execute arbitrary scripts in the website's
69# context
70#swf application/x-shockwave-flash
71
6972
=== modified file 'conf/mysql.conf.php.example'
--- conf/mysql.conf.php.example 2014-06-08 13:04:43 +0000
+++ conf/mysql.conf.php.example 2015-11-12 19:55:23 +0000
@@ -56,7 +56,7 @@
56 * of the user. If the result table is empty or contains more than one56 * of the user. If the result table is empty or contains more than one
57 * row, access will be denied.57 * row, access will be denied.
58 *58 *
59 * The plugin accesses the password as 'pass' so a alias might be necessary.59 * The plugin accesses the password as 'pass' so an alias might be necessary.
60 *60 *
61 * Following patters will be replaced:61 * Following patters will be replaced:
62 * %{user} user name62 * %{user} user name
@@ -107,10 +107,10 @@
107/* This statement should return a table containing all user login names107/* This statement should return a table containing all user login names
108 * that meet certain filter criteria. The filter expressions will be added108 * that meet certain filter criteria. The filter expressions will be added
109 * case dependend by the plugin. At the end a sort expression will be added.109 * case dependend by the plugin. At the end a sort expression will be added.
110 * Important is that this list contains no double entries fo a user. Each110 * Important is that this list contains no double entries for a user. Each
111 * user name is only allowed once in the table.111 * user name is only allowed once in the table.
112 *112 *
113 * The login name will be accessed as 'user' to a alias might be neseccary.113 * The login name will be accessed as 'user' to an alias might be neseccary.
114 * No patterns will be replaced in this statement but following patters114 * No patterns will be replaced in this statement but following patters
115 * will be replaced in the filter expressions:115 * will be replaced in the filter expressions:
116 * %{user} in FilterLogin user's login name116 * %{user} in FilterLogin user's login name
@@ -174,7 +174,7 @@
174 WHERE gid='%{gid}'";174 WHERE gid='%{gid}'";
175175
176/* This statement should return the database index of a given user name.176/* This statement should return the database index of a given user name.
177 * The plugin will access the index with the name 'id' so a alias might be177 * The plugin will access the index with the name 'id' so an alias might be
178 * necessary.178 * necessary.
179 * following patters will be replaced:179 * following patters will be replaced:
180 * %{user} user name180 * %{user} user name
@@ -240,7 +240,7 @@
240 AND gid='%{gid}'";240 AND gid='%{gid}'";
241241
242/* This statement should return the database index of a given group name.242/* This statement should return the database index of a given group name.
243 * The plugin will access the index with the name 'id' so a alias might243 * The plugin will access the index with the name 'id' so an alias might
244 * be necessary.244 * be necessary.
245 *245 *
246 * Following patters will be replaced:246 * Following patters will be replaced:
247247
=== modified file 'conf/wordblock.conf'
--- conf/wordblock.conf 2014-06-08 13:04:43 +0000
+++ conf/wordblock.conf 2015-11-12 19:55:23 +0000
@@ -2,16 +2,12 @@
2# patches welcome2# patches welcome
3#3#
4https?:\/\/(\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)4https?:\/\/(\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)
5gay\s*sex5https?:\/\/(\S*?)(bi\s*sex|gay\s*sex|fetish|incest|penis|\brape\b)
6bi\s*sex
7incest
8zoosex6zoosex
9gang\s*bang7gang\s*bang
10facials8facials
11ladyboy9ladyboy
12fetish
13\btits\b10\btits\b
14\brape\b
15bolea\.com11bolea\.com
1652crystal1252crystal
17baida\.org13baida\.org
1814
=== modified file 'doku.php'
--- doku.php 2014-06-08 13:15:48 +0000
+++ doku.php 2015-11-12 19:55:23 +0000
@@ -8,13 +8,18 @@
8 * @global Input $INPUT8 * @global Input $INPUT
9 */9 */
1010
11// update message version11// update message version - always use a string to avoid localized floats!
12$updateVersion = 44;12$updateVersion = "47.1";
1313
14// xdebug_start_profiling();14// xdebug_start_profiling();
1515
16if(!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__).'/');16if(!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__).'/');
1717
18// define all DokuWiki globals here (needed within test requests but also helps to keep track)
19global $ACT, $INPUT, $QUERY, $ID, $REV, $DATE_AT, $IDX,
20 $DATE, $RANGE, $HIGH, $TEXT, $PRE, $SUF, $SUM, $INFO, $JSINFO;
21
22
18if(isset($_SERVER['HTTP_X_DOKUWIKI_DO'])) {23if(isset($_SERVER['HTTP_X_DOKUWIKI_DO'])) {
19 $ACT = trim(strtolower($_SERVER['HTTP_X_DOKUWIKI_DO']));24 $ACT = trim(strtolower($_SERVER['HTTP_X_DOKUWIKI_DO']));
20} elseif(!empty($_REQUEST['idx'])) {25} elseif(!empty($_REQUEST['idx'])) {
@@ -29,7 +34,6 @@
29 Header('Location: /maintenance-search.php');34 Header('Location: /maintenance-search.php');
30 exit;35 exit;
31}36}
32
33// load and initialize the core system37// load and initialize the core system
34require_once(DOKU_INC.'inc/init.php');38require_once(DOKU_INC.'inc/init.php');
3539
@@ -39,6 +43,7 @@
39$ID = getID();43$ID = getID();
4044
41$REV = $INPUT->int('rev');45$REV = $INPUT->int('rev');
46$DATE_AT = $INPUT->str('at');
42$IDX = $INPUT->str('idx');47$IDX = $INPUT->str('idx');
43$DATE = $INPUT->int('date');48$DATE = $INPUT->int('date');
44$RANGE = $INPUT->str('range');49$RANGE = $INPUT->str('range');
@@ -52,7 +57,41 @@
52$SUF = cleanText($INPUT->post->str('suffix'));57$SUF = cleanText($INPUT->post->str('suffix'));
53$SUM = $INPUT->post->str('summary');58$SUM = $INPUT->post->str('summary');
5459
55//make info about the selected page available60
61//parse DATE_AT
62if($DATE_AT) {
63 $date_parse = strtotime($DATE_AT);
64 if($date_parse) {
65 $DATE_AT = $date_parse;
66 } else { // check for UNIX Timestamp
67 $date_parse = @date('Ymd',$DATE_AT);
68 if(!$date_parse || $date_parse === '19700101') {
69 msg(sprintf($lang['unable_to_parse_date'], $DATE_AT));
70 $DATE_AT = null;
71 }
72 }
73}
74
75//check for existing $REV related to $DATE_AT
76if($DATE_AT) {
77 $pagelog = new PageChangeLog($ID);
78 $rev_t = $pagelog->getLastRevisionAt($DATE_AT);
79 if($rev_t === '') { //current revision
80 $REV = null;
81 $DATE_AT = null;
82 } else if ($rev_t === false) { //page did not exist
83 $rev_n = $pagelog->getRelativeRevision($DATE_AT,+1);
84 msg(sprintf($lang['page_nonexist_rev'],
85 strftime($conf['dformat'],$DATE_AT),
86 wl($ID, array('rev' => $rev_n)),
87 strftime($conf['dformat'],$rev_n)));
88 $REV = $DATE_AT; //will result in a page not exists message
89 } else {
90 $REV = $rev_t;
91 }
92}
93
94//make infos about the selected page available
56$INFO = pageinfo();95$INFO = pageinfo();
5796
58//export minimal info to JS, plugins can add more97//export minimal info to JS, plugins can add more
5998
=== modified file 'feed.php'
--- feed.php 2014-06-08 13:04:43 +0000
+++ feed.php 2015-11-12 19:55:23 +0000
@@ -127,6 +127,8 @@
127 'items' => array('int', 'num', $conf['recent']),127 'items' => array('int', 'num', $conf['recent']),
128 // Boolean, only used in rc mode128 // Boolean, only used in rc mode
129 'show_minor' => array('bool', 'minor', false),129 'show_minor' => array('bool', 'minor', false),
130 // String, only used in list mode
131 'sort' => array('str', 'sort', 'natural'),
130 // String, only used in search mode132 // String, only used in search mode
131 'search_query' => array('str', 'q', null),133 'search_query' => array('str', 'q', null),
132 // One of: pages, media, both134 // One of: pages, media, both
@@ -138,6 +140,7 @@
138140
139 $opt['items'] = max(0, (int) $opt['items']);141 $opt['items'] = max(0, (int) $opt['items']);
140 $opt['show_minor'] = (bool) $opt['show_minor'];142 $opt['show_minor'] = (bool) $opt['show_minor'];
143 $opt['sort'] = valid_input_set('sort', array('default' => 'natural', 'date'), $opt);
141144
142 $opt['guardmail'] = ($conf['mailguard'] != '' && $conf['mailguard'] != 'none');145 $opt['guardmail'] = ($conf['mailguard'] != '' && $conf['mailguard'] != 'none');
143146
@@ -215,7 +218,7 @@
215 $date = $ditem['date'];218 $date = $ditem['date'];
216 } elseif ($ditem['media']) {219 } elseif ($ditem['media']) {
217 $date = @filemtime(mediaFN($id));220 $date = @filemtime(mediaFN($id));
218 } elseif (@file_exists(wikiFN($id))) {221 } elseif (file_exists(wikiFN($id))) {
219 $date = @filemtime(wikiFN($id));222 $date = @filemtime(wikiFN($id));
220 } elseif($meta['date']['modified']) {223 } elseif($meta['date']['modified']) {
221 $date = $meta['date']['modified'];224 $date = $meta['date']['modified'];
@@ -303,7 +306,7 @@
303 $src_r = '';306 $src_r = '';
304 $src_l = '';307 $src_l = '';
305308
306 if($size = media_image_preview_size($id, false, new JpegMeta(mediaFN($id)), 300)) {309 if($size = media_image_preview_size($id, '', new JpegMeta(mediaFN($id)), 300)) {
307 $more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));310 $more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));
308 $src_r = ml($id, $more, true, '&amp;', true);311 $src_r = ml($id, $more, true, '&amp;', true);
309 }312 }
@@ -352,7 +355,7 @@
352 break;355 break;
353 case 'html':356 case 'html':
354 if($ditem['media']) {357 if($ditem['media']) {
355 if($size = media_image_preview_size($id, false, new JpegMeta(mediaFN($id)))) {358 if($size = media_image_preview_size($id, '', new JpegMeta(mediaFN($id)))) {
356 $more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));359 $more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));
357 $src = ml($id, $more, true, '&amp;', true);360 $src = ml($id, $more, true, '&amp;', true);
358 $content = '<img src="'.$src.'" alt="'.$id.'" />';361 $content = '<img src="'.$src.'" alt="'.$id.'" />';
@@ -383,7 +386,7 @@
383 case 'abstract':386 case 'abstract':
384 default:387 default:
385 if($ditem['media']) {388 if($ditem['media']) {
386 if($size = media_image_preview_size($id, false, new JpegMeta(mediaFN($id)))) {389 if($size = media_image_preview_size($id, '', new JpegMeta(mediaFN($id)))) {
387 $more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));390 $more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));
388 $src = ml($id, $more, true, '&amp;', true);391 $src = ml($id, $more, true, '&amp;', true);
389 $content = '<img src="'.$src.'" alt="'.$id.'" />';392 $content = '<img src="'.$src.'" alt="'.$id.'" />';
@@ -405,6 +408,7 @@
405 if($userInfo) {408 if($userInfo) {
406 switch($conf['showuseras']) {409 switch($conf['showuseras']) {
407 case 'username':410 case 'username':
411 case 'username_link':
408 $item->author = $userInfo['name'];412 $item->author = $userInfo['name'];
409 break;413 break;
410 default:414 default:
@@ -479,7 +483,7 @@
479 global $conf;483 global $conf;
480484
481 $ns = ':'.cleanID($opt['namespace']);485 $ns = ':'.cleanID($opt['namespace']);
482 $ns = str_replace(':', '/', $ns);486 $ns = utf8_encodeFN(str_replace(':', '/', $ns));
483487
484 $data = array();488 $data = array();
485 $search_opts = array(489 $search_opts = array(
@@ -487,7 +491,7 @@
487 'pagesonly' => true,491 'pagesonly' => true,
488 'listfiles' => true492 'listfiles' => true
489 );493 );
490 search($data, $conf['datadir'], 'search_universal', $search_opts, $ns);494 search($data, $conf['datadir'], 'search_universal', $search_opts, $ns, $lvl = 1, $opt['sort']);
491495
492 return $data;496 return $data;
493}497}
494498
=== modified file 'inc/DifferenceEngine.php'
--- inc/DifferenceEngine.php 2014-06-08 13:04:43 +0000
+++ inc/DifferenceEngine.php 2015-11-12 19:55:23 +0000
@@ -14,6 +14,9 @@
14 var $orig;14 var $orig;
15 var $closing;15 var $closing;
1616
17 /**
18 * @return _DiffOp
19 */
17 function reverse() {20 function reverse() {
18 trigger_error("pure virtual", E_USER_ERROR);21 trigger_error("pure virtual", E_USER_ERROR);
19 }22 }
@@ -104,6 +107,21 @@
104 */107 */
105class _DiffEngine {108class _DiffEngine {
106109
110 var $xchanged = array();
111 var $ychanged = array();
112 var $xv = array();
113 var $yv = array();
114 var $xind = array();
115 var $yind = array();
116 var $seq;
117 var $in_seq;
118 var $lcs;
119
120 /**
121 * @param array $from_lines
122 * @param array $to_lines
123 * @return _DiffOp[]
124 */
107 function diff($from_lines, $to_lines) {125 function diff($from_lines, $to_lines) {
108 $n_from = count($from_lines);126 $n_from = count($from_lines);
109 $n_to = count($to_lines);127 $n_to = count($to_lines);
@@ -495,9 +513,9 @@
495 * Constructor.513 * Constructor.
496 * Computes diff between sequences of strings.514 * Computes diff between sequences of strings.
497 *515 *
498 * @param $from_lines array An array of strings.516 * @param array $from_lines An array of strings.
499 * (Typically these are lines from a file.)517 * (Typically these are lines from a file.)
500 * @param $to_lines array An array of strings.518 * @param array $to_lines An array of strings.
501 */519 */
502 function __construct($from_lines, $to_lines) {520 function __construct($from_lines, $to_lines) {
503 $eng = new _DiffEngine;521 $eng = new _DiffEngine;
@@ -512,8 +530,9 @@
512 *530 *
513 * $diff = new Diff($lines1, $lines2);531 * $diff = new Diff($lines1, $lines2);
514 * $rev = $diff->reverse();532 * $rev = $diff->reverse();
515 * @return object A Diff object representing the inverse of the533 *
516 * original diff.534 * @return Diff A Diff object representing the inverse of the
535 * original diff.
517 */536 */
518 function reverse() {537 function reverse() {
519 $rev = $this;538 $rev = $this;
@@ -631,19 +650,19 @@
631 * case-insensitve diffs, or diffs which ignore650 * case-insensitve diffs, or diffs which ignore
632 * changes in white-space.651 * changes in white-space.
633 *652 *
634 * @param $from_lines array An array of strings.653 * @param string[] $from_lines An array of strings.
635 * (Typically these are lines from a file.)654 * (Typically these are lines from a file.)
636 *655 *
637 * @param $to_lines array An array of strings.656 * @param string[] $to_lines An array of strings.
638 *657 *
639 * @param $mapped_from_lines array This array should658 * @param string[] $mapped_from_lines This array should
640 * have the same size number of elements as $from_lines.659 * have the same size number of elements as $from_lines.
641 * The elements in $mapped_from_lines and660 * The elements in $mapped_from_lines and
642 * $mapped_to_lines are what is actually compared661 * $mapped_to_lines are what is actually compared
643 * when computing the diff.662 * when computing the diff.
644 *663 *
645 * @param $mapped_to_lines array This array should664 * @param string[] $mapped_to_lines This array should
646 * have the same number of elements as $to_lines.665 * have the same number of elements as $to_lines.
647 */666 */
648 function __construct($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) {667 function __construct($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) {
649668
@@ -697,12 +716,13 @@
697 /**716 /**
698 * Format a diff.717 * Format a diff.
699 *718 *
700 * @param $diff object A Diff object.719 * @param Diff $diff A Diff object.
701 * @return string The formatted output.720 * @return string The formatted output.
702 */721 */
703 function format($diff) {722 function format($diff) {
704723
705 $xi = $yi = 1;724 $xi = $yi = 1;
725 $x0 = $y0 = 0;
706 $block = false;726 $block = false;
707 $context = array();727 $context = array();
708728
@@ -752,6 +772,13 @@
752 return $this->_end_diff();772 return $this->_end_diff();
753 }773 }
754774
775 /**
776 * @param int $xbeg
777 * @param int $xlen
778 * @param int $ybeg
779 * @param int $ylen
780 * @param array $edits
781 */
755 function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) {782 function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) {
756 $this->_start_block($this->_block_header($xbeg, $xlen, $ybeg, $ylen));783 $this->_start_block($this->_block_header($xbeg, $xlen, $ybeg, $ylen));
757 foreach ($edits as $edit) {784 foreach ($edits as $edit) {
@@ -779,6 +806,13 @@
779 return $val;806 return $val;
780 }807 }
781808
809 /**
810 * @param int $xbeg
811 * @param int $xlen
812 * @param int $ybeg
813 * @param int $ylen
814 * @return string
815 */
782 function _block_header($xbeg, $xlen, $ybeg, $ylen) {816 function _block_header($xbeg, $xlen, $ybeg, $ylen) {
783 if ($xlen > 1)817 if ($xlen > 1)
784 $xbeg .= "," . ($xbeg + $xlen - 1);818 $xbeg .= "," . ($xbeg + $xlen - 1);
@@ -788,6 +822,9 @@
788 return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;822 return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
789 }823 }
790824
825 /**
826 * @param string $header
827 */
791 function _start_block($header) {828 function _start_block($header) {
792 echo $header;829 echo $header;
793 }830 }
@@ -896,6 +933,9 @@
896 $this->_tag = $new_tag;933 $this->_tag = $new_tag;
897 }934 }
898935
936 /**
937 * @param string $new_tag
938 */
899 function _flushLine($new_tag) {939 function _flushLine($new_tag) {
900 $this->_flushGroup($new_tag);940 $this->_flushGroup($new_tag);
901 if ($this->_line != '')941 if ($this->_line != '')
@@ -1055,6 +1095,10 @@
1055 $this->trailing_context_lines = 2;1095 $this->trailing_context_lines = 2;
1056 }1096 }
10571097
1098 /**
1099 * @param Diff $diff
1100 * @return string
1101 */
1058 function format($diff) {1102 function format($diff) {
1059 // Preserve whitespaces by converting some to non-breaking spaces.1103 // Preserve whitespaces by converting some to non-breaking spaces.
1060 // Do not convert all of them to allow word-wrap.1104 // Do not convert all of them to allow word-wrap.
@@ -1165,6 +1209,10 @@
1165 $this->trailing_context_lines = 2;1209 $this->trailing_context_lines = 2;
1166 }1210 }
11671211
1212 /**
1213 * @param Diff $diff
1214 * @return string
1215 */
1168 function format($diff) {1216 function format($diff) {
1169 // Preserve whitespaces by converting some to non-breaking spaces.1217 // Preserve whitespaces by converting some to non-breaking spaces.
1170 // Do not convert all of them to allow word-wrap.1218 // Do not convert all of them to allow word-wrap.
11711219
=== added directory 'inc/Form'
=== added file 'inc/Form/ButtonElement.php'
--- inc/Form/ButtonElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/ButtonElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,34 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class ButtonElement
6 *
7 * Represents a simple button
8 *
9 * @package dokuwiki\Form
10 */
11class ButtonElement extends Element {
12
13 /** @var string HTML content */
14 protected $content = '';
15
16 /**
17 * @param string $name
18 * @param string $content HTML content of the button. You have to escape it yourself.
19 */
20 function __construct($name, $content = '') {
21 parent::__construct('button', array('name' => $name, 'value' => 1));
22 $this->content = $content;
23 }
24
25 /**
26 * The HTML representation of this element
27 *
28 * @return string
29 */
30 public function toHTML() {
31 return '<button ' . buildAttributes($this->attrs()) . '>'.$this->content.'</button>';
32 }
33
34}
035
=== added file 'inc/Form/CheckableElement.php'
--- inc/Form/CheckableElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/CheckableElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,62 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class CheckableElement
6 *
7 * For Radio- and Checkboxes
8 *
9 * @package DokuForm
10 */
11class CheckableElement extends InputElement {
12
13 /**
14 * @param string $type The type of this element
15 * @param string $name The name of this form element
16 * @param string $label The label text for this element
17 */
18 public function __construct($type, $name, $label) {
19 parent::__construct($type, $name, $label);
20 // default value is 1
21 $this->attr('value', 1);
22 }
23
24 /**
25 * Handles the useInput flag and sets the checked attribute accordingly
26 */
27 protected function prefillInput() {
28 global $INPUT;
29 list($name, $key) = $this->getInputName();
30 $myvalue = $this->val();
31
32 if(!$INPUT->has($name)) return;
33
34 if($key === null) {
35 // no key - single value
36 $value = $INPUT->str($name);
37 if($value == $myvalue) {
38 $this->attr('checked', 'checked');
39 } else {
40 $this->rmattr('checked');
41 }
42 } else {
43 // we have an array, there might be several values in it
44 $input = $INPUT->arr($name);
45 if(isset($input[$key])) {
46 $this->rmattr('checked');
47
48 // values seem to be in another sub array
49 if(is_array($input[$key])) {
50 $input = $input[$key];
51 }
52
53 foreach($input as $value) {
54 if($value == $myvalue) {
55 $this->attr('checked', 'checked');
56 }
57 }
58 }
59 }
60 }
61
62}
063
=== added file 'inc/Form/Element.php'
--- inc/Form/Element.php 1970-01-01 00:00:00 +0000
+++ inc/Form/Element.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,151 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class Element
6 *
7 * The basic building block of a form
8 *
9 * @package dokuwiki\Form
10 */
11abstract class Element {
12
13 /**
14 * @var array the attributes of this element
15 */
16 protected $attributes = array();
17
18 /**
19 * @var string The type of this element
20 */
21 protected $type;
22
23 /**
24 * @param string $type The type of this element
25 * @param array $attributes
26 */
27 public function __construct($type, $attributes = array()) {
28 $this->type = $type;
29 $this->attributes = $attributes;
30 }
31
32 /**
33 * Type of this element
34 *
35 * @return string
36 */
37 public function getType() {
38 return $this->type;
39 }
40
41 /**
42 * Gets or sets an attribute
43 *
44 * When no $value is given, the current content of the attribute is returned.
45 * An empty string is returned for unset attributes.
46 *
47 * When a $value is given, the content is set to that value and the Element
48 * itself is returned for easy chaining
49 *
50 * @param string $name Name of the attribute to access
51 * @param null|string $value New value to set
52 * @return string|$this
53 */
54 public function attr($name, $value = null) {
55 // set
56 if($value !== null) {
57 $this->attributes[$name] = $value;
58 return $this;
59 }
60
61 // get
62 if(isset($this->attributes[$name])) {
63 return $this->attributes[$name];
64 } else {
65 return '';
66 }
67 }
68
69 /**
70 * Removes the given attribute if it exists
71 *
72 * @param $name
73 * @return $this
74 */
75 public function rmattr($name) {
76 if(isset($this->attributes[$name])) {
77 unset($this->attributes[$name]);
78 }
79 return $this;
80 }
81
82 /**
83 * Gets or adds a all given attributes at once
84 *
85 * @param array|null $attributes
86 * @return array|$this
87 */
88 public function attrs($attributes = null) {
89 // set
90 if($attributes) {
91 foreach((array) $attributes as $key => $val) {
92 $this->attr($key, $val);
93 }
94 return $this;
95 }
96 // get
97 return $this->attributes;
98 }
99
100 /**
101 * Adds a class to the class attribute
102 *
103 * This is the preferred method of setting the element's class
104 *
105 * @param string $class the new class to add
106 * @return $this
107 */
108 public function addClass($class) {
109 $classes = explode(' ', $this->attr('class'));
110 $classes[] = $class;
111 $classes = array_unique($classes);
112 $classes = array_filter($classes);
113 $this->attr('class', join(' ', $classes));
114 return $this;
115 }
116
117 /**
118 * Get or set the element's ID
119 *
120 * This is the preferred way of setting the element's ID
121 *
122 * @param null|string $id
123 * @return string|$this
124 */
125 public function id($id = null) {
126 if(strpos($id, '__') === false) {
127 throw new \InvalidArgumentException('IDs in DokuWiki have to contain two subsequent underscores');
128 }
129
130 return $this->attr('id', $id);
131 }
132
133 /**
134 * Get or set the element's value
135 *
136 * This is the preferred way of setting the element's value
137 *
138 * @param null|string $value
139 * @return string|$this
140 */
141 public function val($value = null) {
142 return $this->attr('value', $value);
143 }
144
145 /**
146 * The HTML representation of this element
147 *
148 * @return string
149 */
150 abstract public function toHTML();
151}
0152
=== added file 'inc/Form/FieldsetCloseElement.php'
--- inc/Form/FieldsetCloseElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/FieldsetCloseElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,30 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class FieldsetCloseElement
6 *
7 * Closes an open Fieldset
8 *
9 * @package dokuwiki\Form
10 */
11class FieldsetCloseElement extends TagCloseElement {
12
13 /**
14 * @param array $attributes
15 */
16 public function __construct($attributes = array()) {
17 parent::__construct('', $attributes);
18 $this->type = 'fieldsetclose';
19 }
20
21
22 /**
23 * The HTML representation of this element
24 *
25 * @return string
26 */
27 public function toHTML() {
28 return '</fieldset>';
29 }
30}
031
=== added file 'inc/Form/FieldsetOpenElement.php'
--- inc/Form/FieldsetOpenElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/FieldsetOpenElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,36 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class FieldsetOpenElement
6 *
7 * Opens a Fieldset with an optional legend
8 *
9 * @package dokuwiki\Form
10 */
11class FieldsetOpenElement extends TagOpenElement {
12
13 /**
14 * @param string $legend
15 * @param array $attributes
16 */
17 public function __construct($legend='', $attributes = array()) {
18 // this is a bit messy and we just do it for the nicer class hierarchy
19 // the parent would expect the tag in $value but we're storing the
20 // legend there, so we have to set the type manually
21 parent::__construct($legend, $attributes);
22 $this->type = 'fieldsetopen';
23 }
24
25 /**
26 * The HTML representation of this element
27 *
28 * @return string
29 */
30 public function toHTML() {
31 $html = '<fieldset '.buildAttributes($this->attrs()).'>';
32 $legend = $this->val();
33 if($legend) $html .= DOKU_LF.'<legend>'.hsc($legend).'</legend>';
34 return $html;
35 }
36}
037
=== added file 'inc/Form/Form.php'
--- inc/Form/Form.php 1970-01-01 00:00:00 +0000
+++ inc/Form/Form.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,426 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class Form
6 *
7 * Represents the whole Form. This is what you work on, and add Elements to
8 *
9 * @package dokuwiki\Form
10 */
11class Form extends Element {
12
13 /**
14 * @var array name value pairs for hidden values
15 */
16 protected $hidden = array();
17
18 /**
19 * @var Element[] the elements of the form
20 */
21 protected $elements = array();
22
23 /**
24 * Creates a new, empty form with some default attributes
25 *
26 * @param array $attributes
27 */
28 public function __construct($attributes = array()) {
29 global $ID;
30
31 parent::__construct('form', $attributes);
32
33 // use the current URL as default action
34 if(!$this->attr('action')) {
35 $get = $_GET;
36 if(isset($get['id'])) unset($get['id']);
37 $self = wl($ID, $get, false, '&'); //attributes are escaped later
38 $this->attr('action', $self);
39 }
40
41 // post is default
42 if(!$this->attr('method')) {
43 $this->attr('method', 'post');
44 }
45
46 // we like UTF-8
47 if(!$this->attr('accept-charset')) {
48 $this->attr('accept-charset', 'utf-8');
49 }
50
51 // add the security token by default
52 $this->setHiddenField('sectok', getSecurityToken());
53
54 // identify this as a new form based form in HTML
55 $this->addClass('doku_form');
56 }
57
58 /**
59 * Sets a hidden field
60 *
61 * @param $name
62 * @param $value
63 * @return $this
64 */
65 public function setHiddenField($name, $value) {
66 $this->hidden[$name] = $value;
67 return $this;
68 }
69
70 #region element query function
71
72 /**
73 * Returns the numbers of elements in the form
74 *
75 * @return int
76 */
77 public function elementCount() {
78 return count($this->elements);
79 }
80
81 /**
82 * Returns a reference to the element at a position.
83 * A position out-of-bounds will return either the
84 * first (underflow) or last (overflow) element.
85 *
86 * @param $pos
87 * @return Element
88 */
89 public function getElementAt($pos) {
90 if($pos < 0) $pos = count($this->elements) + $pos;
91 if($pos < 0) $pos = 0;
92 if($pos >= count($this->elements)) $pos = count($this->elements) - 1;
93 return $this->elements[$pos];
94 }
95
96 /**
97 * Gets the position of the first of a type of element
98 *
99 * @param string $type Element type to look for.
100 * @param int $offset search from this position onward
101 * @return false|int position of element if found, otherwise false
102 */
103 public function findPositionByType($type, $offset = 0) {
104 $len = $this->elementCount();
105 for($pos = $offset; $pos < $len; $pos++) {
106 if($this->elements[$pos]->getType() == $type) {
107 return $pos;
108 }
109 }
110 return false;
111 }
112
113 /**
114 * Gets the position of the first element matching the attribute
115 *
116 * @param string $name Name of the attribute
117 * @param string $value Value the attribute should have
118 * @param int $offset search from this position onward
119 * @return false|int position of element if found, otherwise false
120 */
121 public function findPositionByAttribute($name, $value, $offset = 0) {
122 $len = $this->elementCount();
123 for($pos = $offset; $pos < $len; $pos++) {
124 if($this->elements[$pos]->attr($name) == $value) {
125 return $pos;
126 }
127 }
128 return false;
129 }
130
131 #endregion
132
133 #region Element positioning functions
134
135 /**
136 * Adds or inserts an element to the form
137 *
138 * @param Element $element
139 * @param int $pos 0-based position in the form, -1 for at the end
140 * @return Element
141 */
142 public function addElement(Element $element, $pos = -1) {
143 if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
144 if($pos < 0) {
145 $this->elements[] = $element;
146 } else {
147 array_splice($this->elements, $pos, 0, array($element));
148 }
149 return $element;
150 }
151
152 /**
153 * Replaces an existing element with a new one
154 *
155 * @param Element $element the new element
156 * @param $pos 0-based position of the element to replace
157 */
158 public function replaceElement(Element $element, $pos) {
159 if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
160 array_splice($this->elements, $pos, 1, array($element));
161 }
162
163 /**
164 * Remove an element from the form completely
165 *
166 * @param $pos 0-based position of the element to remove
167 */
168 public function removeElement($pos) {
169 array_splice($this->elements, $pos, 1);
170 }
171
172 #endregion
173
174 #region Element adding functions
175
176 /**
177 * Adds a text input field
178 *
179 * @param $name
180 * @param $label
181 * @param int $pos
182 * @return InputElement
183 */
184 public function addTextInput($name, $label = '', $pos = -1) {
185 return $this->addElement(new InputElement('text', $name, $label), $pos);
186 }
187
188 /**
189 * Adds a password input field
190 *
191 * @param $name
192 * @param $label
193 * @param int $pos
194 * @return InputElement
195 */
196 public function addPasswordInput($name, $label = '', $pos = -1) {
197 return $this->addElement(new InputElement('password', $name, $label), $pos);
198 }
199
200 /**
201 * Adds a radio button field
202 *
203 * @param $name
204 * @param $label
205 * @param int $pos
206 * @return CheckableElement
207 */
208 public function addRadioButton($name, $label = '', $pos = -1) {
209 return $this->addElement(new CheckableElement('radio', $name, $label), $pos);
210 }
211
212 /**
213 * Adds a checkbox field
214 *
215 * @param $name
216 * @param $label
217 * @param int $pos
218 * @return CheckableElement
219 */
220 public function addCheckbox($name, $label = '', $pos = -1) {
221 return $this->addElement(new CheckableElement('checkbox', $name, $label), $pos);
222 }
223
224 /**
225 * Adds a textarea field
226 *
227 * @param $name
228 * @param $label
229 * @param int $pos
230 * @return TextareaElement
231 */
232 public function addTextarea($name, $label = '', $pos = -1) {
233 return $this->addElement(new TextareaElement($name, $label), $pos);
234 }
235
236 /**
237 * Adds a simple button, escapes the content for you
238 *
239 * @param string $name
240 * @param string $content
241 * @param int $pos
242 * @return Element
243 */
244 public function addButton($name, $content, $pos = -1) {
245 return $this->addElement(new ButtonElement($name, hsc($content)), $pos);
246 }
247
248 /**
249 * Adds a simple button, allows HTML for content
250 *
251 * @param string $name
252 * @param string $html
253 * @param int $pos
254 * @return Element
255 */
256 public function addButtonHTML($name, $html, $pos = -1) {
257 return $this->addElement(new ButtonElement($name, $html), $pos);
258 }
259
260 /**
261 * Adds a label referencing another input element, escapes the label for you
262 *
263 * @param $label
264 * @param string $for
265 * @param int $pos
266 * @return Element
267 */
268 public function addLabel($label, $for='', $pos = -1) {
269 return $this->addLabelHTML(hsc($label), $for, $pos);
270 }
271
272 /**
273 * Adds a label referencing another input element, allows HTML for content
274 *
275 * @param string $content
276 * @param string|Element $for
277 * @param int $pos
278 * @return Element
279 */
280 public function addLabelHTML($content, $for='', $pos = -1) {
281 $element = new LabelElement(hsc($content));
282
283 if(is_a($for, '\dokuwiki\Form\Element')) {
284 /** @var Element $for */
285 $for = $for->id();
286 }
287 $for = (string) $for;
288 if($for !== '') {
289 $element->attr('for', $for);
290 }
291
292 return $this->addElement($element, $pos);
293 }
294
295 /**
296 * Add fixed HTML to the form
297 *
298 * @param $html
299 * @param int $pos
300 * @return HTMLElement
301 */
302 public function addHTML($html, $pos = -1) {
303 return $this->addElement(new HTMLElement($html), $pos);
304 }
305
306 /**
307 * Add a closed HTML tag to the form
308 *
309 * @param $tag
310 * @param int $pos
311 * @return TagElement
312 */
313 public function addTag($tag, $pos = -1) {
314 return $this->addElement(new TagElement($tag), $pos);
315 }
316
317 /**
318 * Add an open HTML tag to the form
319 *
320 * Be sure to close it again!
321 *
322 * @param $tag
323 * @param int $pos
324 * @return TagOpenElement
325 */
326 public function addTagOpen($tag, $pos = -1) {
327 return $this->addElement(new TagOpenElement($tag), $pos);
328 }
329
330 /**
331 * Add a closing HTML tag to the form
332 *
333 * Be sure it had been opened before
334 *
335 * @param $tag
336 * @param int $pos
337 * @return TagCloseElement
338 */
339 public function addTagClose($tag, $pos = -1) {
340 return $this->addElement(new TagCloseElement($tag), $pos);
341 }
342
343 /**
344 * Open a Fieldset
345 *
346 * @param $legend
347 * @param int $pos
348 * @return FieldsetOpenElement
349 */
350 public function addFieldsetOpen($legend = '', $pos = -1) {
351 return $this->addElement(new FieldsetOpenElement($legend), $pos);
352 }
353
354 /**
355 * Close a fieldset
356 *
357 * @param int $pos
358 * @return TagCloseElement
359 */
360 public function addFieldsetClose($pos = -1) {
361 return $this->addElement(new FieldsetCloseElement(), $pos);
362 }
363
364 #endregion
365
366 /**
367 * Adjust the elements so that fieldset open and closes are matching
368 */
369 protected function balanceFieldsets() {
370 $lastclose = 0;
371 $isopen = false;
372 $len = count($this->elements);
373
374 for($pos = 0; $pos < $len; $pos++) {
375 $type = $this->elements[$pos]->getType();
376 if($type == 'fieldsetopen') {
377 if($isopen) {
378 //close previous fieldset
379 $this->addFieldsetClose($pos);
380 $lastclose = $pos + 1;
381 $pos++;
382 $len++;
383 }
384 $isopen = true;
385 } else if($type == 'fieldsetclose') {
386 if(!$isopen) {
387 // make sure there was a fieldsetopen
388 // either right after the last close or at the begining
389 $this->addFieldsetOpen('', $lastclose);
390 $len++;
391 $pos++;
392 }
393 $lastclose = $pos;
394 $isopen = false;
395 }
396 }
397
398 // close open fieldset at the end
399 if($isopen) {
400 $this->addFieldsetClose();
401 }
402 }
403
404 /**
405 * The HTML representation of the whole form
406 *
407 * @return string
408 */
409 public function toHTML() {
410 $this->balanceFieldsets();
411
412 $html = '<form ' . buildAttributes($this->attrs()) . '>' . DOKU_LF;
413
414 foreach($this->hidden as $name => $value) {
415 $html .= '<input type="hidden" name="' . $name . '" value="' . formText($value) . '" />' . DOKU_LF;
416 }
417
418 foreach($this->elements as $element) {
419 $html .= $element->toHTML() . DOKU_LF;
420 }
421
422 $html .= '</form>' . DOKU_LF;
423
424 return $html;
425 }
426}
0427
=== added file 'inc/Form/HTMLElement.php'
--- inc/Form/HTMLElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/HTMLElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,29 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class HTMLElement
6 *
7 * Holds arbitrary HTML that is added as is to the Form
8 *
9 * @package dokuwiki\Form
10 */
11class HTMLElement extends ValueElement {
12
13
14 /**
15 * @param string $html
16 */
17 public function __construct($html) {
18 parent::__construct('html', $html);
19 }
20
21 /**
22 * The HTML representation of this element
23 *
24 * @return string
25 */
26 public function toHTML() {
27 return $this->val();
28 }
29}
030
=== added file 'inc/Form/InputElement.php'
--- inc/Form/InputElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/InputElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,161 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class InputElement
6 *
7 * Base class for all input elements. Uses a wrapping label when label
8 * text is given.
9 *
10 * @todo figure out how to make wrapping or related label configurable
11 * @package dokuwiki\Form
12 */
13class InputElement extends Element {
14 /**
15 * @var LabelElement
16 */
17 protected $label = null;
18
19 /**
20 * @var bool if the element should reflect posted values
21 */
22 protected $useInput = true;
23
24 /**
25 * @param string $type The type of this element
26 * @param string $name The name of this form element
27 * @param string $label The label text for this element (will be autoescaped)
28 */
29 public function __construct($type, $name, $label = '') {
30 parent::__construct($type, array('name' => $name));
31 $this->attr('name', $name);
32 $this->attr('type', $type);
33 if($label) $this->label = new LabelElement($label);
34 }
35
36 /**
37 * Returns the label element if there's one set
38 *
39 * @return LabelElement|null
40 */
41 public function getLabel() {
42 return $this->label;
43 }
44
45 /**
46 * Should the user sent input be used to initialize the input field
47 *
48 * The default is true. Any set values will be overwritten by the INPUT
49 * provided values.
50 *
51 * @param bool $useinput
52 * @return $this
53 */
54 public function useInput($useinput) {
55 $this->useInput = (bool) $useinput;
56 return $this;
57 }
58
59 /**
60 * Get or set the element's ID
61 *
62 * @param null|string $id
63 * @return string|$this
64 */
65 public function id($id = null) {
66 if($this->label) $this->label->attr('for', $id);
67 return parent::id($id);
68 }
69
70 /**
71 * Adds a class to the class attribute
72 *
73 * This is the preferred method of setting the element's class
74 *
75 * @param string $class the new class to add
76 * @return $this
77 */
78 public function addClass($class) {
79 if($this->label) $this->label->addClass($class);
80 return parent::addClass($class);
81 }
82
83 /**
84 * Figures out how to access the value for this field from INPUT data
85 *
86 * The element's name could have been given as a simple string ('foo')
87 * or in array notation ('foo[bar]').
88 *
89 * Note: this function only handles one level of arrays. If your data
90 * is nested deeper, you should call useInput(false) and set the
91 * correct value yourself
92 *
93 * @return array name and array key (null if not an array)
94 */
95 protected function getInputName() {
96 $name = $this->attr('name');
97 parse_str("$name=1", $parsed);
98
99 $name = array_keys($parsed);
100 $name = array_shift($name);
101
102 if(is_array($parsed[$name])) {
103 $key = array_keys($parsed[$name]);
104 $key = array_shift($key);
105 } else {
106 $key = null;
107 }
108
109 return array($name, $key);
110 }
111
112 /**
113 * Handles the useInput flag and set the value attribute accordingly
114 */
115 protected function prefillInput() {
116 global $INPUT;
117
118 list($name, $key) = $this->getInputName();
119 if(!$INPUT->has($name)) return;
120
121 if($key === null) {
122 $value = $INPUT->str($name);
123 } else {
124 $value = $INPUT->arr($name);
125 if(isset($value[$key])) {
126 $value = $value[$key];
127 } else {
128 $value = '';
129 }
130 }
131 if($value !== '') {
132 $this->val($value);
133 }
134 }
135
136 /**
137 * The HTML representation of this element
138 *
139 * @return string
140 */
141 protected function mainElementHTML() {
142 if($this->useInput) $this->prefillInput();
143 return '<input ' . buildAttributes($this->attrs()) . ' />';
144 }
145
146 /**
147 * The HTML representation of this element wrapped in a label
148 *
149 * @return string
150 */
151 public function toHTML() {
152 if($this->label) {
153 return '<label ' . buildAttributes($this->label->attrs()) . '>' . DOKU_LF .
154 '<span>' . hsc($this->label->val()) . '</span>' . DOKU_LF .
155 $this->mainElementHTML() . DOKU_LF .
156 '</label>';
157 } else {
158 return $this->mainElementHTML();
159 }
160 }
161}
0162
=== added file 'inc/Form/LabelElement.php'
--- inc/Form/LabelElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/LabelElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,27 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class Label
6 * @package dokuwiki\Form
7 */
8class LabelElement extends ValueElement {
9
10 /**
11 * Creates a new Label
12 *
13 * @param string $label This is is raw HTML and will not be escaped
14 */
15 public function __construct($label) {
16 parent::__construct('label', $label);
17 }
18
19 /**
20 * The HTML representation of this element
21 *
22 * @return string
23 */
24 public function toHTML() {
25 return '<label ' . buildAttributes($this->attrs()) . '>' . $this->val() . '</label>';
26 }
27}
028
=== added file 'inc/Form/LegacyForm.php'
--- inc/Form/LegacyForm.php 1970-01-01 00:00:00 +0000
+++ inc/Form/LegacyForm.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,181 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class LegacyForm
6 *
7 * Provides a compatibility layer to the old Doku_Form API
8 *
9 * This can be used to work with the modern API on forms provided by old events for
10 * example. When you start new forms, just use Form\Form
11 *
12 * @package dokuwiki\Form
13 */
14class LegacyForm extends Form {
15
16 /**
17 * Creates a new modern form from an old legacy Doku_Form
18 *
19 * @param \Doku_Form $oldform
20 */
21 public function __construct(\Doku_Form $oldform) {
22 parent::__construct($oldform->params);
23
24 $this->hidden = $oldform->_hidden;
25
26 foreach($oldform->_content as $element) {
27 list($ctl, $attr) = $this->parseLegacyAttr($element);
28
29 if(is_array($element)) {
30 switch($ctl['elem']) {
31 case 'wikitext':
32 $this->addTextarea('wikitext')
33 ->attrs($attr)
34 ->id('wiki__text')
35 ->val($ctl['text'])
36 ->addClass($ctl['class']);
37 break;
38 case 'textfield':
39 $this->addTextInput($ctl['name'], $ctl['text'])
40 ->attrs($attr)
41 ->id($ctl['id'])
42 ->addClass($ctl['class']);
43 break;
44 case 'passwordfield':
45 $this->addPasswordInput($ctl['name'], $ctl['text'])
46 ->attrs($attr)
47 ->id($ctl['id'])
48 ->addClass($ctl['class']);
49 break;
50 case 'checkboxfield':
51 $this->addCheckbox($ctl['name'], $ctl['text'])
52 ->attrs($attr)
53 ->id($ctl['id'])
54 ->addClass($ctl['class']);
55 break;
56 case 'radiofield':
57 $this->addRadioButton($ctl['name'], $ctl['text'])
58 ->attrs($attr)
59 ->id($ctl['id'])
60 ->addClass($ctl['class']);
61 break;
62 case 'tag':
63 $this->addTag($ctl['tag'])
64 ->attrs($attr)
65 ->attr('name', $ctl['name'])
66 ->id($ctl['id'])
67 ->addClass($ctl['class']);
68 break;
69 case 'opentag':
70 $this->addTagOpen($ctl['tag'])
71 ->attrs($attr)
72 ->attr('name', $ctl['name'])
73 ->id($ctl['id'])
74 ->addClass($ctl['class']);
75 break;
76 case 'closetag':
77 $this->addTagClose($ctl['tag']);
78 break;
79 case 'openfieldset':
80 $this->addFieldsetOpen($ctl['legend'])
81 ->attrs($attr)
82 ->attr('name', $ctl['name'])
83 ->id($ctl['id'])
84 ->addClass($ctl['class']);
85 break;
86 case 'closefieldset':
87 $this->addFieldsetClose();
88 break;
89 case 'button':
90 case 'field':
91 case 'fieldright':
92 case 'filefield':
93 case 'menufield':
94 case 'listboxfield':
95 throw new \UnexpectedValueException('Unsupported legacy field ' . $ctl['elem']);
96 break;
97 default:
98 throw new \UnexpectedValueException('Unknown legacy field ' . $ctl['elem']);
99
100 }
101 } else {
102 $this->addHTML($element);
103 }
104 }
105
106 }
107
108 /**
109 * Parses out what is the elements attributes and what is control info
110 *
111 * @param array $legacy
112 * @return array
113 */
114 protected function parseLegacyAttr($legacy) {
115 $attributes = array();
116 $control = array();
117
118 foreach($legacy as $key => $val) {
119 if($key{0} == '_') {
120 $control[substr($key, 1)] = $val;
121 } elseif($key == 'name') {
122 $control[$key] = $val;
123 } elseif($key == 'id') {
124 $control[$key] = $val;
125 } else {
126 $attributes[$key] = $val;
127 }
128 }
129
130 return array($control, $attributes);
131 }
132
133 /**
134 * Translates our types to the legacy types
135 *
136 * @param string $type
137 * @return string
138 */
139 protected function legacyType($type) {
140 static $types = array(
141 'text' => 'textfield',
142 'password' => 'passwordfield',
143 'checkbox' => 'checkboxfield',
144 'radio' => 'radiofield',
145 'tagopen' => 'opentag',
146 'tagclose' => 'closetag',
147 'fieldsetopen' => 'openfieldset',
148 'fieldsetclose' => 'closefieldset',
149 );
150 if(isset($types[$type])) return $types[$type];
151 return $type;
152 }
153
154 /**
155 * Creates an old legacy form from this modern form's data
156 *
157 * @return \Doku_Form
158 */
159 public function toLegacy() {
160 $this->balanceFieldsets();
161
162 $legacy = new \Doku_Form($this->attrs());
163 $legacy->_hidden = $this->hidden;
164 foreach($this->elements as $element) {
165 if(is_a($element, 'dokuwiki\Form\HTMLElement')) {
166 $legacy->_content[] = $element->toHTML();
167 } elseif(is_a($element, 'dokuwiki\Form\InputElement')) {
168 /** @var InputElement $element */
169 $data = $element->attrs();
170 $data['_elem'] = $this->legacyType($element->getType());
171 $label = $element->getLabel();
172 if($label) {
173 $data['_class'] = $label->attr('class');
174 }
175 $legacy->_content[] = $data;
176 }
177 }
178
179 return $legacy;
180 }
181}
0182
=== added file 'inc/Form/TagCloseElement.php'
--- inc/Form/TagCloseElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/TagCloseElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,76 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class TagCloseElement
6 *
7 * Creates an HTML close tag. You have to make sure it has been opened
8 * before or this will produce invalid HTML
9 *
10 * @package dokuwiki\Form
11 */
12class TagCloseElement extends ValueElement {
13
14 /**
15 * @param string $tag
16 * @param array $attributes
17 */
18 public function __construct($tag, $attributes = array()) {
19 parent::__construct('tagclose', $tag, $attributes);
20 }
21
22 /**
23 * do not call this
24 *
25 * @param $class
26 * @return void
27 * @throws \BadMethodCallException
28 */
29 public function addClass($class) {
30 throw new \BadMethodCallException('You can\t add classes to closing tag');
31 }
32
33 /**
34 * do not call this
35 *
36 * @param $id
37 * @return void
38 * @throws \BadMethodCallException
39 */
40 public function id($id = null) {
41 throw new \BadMethodCallException('You can\t add ID to closing tag');
42 }
43
44 /**
45 * do not call this
46 *
47 * @param $name
48 * @param $value
49 * @return void
50 * @throws \BadMethodCallException
51 */
52 public function attr($name, $value = null) {
53 throw new \BadMethodCallException('You can\t add attributes to closing tag');
54 }
55
56 /**
57 * do not call this
58 *
59 * @param $attributes
60 * @return void
61 * @throws \BadMethodCallException
62 */
63 public function attrs($attributes = null) {
64 throw new \BadMethodCallException('You can\t add attributes to closing tag');
65 }
66
67 /**
68 * The HTML representation of this element
69 *
70 * @return string
71 */
72 public function toHTML() {
73 return '</'.$this->val().'>';
74 }
75
76}
077
=== added file 'inc/Form/TagElement.php'
--- inc/Form/TagElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/TagElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,29 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class TagElement
6 *
7 * Creates a self closing HTML tag
8 *
9 * @package dokuwiki\Form
10 */
11class TagElement extends ValueElement {
12
13 /**
14 * @param string $tag
15 * @param array $attributes
16 */
17 public function __construct($tag, $attributes = array()) {
18 parent::__construct('tag', $tag, $attributes);
19 }
20
21 /**
22 * The HTML representation of this element
23 *
24 * @return string
25 */
26 public function toHTML() {
27 return '<'.$this->val().' '.buildAttributes($this->attrs()).' />';
28 }
29}
030
=== added file 'inc/Form/TagOpenElement.php'
--- inc/Form/TagOpenElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/TagOpenElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,30 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class TagOpenElement
6 *
7 * Creates an open HTML tag. You have to make sure you close it
8 * again or this will produce invalid HTML
9 *
10 * @package dokuwiki\Form
11 */
12class TagOpenElement extends ValueElement {
13
14 /**
15 * @param string $tag
16 * @param array $attributes
17 */
18 public function __construct($tag, $attributes = array()) {
19 parent::__construct('tagopen', $tag, $attributes);
20 }
21
22 /**
23 * The HTML representation of this element
24 *
25 * @return string
26 */
27 public function toHTML() {
28 return '<'.$this->val().' '.buildAttributes($this->attrs()).'>';
29 }
30}
031
=== added file 'inc/Form/TextareaElement.php'
--- inc/Form/TextareaElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/TextareaElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,51 @@
1<?php
2namespace dokuwiki\Form;
3
4/**
5 * Class TextareaElement
6 * @package dokuwiki\Form
7 */
8class TextareaElement extends InputElement {
9
10 /**
11 * @var string the actual text within the area
12 */
13 protected $text;
14
15 /**
16 * @param string $name The name of this form element
17 * @param string $label The label text for this element
18 */
19 public function __construct($name, $label) {
20 parent::__construct('textarea', $name, $label);
21 $this->attr('dir', 'auto');
22 }
23
24 /**
25 * Get or set the element's value
26 *
27 * This is the preferred way of setting the element's value
28 *
29 * @param null|string $value
30 * @return string|$this
31 */
32 public function val($value = null) {
33 if($value !== null) {
34 $this->text = $value;
35 return $this;
36 }
37 return $this->text;
38 }
39
40 /**
41 * The HTML representation of this element
42 *
43 * @return string
44 */
45 protected function mainElementHTML() {
46 if($this->useInput) $this->prefillInput();
47 return '<textarea ' . buildAttributes($this->attrs()) . '>' .
48 formText($this->val()) . '</textarea>';
49 }
50
51}
052
=== added file 'inc/Form/ValueElement.php'
--- inc/Form/ValueElement.php 1970-01-01 00:00:00 +0000
+++ inc/Form/ValueElement.php 2015-11-12 19:55:23 +0000
@@ -0,0 +1,45 @@
1<?php
2
3namespace dokuwiki\Form;
4
5/**
6 * Class ValueElement
7 *
8 * Just like an Element but it's value is not part of its attributes
9 *
10 * What the value is (tag name, content, etc) is defined by the actual implementations
11 *
12 * @package dokuwiki\Form
13 */
14abstract class ValueElement extends Element {
15
16 /**
17 * @var string holds the element's value
18 */
19 protected $value = '';
20
21 /**
22 * @param string $type
23 * @param array|string $value
24 * @param array $attributes
25 */
26 public function __construct($type, $value, $attributes = array()) {
27 parent::__construct($type, $attributes);
28 $this->val($value);
29 }
30
31 /**
32 * Get or set the element's value
33 *
34 * @param null|string $value
35 * @return string|$this
36 */
37 public function val($value = null) {
38 if($value !== null) {
39 $this->value = $value;
40 return $this;
41 }
42 return $this->value;
43 }
44
45}
046
=== modified file 'inc/HTTPClient.php'
--- inc/HTTPClient.php 2014-06-08 13:04:43 +0000
+++ inc/HTTPClient.php 2015-11-12 19:55:23 +0000
@@ -35,6 +35,19 @@
35 $this->proxy_pass = conf_decodeString($conf['proxy']['pass']);35 $this->proxy_pass = conf_decodeString($conf['proxy']['pass']);
36 $this->proxy_ssl = $conf['proxy']['ssl'];36 $this->proxy_ssl = $conf['proxy']['ssl'];
37 $this->proxy_except = $conf['proxy']['except'];37 $this->proxy_except = $conf['proxy']['except'];
38
39 // allow enabling debugging via URL parameter (if debugging allowed)
40 if($conf['allowdebug']) {
41 if(
42 isset($_REQUEST['httpdebug']) ||
43 (
44 isset($_SERVER['HTTP_REFERER']) &&
45 strpos($_SERVER['HTTP_REFERER'], 'httpdebug') !== false
46 )
47 ) {
48 $this->debug = true;
49 }
50 }
38 }51 }
3952
4053
@@ -44,6 +57,12 @@
44 * @triggers HTTPCLIENT_REQUEST_SEND57 * @triggers HTTPCLIENT_REQUEST_SEND
45 * @author Andreas Gohr <andi@splitbrain.org>58 * @author Andreas Gohr <andi@splitbrain.org>
46 */59 */
60 /**
61 * @param string $url
62 * @param string|array $data the post data either as array or raw data
63 * @param string $method
64 * @return bool
65 */
47 function sendRequest($url,$data='',$method='GET'){66 function sendRequest($url,$data='',$method='GET'){
48 $httpdata = array('url' => $url,67 $httpdata = array('url' => $url,
49 'data' => $data,68 'data' => $data,
@@ -61,6 +80,9 @@
6180
62}81}
6382
83/**
84 * Class HTTPClientException
85 */
64class HTTPClientException extends Exception { }86class HTTPClientException extends Exception { }
6587
66/**88/**
@@ -88,7 +110,7 @@
88 var $header_regexp; // if set this RE must match against the headers, else abort110 var $header_regexp; // if set this RE must match against the headers, else abort
89 var $headers;111 var $headers;
90 var $debug;112 var $debug;
91 var $start = 0; // for timings113 var $start = 0.0; // for timings
92 var $keep_alive = true; // keep alive rocks114 var $keep_alive = true; // keep alive rocks
93115
94 // don't set these, read on error116 // don't set these, read on error
@@ -150,7 +172,8 @@
150 *172 *
151 * @param string $url The URL to fetch173 * @param string $url The URL to fetch
152 * @param bool $sloppy304 Return body on 304 not modified174 * @param bool $sloppy304 Return body on 304 not modified
153 * @return bool|string response body, false on error175 * @return false|string response body, false on error
176 *
154 * @author Andreas Gohr <andi@splitbrain.org>177 * @author Andreas Gohr <andi@splitbrain.org>
155 */178 */
156 function get($url,$sloppy304=false){179 function get($url,$sloppy304=false){
@@ -171,7 +194,8 @@
171 * @param string $url The URL to fetch194 * @param string $url The URL to fetch
172 * @param array $data Associative array of parameters195 * @param array $data Associative array of parameters
173 * @param bool $sloppy304 Return body on 304 not modified196 * @param bool $sloppy304 Return body on 304 not modified
174 * @return bool|string response body, false on error197 * @return false|string response body, false on error
198 *
175 * @author Andreas Gohr <andi@splitbrain.org>199 * @author Andreas Gohr <andi@splitbrain.org>
176 */200 */
177 function dget($url,$data,$sloppy304=false){201 function dget($url,$data,$sloppy304=false){
@@ -191,7 +215,7 @@
191 *215 *
192 * @param string $url The URL to fetch216 * @param string $url The URL to fetch
193 * @param array $data Associative array of parameters217 * @param array $data Associative array of parameters
194 * @return bool|string response body, false on error218 * @return false|string response body, false on error
195 * @author Andreas Gohr <andi@splitbrain.org>219 * @author Andreas Gohr <andi@splitbrain.org>
196 */220 */
197 function post($url,$data){221 function post($url,$data){
@@ -213,6 +237,7 @@
213 * @param mixed $data - the post data either as array or raw data237 * @param mixed $data - the post data either as array or raw data
214 * @param string $method - HTTP Method usually GET or POST.238 * @param string $method - HTTP Method usually GET or POST.
215 * @return bool - true on success239 * @return bool - true on success
240 *
216 * @author Andreas Goetz <cpuidle@gmx.de>241 * @author Andreas Goetz <cpuidle@gmx.de>
217 * @author Andreas Gohr <andi@splitbrain.org>242 * @author Andreas Gohr <andi@splitbrain.org>
218 */243 */
@@ -249,7 +274,6 @@
249 if (empty($port)) $port = 8080;274 if (empty($port)) $port = 8080;
250 }else{275 }else{
251 $request_url = $path;276 $request_url = $path;
252 $server = $server;
253 if (!isset($port)) $port = ($uri['scheme'] == 'https') ? 443 : 80;277 if (!isset($port)) $port = ($uri['scheme'] == 'https') ? 443 : 80;
254 }278 }
255279
@@ -280,7 +304,6 @@
280 }304 }
281 }305 }
282 $headers['Content-Length'] = strlen($data);306 $headers['Content-Length'] = strlen($data);
283 $rmethod = 'POST';
284 }elseif($method == 'GET'){307 }elseif($method == 'GET'){
285 $data = ''; //no data allowed on GET requests308 $data = ''; //no data allowed on GET requests
286 }309 }
@@ -343,7 +366,7 @@
343366
344 try {367 try {
345 //set non-blocking368 //set non-blocking
346 stream_set_blocking($socket, false);369 stream_set_blocking($socket, 0);
347370
348 // build request371 // build request
349 $request = "$method $request_url HTTP/".$this->http.HTTP_NL;372 $request = "$method $request_url HTTP/".$this->http.HTTP_NL;
@@ -458,7 +481,7 @@
458481
459 if ($chunk_size > 0) {482 if ($chunk_size > 0) {
460 $r_body .= $this->_readData($socket, $chunk_size, 'chunk');483 $r_body .= $this->_readData($socket, $chunk_size, 'chunk');
461 $byte = $this->_readData($socket, 2, 'chunk'); // read trailing \r\n484 $this->_readData($socket, 2, 'chunk'); // read trailing \r\n
462 }485 }
463 } while ($chunk_size && !$abort);486 } while ($chunk_size && !$abort);
464 }elseif(isset($this->resp_headers['content-length']) && !isset($this->resp_headers['transfer-encoding'])){487 }elseif(isset($this->resp_headers['content-length']) && !isset($this->resp_headers['transfer-encoding'])){
@@ -480,7 +503,6 @@
480 $r_body = $this->_readData($socket, $this->max_bodysize, 'response (content-length limited)', true);503 $r_body = $this->_readData($socket, $this->max_bodysize, 'response (content-length limited)', true);
481 }else{504 }else{
482 // read entire socket505 // read entire socket
483 $r_size = 0;
484 while (!feof($socket)) {506 while (!feof($socket)) {
485 $r_body .= $this->_readData($socket, 4096, 'response (unlimited)', true);507 $r_body .= $this->_readData($socket, 4096, 'response (unlimited)', true);
486 }508 }
@@ -509,7 +531,6 @@
509 if (!$this->keep_alive ||531 if (!$this->keep_alive ||
510 (isset($this->resp_headers['connection']) && $this->resp_headers['connection'] == 'Close')) {532 (isset($this->resp_headers['connection']) && $this->resp_headers['connection'] == 'Close')) {
511 // close socket533 // close socket
512 $status = socket_get_status($socket);
513 fclose($socket);534 fclose($socket);
514 unset(self::$connections[$connectionId]);535 unset(self::$connections[$connectionId]);
515 }536 }
@@ -568,10 +589,25 @@
568589
569 $this->_debug('SSL Tunnel Response',$r_headers);590 $this->_debug('SSL Tunnel Response',$r_headers);
570 if(preg_match('/^HTTP\/1\.[01] 200/i',$r_headers)){591 if(preg_match('/^HTTP\/1\.[01] 200/i',$r_headers)){
571 if (stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv3_CLIENT)) {592 // set correct peer name for verification (enabled since PHP 5.6)
572 $requesturl = $requestinfo['path'];593 stream_context_set_option($socket, 'ssl', 'peer_name', $requestinfo['host']);
573 return true;594
574 }595 // because SSLv3 is mostly broken, we try TLS connections here first.
596 // according to https://github.com/splitbrain/dokuwiki/commit/c05ef534 we had problems with certain
597 // setups with this solution before, but we have no usable test for that and TLS should be the more
598 // common crypto by now
599 if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
600 $requesturl = $requestinfo['path'];
601 return true;
602 }
603
604 // if the above failed, this will most probably not work either, but we can try
605 if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv3_CLIENT)) {
606 $requesturl = $requestinfo['path'];
607 return true;
608 }
609
610 throw new HTTPClientException('Failed to set up crypto for secure connection to '.$requestinfo['host'], -151);
575 }611 }
576612
577 throw new HTTPClientException('Failed to establish secure proxy connection', -150);613 throw new HTTPClientException('Failed to establish secure proxy connection', -150);
@@ -584,6 +620,7 @@
584 * @param string $data The data to write620 * @param string $data The data to write
585 * @param string $message Description of what is being read621 * @param string $message Description of what is being read
586 * @throws HTTPClientException622 * @throws HTTPClientException
623 *
587 * @author Tom N Harris <tnharris@whoopdedo.org>624 * @author Tom N Harris <tnharris@whoopdedo.org>
588 */625 */
589 function _sendData($socket, $data, $message) {626 function _sendData($socket, $data, $message) {
@@ -628,6 +665,7 @@
628 * @param bool $ignore_eof End-of-file is not an error if this is set665 * @param bool $ignore_eof End-of-file is not an error if this is set
629 * @throws HTTPClientException666 * @throws HTTPClientException
630 * @return string667 * @return string
668 *
631 * @author Tom N Harris <tnharris@whoopdedo.org>669 * @author Tom N Harris <tnharris@whoopdedo.org>
632 */670 */
633 function _readData($socket, $nbytes, $message, $ignore_eof = false) {671 function _readData($socket, $nbytes, $message, $ignore_eof = false) {
@@ -677,6 +715,7 @@
677 * @param string $message Description of what is being read715 * @param string $message Description of what is being read
678 * @throws HTTPClientException716 * @throws HTTPClientException
679 * @return string717 * @return string
718 *
680 * @author Tom N Harris <tnharris@whoopdedo.org>719 * @author Tom N Harris <tnharris@whoopdedo.org>
681 */720 */
682 function _readLine($socket, $message) {721 function _readLine($socket, $message) {
@@ -711,6 +750,9 @@
711 * Uses _debug_text or _debug_html depending on the SAPI name750 * Uses _debug_text or _debug_html depending on the SAPI name
712 *751 *
713 * @author Andreas Gohr <andi@splitbrain.org>752 * @author Andreas Gohr <andi@splitbrain.org>
753 *
754 * @param string $info
755 * @param mixed $var
714 */756 */
715 function _debug($info,$var=null){757 function _debug($info,$var=null){
716 if(!$this->debug) return;758 if(!$this->debug) return;
@@ -724,8 +766,8 @@
724 /**766 /**
725 * print debug info as HTML767 * print debug info as HTML
726 *768 *
727 * @param $info769 * @param string $info
728 * @param null $var770 * @param mixed $var
729 */771 */
730 function _debug_html($info, $var=null){772 function _debug_html($info, $var=null){
731 print '<b>'.$info.'</b> '.($this->_time() - $this->start).'s<br />';773 print '<b>'.$info.'</b> '.($this->_time() - $this->start).'s<br />';
@@ -741,8 +783,8 @@
741 /**783 /**
742 * prints debug info as plain text784 * prints debug info as plain text
743 *785 *
744 * @param $info786 * @param string $info
745 * @param null $var787 * @param mixed $var
746 */788 */
747 function _debug_text($info, $var=null){789 function _debug_text($info, $var=null){
748 print '*'.$info.'* '.($this->_time() - $this->start)."s\n";790 print '*'.$info.'* '.($this->_time() - $this->start)."s\n";
@@ -752,6 +794,8 @@
752794
753 /**795 /**
754 * Return current timestamp in microsecond resolution796 * Return current timestamp in microsecond resolution
797 *
798 * @return float
755 */799 */
756 static function _time(){800 static function _time(){
757 list($usec, $sec) = explode(" ", microtime());801 list($usec, $sec) = explode(" ", microtime());
@@ -764,6 +808,9 @@
764 * All Keys are lowercased.808 * All Keys are lowercased.
765 *809 *
766 * @author Andreas Gohr <andi@splitbrain.org>810 * @author Andreas Gohr <andi@splitbrain.org>
811 *
812 * @param string $string
813 * @return array
767 */814 */
768 function _parseHeaders($string){815 function _parseHeaders($string){
769 $headers = array();816 $headers = array();
@@ -792,11 +839,14 @@
792 * convert given header array to header string839 * convert given header array to header string
793 *840 *
794 * @author Andreas Gohr <andi@splitbrain.org>841 * @author Andreas Gohr <andi@splitbrain.org>
842 *
843 * @param array $headers
844 * @return string
795 */845 */
796 function _buildHeaders($headers){846 function _buildHeaders($headers){
797 $string = '';847 $string = '';
798 foreach($headers as $key => $value){848 foreach($headers as $key => $value){
799 if(empty($value)) continue;849 if($value === '') continue;
800 $string .= $key.': '.$value.HTTP_NL;850 $string .= $key.': '.$value.HTTP_NL;
801 }851 }
802 return $string;852 return $string;
@@ -806,6 +856,8 @@
806 * get cookies as http header string856 * get cookies as http header string
807 *857 *
808 * @author Andreas Goetz <cpuidle@gmx.de>858 * @author Andreas Goetz <cpuidle@gmx.de>
859 *
860 * @return string
809 */861 */
810 function _getCookies(){862 function _getCookies(){
811 $headers = '';863 $headers = '';
@@ -821,6 +873,9 @@
821 * Encode data for posting873 * Encode data for posting
822 *874 *
823 * @author Andreas Gohr <andi@splitbrain.org>875 * @author Andreas Gohr <andi@splitbrain.org>
876 *
877 * @param array $data
878 * @return string
824 */879 */
825 function _postEncode($data){880 function _postEncode($data){
826 return http_build_query($data,'','&');881 return http_build_query($data,'','&');
@@ -831,6 +886,9 @@
831 *886 *
832 * @fixme use of urlencode might be wrong here887 * @fixme use of urlencode might be wrong here
833 * @author Andreas Gohr <andi@splitbrain.org>888 * @author Andreas Gohr <andi@splitbrain.org>
889 *
890 * @param array $data
891 * @return string
834 */892 */
835 function _postMultipartEncode($data){893 function _postMultipartEncode($data){
836 $boundary = '--'.$this->boundary;894 $boundary = '--'.$this->boundary;
837895
=== modified file 'inc/IXR_Library.php'
--- inc/IXR_Library.php 2012-10-21 21:14:10 +0000
+++ inc/IXR_Library.php 2015-11-12 19:55:23 +0000
@@ -1,101 +1,146 @@
1<?php1<?php
2
2/**3/**
3 * IXR - The Inutio XML-RPC Library - (c) Incutio Ltd 20024 * IXR - The Incutio XML-RPC Library
4 *5 *
5 * @version 1.616 * Copyright (c) 2010, Incutio Ltd.
6 * @author Simon Willison7 * All rights reserved.
7 * @date 11th July 20038 *
8 * @link http://scripts.incutio.com/xmlrpc/9 * Redistribution and use in source and binary forms, with or without
9 * @link http://scripts.incutio.com/xmlrpc/manual.php10 * modification, are permitted provided that the following conditions are met:
10 * @license Artistic License http://www.opensource.org/licenses/artistic-license.php11 *
12 * - Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 * - Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * - Neither the name of Incutio Ltd. nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
29 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
31 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * @package IXR
34 * @since 1.5
35 *
36 * @copyright Incutio Ltd 2010 (http://www.incutio.com)
37 * @version 1.7.4 7th September 2010
38 * @author Simon Willison
39 * @link http://scripts.incutio.com/xmlrpc/ Site/manual
11 *40 *
12 * Modified for DokuWiki41 * Modified for DokuWiki
13 * @author Andreas Gohr <andi@splitbrain.org>42 * @author Andreas Gohr <andi@splitbrain.org>
14 */43 */
15
16
17class IXR_Value {44class IXR_Value {
45
46 /** @var IXR_Value[]|IXR_Date|IXR_Base64|int|bool|double|string */
18 var $data;47 var $data;
48 /** @var string */
19 var $type;49 var $type;
20 function IXR_Value ($data, $type = false) {50
51 /**
52 * @param mixed $data
53 * @param bool $type
54 */
55 function __construct($data, $type = false) {
21 $this->data = $data;56 $this->data = $data;
22 if (!$type) {57 if(!$type) {
23 $type = $this->calculateType();58 $type = $this->calculateType();
24 }59 }
25 $this->type = $type;60 $this->type = $type;
26 if ($type == 'struct') {61 if($type == 'struct') {
27 /* Turn all the values in the array in to new IXR_Value objects */62 // Turn all the values in the array in to new IXR_Value objects
28 foreach ($this->data as $key => $value) {63 foreach($this->data as $key => $value) {
29 $this->data[$key] = new IXR_Value($value);64 $this->data[$key] = new IXR_Value($value);
30 }65 }
31 }66 }
32 if ($type == 'array') {67 if($type == 'array') {
33 for ($i = 0, $j = count($this->data); $i < $j; $i++) {68 for($i = 0, $j = count($this->data); $i < $j; $i++) {
34 $this->data[$i] = new IXR_Value($this->data[$i]);69 $this->data[$i] = new IXR_Value($this->data[$i]);
35 }70 }
36 }71 }
37 }72 }
73
74 /**
75 * @return string
76 */
38 function calculateType() {77 function calculateType() {
39 if ($this->data === true || $this->data === false) {78 if($this->data === true || $this->data === false) {
40 return 'boolean';79 return 'boolean';
41 }80 }
42 if (is_integer($this->data)) {81 if(is_integer($this->data)) {
43 return 'int';82 return 'int';
44 }83 }
45 if (is_double($this->data)) {84 if(is_double($this->data)) {
46 return 'double';85 return 'double';
47 }86 }
87
48 // Deal with IXR object types base64 and date88 // Deal with IXR object types base64 and date
49 if (is_object($this->data) && is_a($this->data, 'IXR_Date')) {89 if(is_object($this->data) && is_a($this->data, 'IXR_Date')) {
50 return 'date';90 return 'date';
51 }91 }
52 if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) {92 if(is_object($this->data) && is_a($this->data, 'IXR_Base64')) {
53 return 'base64';93 return 'base64';
54 }94 }
95
55 // If it is a normal PHP object convert it in to a struct96 // If it is a normal PHP object convert it in to a struct
56 if (is_object($this->data)) {97 if(is_object($this->data)) {
57
58 $this->data = get_object_vars($this->data);98 $this->data = get_object_vars($this->data);
59 return 'struct';99 return 'struct';
60 }100 }
61 if (!is_array($this->data)) {101 if(!is_array($this->data)) {
62 return 'string';102 return 'string';
63 }103 }
64 /* We have an array - is it an array or a struct ? */104
65 if ($this->isStruct($this->data)) {105 // We have an array - is it an array or a struct?
106 if($this->isStruct($this->data)) {
66 return 'struct';107 return 'struct';
67 } else {108 } else {
68 return 'array';109 return 'array';
69 }110 }
70 }111 }
112
113 /**
114 * @return bool|string
115 */
71 function getXml() {116 function getXml() {
72 /* Return XML for this value */117 // Return XML for this value
73 switch ($this->type) {118 switch($this->type) {
74 case 'boolean':119 case 'boolean':
75 return '<boolean>'.(($this->data) ? '1' : '0').'</boolean>';120 return '<boolean>' . (($this->data) ? '1' : '0') . '</boolean>';
76 break;121 break;
77 case 'int':122 case 'int':
78 return '<int>'.$this->data.'</int>';123 return '<int>' . $this->data . '</int>';
79 break;124 break;
80 case 'double':125 case 'double':
81 return '<double>'.$this->data.'</double>';126 return '<double>' . $this->data . '</double>';
82 break;127 break;
83 case 'string':128 case 'string':
84 return '<string>'.htmlspecialchars($this->data).'</string>';129 return '<string>' . htmlspecialchars($this->data) . '</string>';
85 break;130 break;
86 case 'array':131 case 'array':
87 $return = '<array><data>'."\n";132 $return = '<array><data>' . "\n";
88 foreach ($this->data as $item) {133 foreach($this->data as $item) {
89 $return .= ' <value>'.$item->getXml()."</value>\n";134 $return .= ' <value>' . $item->getXml() . "</value>\n";
90 }135 }
91 $return .= '</data></array>';136 $return .= '</data></array>';
92 return $return;137 return $return;
93 break;138 break;
94 case 'struct':139 case 'struct':
95 $return = '<struct>'."\n";140 $return = '<struct>' . "\n";
96 foreach ($this->data as $name => $value) {141 foreach($this->data as $name => $value) {
97 $return .= " <member><name>$name</name><value>";142 $return .= " <member><name>$name</name><value>";
98 $return .= $value->getXml()."</value></member>\n";143 $return .= $value->getXml() . "</value></member>\n";
99 }144 }
100 $return .= '</struct>';145 $return .= '</struct>';
101 return $return;146 return $return;
@@ -107,11 +152,17 @@
107 }152 }
108 return false;153 return false;
109 }154 }
155
156 /**
157 * Checks whether or not the supplied array is a struct or not
158 *
159 * @param array $array
160 * @return boolean
161 */
110 function isStruct($array) {162 function isStruct($array) {
111 /* Nasty function to check if an array is a struct or not */
112 $expected = 0;163 $expected = 0;
113 foreach ($array as $key => $value) {164 foreach($array as $key => $value) {
114 if ((string)$key != (string)$expected) {165 if((string) $key != (string) $expected) {
115 return true;166 return true;
116 }167 }
117 $expected++;168 $expected++;
@@ -120,18 +171,25 @@
120 }171 }
121}172}
122173
123174/**
175 * IXR_MESSAGE
176 *
177 * @package IXR
178 * @since 1.5
179 *
180 */
124class IXR_Message {181class IXR_Message {
125 var $message;182 var $message;
126 var $messageType; // methodCall / methodResponse / fault183 var $messageType; // methodCall / methodResponse / fault
127 var $faultCode;184 var $faultCode;
128 var $faultString;185 var $faultString;
129 var $methodName;186 var $methodName;
130 var $params;187 var $params;
188
131 // Current variable stacks189 // Current variable stacks
132 var $_arraystructs = array(); // The stack used to keep track of the current array/struct190 var $_arraystructs = array(); // The stack used to keep track of the current array/struct
133 var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array191 var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array
134 var $_currentStructName = array(); // A stack as well192 var $_currentStructName = array(); // A stack as well
135 var $_param;193 var $_param;
136 var $_value;194 var $_value;
137 var $_currentTag;195 var $_currentTag;
@@ -139,12 +197,23 @@
139 var $_lastseen;197 var $_lastseen;
140 // The XML parser198 // The XML parser
141 var $_parser;199 var $_parser;
142 function IXR_Message ($message) {200
143 $this->message = $message;201 /**
202 * @param string $message
203 */
204 function __construct($message) {
205 $this->message =& $message;
144 }206 }
207
208 /**
209 * @return bool
210 */
145 function parse() {211 function parse() {
146 // first remove the XML declaration212 // first remove the XML declaration
147 $this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message);213 // merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages
214 $header = preg_replace('/<\?xml.*?\?' . '>/', '', substr($this->message, 0, 100), 1);
215 $this->message = substr_replace($this->message, $header, 0, 100);
216
148 // workaround for a bug in PHP/libxml2, see http://bugs.php.net/bug.php?id=45996217 // workaround for a bug in PHP/libxml2, see http://bugs.php.net/bug.php?id=45996
149 $this->message = str_replace('&lt;', '&#60;', $this->message);218 $this->message = str_replace('&lt;', '&#60;', $this->message);
150 $this->message = str_replace('&gt;', '&#62;', $this->message);219 $this->message = str_replace('&gt;', '&#62;', $this->message);
@@ -152,7 +221,7 @@
152 $this->message = str_replace('&apos;', '&#39;', $this->message);221 $this->message = str_replace('&apos;', '&#39;', $this->message);
153 $this->message = str_replace('&quot;', '&#34;', $this->message);222 $this->message = str_replace('&quot;', '&#34;', $this->message);
154 $this->message = str_replace("\x0b", ' ', $this->message); //vertical tab223 $this->message = str_replace("\x0b", ' ', $this->message); //vertical tab
155 if (trim($this->message) == '') {224 if(trim($this->message) == '') {
156 return false;225 return false;
157 }226 }
158 $this->_parser = xml_parser_create();227 $this->_parser = xml_parser_create();
@@ -162,23 +231,40 @@
162 xml_set_object($this->_parser, $this);231 xml_set_object($this->_parser, $this);
163 xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');232 xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');
164 xml_set_character_data_handler($this->_parser, 'cdata');233 xml_set_character_data_handler($this->_parser, 'cdata');
165 if (!xml_parse($this->_parser, $this->message)) {234 $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages
166 /* die(sprintf('XML error: %s at line %d',235 $final = false;
167 xml_error_string(xml_get_error_code($this->_parser)),236 do {
168 xml_get_current_line_number($this->_parser))); */237 if(strlen($this->message) <= $chunk_size) {
169 return false;238 $final = true;
170 }239 }
240 $part = substr($this->message, 0, $chunk_size);
241 $this->message = substr($this->message, $chunk_size);
242 if(!xml_parse($this->_parser, $part, $final)) {
243 return false;
244 }
245 if($final) {
246 break;
247 }
248 } while(true);
171 xml_parser_free($this->_parser);249 xml_parser_free($this->_parser);
250
172 // Grab the error messages, if any251 // Grab the error messages, if any
173 if ($this->messageType == 'fault') {252 if($this->messageType == 'fault') {
174 $this->faultCode = $this->params[0]['faultCode'];253 $this->faultCode = $this->params[0]['faultCode'];
175 $this->faultString = $this->params[0]['faultString'];254 $this->faultString = $this->params[0]['faultString'];
176 }255 }
177 return true;256 return true;
178 }257 }
258
259 /**
260 * @param $parser
261 * @param string $tag
262 * @param $attr
263 */
179 function tag_open($parser, $tag, $attr) {264 function tag_open($parser, $tag, $attr) {
180 $this->currentTag = $tag;
181 $this->_currentTagContents = '';265 $this->_currentTagContents = '';
266 $this->_currentTag = $tag;
267
182 switch($tag) {268 switch($tag) {
183 case 'methodCall':269 case 'methodCall':
184 case 'methodResponse':270 case 'methodResponse':
@@ -186,7 +272,7 @@
186 $this->messageType = $tag;272 $this->messageType = $tag;
187 break;273 break;
188 /* Deal with stacks of arrays and structs */274 /* Deal with stacks of arrays and structs */
189 case 'data': // data is to all intents and puposes more interesting than array275 case 'data': // data is to all intents and purposes more interesting than array
190 $this->_arraystructstypes[] = 'array';276 $this->_arraystructstypes[] = 'array';
191 $this->_arraystructs[] = array();277 $this->_arraystructs[] = array();
192 break;278 break;
@@ -197,50 +283,53 @@
197 }283 }
198 $this->_lastseen = $tag;284 $this->_lastseen = $tag;
199 }285 }
286
287 /**
288 * @param $parser
289 * @param string $cdata
290 */
200 function cdata($parser, $cdata) {291 function cdata($parser, $cdata) {
201 $this->_currentTagContents .= $cdata;292 $this->_currentTagContents .= $cdata;
202 }293 }
294
295 /**
296 * @param $parser
297 * @param $tag
298 */
203 function tag_close($parser, $tag) {299 function tag_close($parser, $tag) {
300 $value = null;
204 $valueFlag = false;301 $valueFlag = false;
205 switch($tag) {302 switch($tag) {
206 case 'int':303 case 'int':
207 case 'i4':304 case 'i4':
208 $value = (int)trim($this->_currentTagContents);305 $value = (int) trim($this->_currentTagContents);
209 $this->_currentTagContents = '';
210 $valueFlag = true;306 $valueFlag = true;
211 break;307 break;
212 case 'double':308 case 'double':
213 $value = (double)trim($this->_currentTagContents);309 $value = (double) trim($this->_currentTagContents);
214 $this->_currentTagContents = '';
215 $valueFlag = true;310 $valueFlag = true;
216 break;311 break;
217 case 'string':312 case 'string':
218 $value = (string)$this->_currentTagContents;313 $value = (string) $this->_currentTagContents;
219 $this->_currentTagContents = '';
220 $valueFlag = true;314 $valueFlag = true;
221 break;315 break;
222 case 'dateTime.iso8601':316 case 'dateTime.iso8601':
223 $value = new IXR_Date(trim($this->_currentTagContents));317 $value = new IXR_Date(trim($this->_currentTagContents));
224 // $value = $iso->getTimestamp();
225 $this->_currentTagContents = '';
226 $valueFlag = true;318 $valueFlag = true;
227 break;319 break;
228 case 'value':320 case 'value':
229 // "If no type is indicated, the type is string."321 // "If no type is indicated, the type is string."
230 if($this->_lastseen == 'value'){322 if($this->_lastseen == 'value') {
231 $value = (string)$this->_currentTagContents;323 $value = (string) $this->_currentTagContents;
232 $this->_currentTagContents = '';
233 $valueFlag = true;324 $valueFlag = true;
234 }325 }
235 break;326 break;
236 case 'boolean':327 case 'boolean':
237 $value = (boolean)trim($this->_currentTagContents);328 $value = (boolean) trim($this->_currentTagContents);
238 $this->_currentTagContents = '';
239 $valueFlag = true;329 $valueFlag = true;
240 break;330 break;
241 case 'base64':331 case 'base64':
242 $value = base64_decode($this->_currentTagContents);332 $value = base64_decode($this->_currentTagContents);
243 $this->_currentTagContents = '';
244 $valueFlag = true;333 $valueFlag = true;
245 break;334 break;
246 /* Deal with stacks of arrays and structs */335 /* Deal with stacks of arrays and structs */
@@ -255,75 +344,94 @@
255 break;344 break;
256 case 'name':345 case 'name':
257 $this->_currentStructName[] = trim($this->_currentTagContents);346 $this->_currentStructName[] = trim($this->_currentTagContents);
258 $this->_currentTagContents = '';
259 break;347 break;
260 case 'methodName':348 case 'methodName':
261 $this->methodName = trim($this->_currentTagContents);349 $this->methodName = trim($this->_currentTagContents);
262 $this->_currentTagContents = '';
263 break;350 break;
264 }351 }
265 if ($valueFlag) {352
266 /*353 if($valueFlag) {
267 if (!is_array($value) && !is_object($value)) {354 if(count($this->_arraystructs) > 0) {
268 $value = trim($value);
269 }
270 */
271 if (count($this->_arraystructs) > 0) {
272 // Add value to struct or array355 // Add value to struct or array
273 if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') {356 if($this->_arraystructstypes[count($this->_arraystructstypes) - 1] == 'struct') {
274 // Add to struct357 // Add to struct
275 $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value;358 $this->_arraystructs[count($this->_arraystructs) - 1][$this->_currentStructName[count($this->_currentStructName) - 1]] = $value;
276 } else {359 } else {
277 // Add to array360 // Add to array
278 $this->_arraystructs[count($this->_arraystructs)-1][] = $value;361 $this->_arraystructs[count($this->_arraystructs) - 1][] = $value;
279 }362 }
280 } else {363 } else {
281 // Just add as a paramater364 // Just add as a parameter
282 $this->params[] = $value;365 $this->params[] = $value;
283 }366 }
284 }367 }
368 $this->_currentTagContents = '';
285 $this->_lastseen = $tag;369 $this->_lastseen = $tag;
286 }370 }
287}371}
288372
289373/**
374 * IXR_Server
375 *
376 * @package IXR
377 * @since 1.5
378 */
290class IXR_Server {379class IXR_Server {
291 var $data;380 var $data;
381 /** @var array */
292 var $callbacks = array();382 var $callbacks = array();
293 var $message;383 var $message;
384 /** @var array */
294 var $capabilities;385 var $capabilities;
295 function IXR_Server($callbacks = false, $data = false) {386
387 /**
388 * @param array|bool $callbacks
389 * @param bool $data
390 * @param bool $wait
391 */
392 function __construct($callbacks = false, $data = false, $wait = false) {
296 $this->setCapabilities();393 $this->setCapabilities();
297 if ($callbacks) {394 if($callbacks) {
298 $this->callbacks = $callbacks;395 $this->callbacks = $callbacks;
299 }396 }
300 $this->setCallbacks();397 $this->setCallbacks();
301 $this->serve($data);398
399 if(!$wait) {
400 $this->serve($data);
401 }
302 }402 }
403
404 /**
405 * @param bool|string $data
406 */
303 function serve($data = false) {407 function serve($data = false) {
304 if (!$data) {408 if(!$data) {
305409
306 $postData = trim(http_get_raw_post_data());410 $postData = trim(http_get_raw_post_data());
307 if (!$postData) {411 if(!$postData) {
412 header('Content-Type: text/plain'); // merged from WP #9093
308 die('XML-RPC server accepts POST requests only.');413 die('XML-RPC server accepts POST requests only.');
309 }414 }
310 $data = $postData;415 $data = $postData;
311 }416 }
312 $this->message = new IXR_Message($data);417 $this->message = new IXR_Message($data);
313 if (!$this->message->parse()) {418 if(!$this->message->parse()) {
314 $this->error(-32700, 'parse error. not well formed');419 $this->error(-32700, 'parse error. not well formed');
315 }420 }
316 if ($this->message->messageType != 'methodCall') {421 if($this->message->messageType != 'methodCall') {
317 $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');422 $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');
318 }423 }
319 $result = $this->call($this->message->methodName, $this->message->params);424 $result = $this->call($this->message->methodName, $this->message->params);
425
320 // Is the result an error?426 // Is the result an error?
321 if (is_a($result, 'IXR_Error')) {427 if(is_a($result, 'IXR_Error')) {
322 $this->error($result);428 $this->error($result);
323 }429 }
430
324 // Encode the result431 // Encode the result
325 $r = new IXR_Value($result);432 $r = new IXR_Value($result);
326 $resultxml = $r->getXml();433 $resultxml = $r->getXml();
434
327 // Create the XML435 // Create the XML
328 $xml = <<<EOD436 $xml = <<<EOD
329<methodResponse>437<methodResponse>
@@ -340,16 +448,23 @@
340 // Send it448 // Send it
341 $this->output($xml);449 $this->output($xml);
342 }450 }
451
452 /**
453 * @param string $methodname
454 * @param array $args
455 * @return IXR_Error|mixed
456 */
343 function call($methodname, $args) {457 function call($methodname, $args) {
344 if (!$this->hasMethod($methodname)) {458 if(!$this->hasMethod($methodname)) {
345 return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.');459 return new IXR_Error(-32601, 'server error. requested method ' . $methodname . ' does not exist.');
346 }460 }
347 $method = $this->callbacks[$methodname];461 $method = $this->callbacks[$methodname];
462
348 // Perform the callback and send the response463 // Perform the callback and send the response
349464
350 # Removed for DokuWiki to have a more consistent interface465 # Removed for DokuWiki to have a more consistent interface
351 # if (count($args) == 1) {466 # if (count($args) == 1) {
352 # // If only one paramater just send that instead of the whole array467 # // If only one parameter just send that instead of the whole array
353 # $args = $args[0];468 # $args = $args[0];
354 # }469 # }
355470
@@ -359,16 +474,16 @@
359 $args = (array) $args;474 $args = (array) $args;
360475
361 // Are we dealing with a function or a method?476 // Are we dealing with a function or a method?
362 if (substr($method, 0, 5) == 'this:') {477 if(is_string($method) && substr($method, 0, 5) == 'this:') {
363 // It's a class method - check it exists478 // It's a class method - check it exists
364 $method = substr($method, 5);479 $method = substr($method, 5);
365 if (!method_exists($this, $method)) {480 if(!method_exists($this, $method)) {
366 return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.');481 return new IXR_Error(-32601, 'server error. requested class method "' . $method . '" does not exist.');
367 }482 }
368 // Call the method483 // Call the method
369 #$result = $this->$method($args);484 #$result = $this->$method($args);
370 $result = call_user_func_array(array(&$this,$method),$args);485 $result = call_user_func_array(array(&$this, $method), $args);
371 } elseif (substr($method, 0, 7) == 'plugin:') {486 } elseif(substr($method, 0, 7) == 'plugin:') {
372 list($pluginname, $callback) = explode(':', substr($method, 7), 2);487 list($pluginname, $callback) = explode(':', substr($method, 7), 2);
373 if(!plugin_isdisabled($pluginname)) {488 if(!plugin_isdisabled($pluginname)) {
374 $plugin = plugin_load('action', $pluginname);489 $plugin = plugin_load('action', $pluginname);
@@ -378,31 +493,49 @@
378 }493 }
379 } else {494 } else {
380 // It's a function - does it exist?495 // It's a function - does it exist?
381 if (!function_exists($method)) {496 if(is_array($method)) {
382 return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.');497 if(!is_callable(array($method[0], $method[1]))) {
498 return new IXR_Error(-32601, 'server error. requested object method "' . $method[1] . '" does not exist.');
499 }
500 } else if(!function_exists($method)) {
501 return new IXR_Error(-32601, 'server error. requested function "' . $method . '" does not exist.');
383 }502 }
503
384 // Call the function504 // Call the function
385 #$result = $method($args);505 $result = call_user_func($method, $args);
386 $result = call_user_func_array($method,$args);
387 }506 }
388 return $result;507 return $result;
389 }508 }
390509
510 /**
511 * @param int $error
512 * @param string|bool $message
513 */
391 function error($error, $message = false) {514 function error($error, $message = false) {
392 // Accepts either an error object or an error code and message515 // Accepts either an error object or an error code and message
393 if ($message && !is_object($error)) {516 if($message && !is_object($error)) {
394 $error = new IXR_Error($error, $message);517 $error = new IXR_Error($error, $message);
395 }518 }
396 $this->output($error->getXml());519 $this->output($error->getXml());
397 }520 }
521
522 /**
523 * @param string $xml
524 */
398 function output($xml) {525 function output($xml) {
399 header('Content-Type: text/xml; charset=utf-8');526 header('Content-Type: text/xml; charset=utf-8');
400 echo '<?xml version="1.0"?>', "\n", $xml;527 echo '<?xml version="1.0"?>', "\n", $xml;
401 exit;528 exit;
402 }529 }
530
531 /**
532 * @param string $method
533 * @return bool
534 */
403 function hasMethod($method) {535 function hasMethod($method) {
404 return in_array($method, array_keys($this->callbacks));536 return in_array($method, array_keys($this->callbacks));
405 }537 }
538
406 function setCapabilities() {539 function setCapabilities() {
407 // Initialises capabilities array540 // Initialises capabilities array
408 $this->capabilities = array(541 $this->capabilities = array(
@@ -420,31 +553,45 @@
420 ),553 ),
421 );554 );
422 }555 }
556
557 /**
558 * @return mixed
559 */
423 function getCapabilities() {560 function getCapabilities() {
424 return $this->capabilities;561 return $this->capabilities;
425 }562 }
563
426 function setCallbacks() {564 function setCallbacks() {
427 $this->callbacks['system.getCapabilities'] = 'this:getCapabilities';565 $this->callbacks['system.getCapabilities'] = 'this:getCapabilities';
428 $this->callbacks['system.listMethods'] = 'this:listMethods';566 $this->callbacks['system.listMethods'] = 'this:listMethods';
429 $this->callbacks['system.multicall'] = 'this:multiCall';567 $this->callbacks['system.multicall'] = 'this:multiCall';
430 }568 }
569
570 /**
571 * @return array
572 */
431 function listMethods() {573 function listMethods() {
432 // Returns a list of methods - uses array_reverse to ensure user defined574 // Returns a list of methods - uses array_reverse to ensure user defined
433 // methods are listed before server defined methods575 // methods are listed before server defined methods
434 return array_reverse(array_keys($this->callbacks));576 return array_reverse(array_keys($this->callbacks));
435 }577 }
578
579 /**
580 * @param array $methodcalls
581 * @return array
582 */
436 function multiCall($methodcalls) {583 function multiCall($methodcalls) {
437 // See http://www.xmlrpc.com/discuss/msgReader$1208584 // See http://www.xmlrpc.com/discuss/msgReader$1208
438 $return = array();585 $return = array();
439 foreach ($methodcalls as $call) {586 foreach($methodcalls as $call) {
440 $method = $call['methodName'];587 $method = $call['methodName'];
441 $params = $call['params'];588 $params = $call['params'];
442 if ($method == 'system.multicall') {589 if($method == 'system.multicall') {
443 $result = new IXR_Error(-32800, 'Recursive calls to system.multicall are forbidden');590 $result = new IXR_Error(-32800, 'Recursive calls to system.multicall are forbidden');
444 } else {591 } else {
445 $result = $this->call($method, $params);592 $result = $this->call($method, $params);
446 }593 }
447 if (is_a($result, 'IXR_Error')) {594 if(is_a($result, 'IXR_Error')) {
448 $return[] = array(595 $return[] = array(
449 'faultCode' => $result->code,596 'faultCode' => $result->code,
450 'faultString' => $result->message597 'faultString' => $result->message
@@ -457,11 +604,25 @@
457 }604 }
458}605}
459606
607/**
608 * IXR_Request
609 *
610 * @package IXR
611 * @since 1.5
612 */
460class IXR_Request {613class IXR_Request {
614 /** @var string */
461 var $method;615 var $method;
616 /** @var array */
462 var $args;617 var $args;
618 /** @var string */
463 var $xml;619 var $xml;
464 function IXR_Request($method, $args) {620
621 /**
622 * @param string $method
623 * @param array $args
624 */
625 function __construct($method, $args) {
465 $this->method = $method;626 $this->method = $method;
466 $this->args = $args;627 $this->args = $args;
467 $this->xml = <<<EOD628 $this->xml = <<<EOD
@@ -471,7 +632,7 @@
471<params>632<params>
472633
473EOD;634EOD;
474 foreach ($this->args as $arg) {635 foreach($this->args as $arg) {
475 $this->xml .= '<param><value>';636 $this->xml .= '<param><value>';
476 $v = new IXR_Value($arg);637 $v = new IXR_Value($arg);
477 $this->xml .= $v->getXml();638 $this->xml .= $v->getXml();
@@ -479,15 +640,28 @@
479 }640 }
480 $this->xml .= '</params></methodCall>';641 $this->xml .= '</params></methodCall>';
481 }642 }
643
644 /**
645 * @return int
646 */
482 function getLength() {647 function getLength() {
483 return strlen($this->xml);648 return strlen($this->xml);
484 }649 }
650
651 /**
652 * @return string
653 */
485 function getXml() {654 function getXml() {
486 return $this->xml;655 return $this->xml;
487 }656 }
488}657}
489658
490/**659/**
660 * IXR_Client
661 *
662 * @package IXR
663 * @since 1.5
664 *
491 * Changed for DokuWiki to use DokuHTTPClient665 * Changed for DokuWiki to use DokuHTTPClient
492 *666 *
493 * This should be compatible to the original class, but uses DokuWiki's667 * This should be compatible to the original class, but uses DokuWiki's
@@ -498,19 +672,34 @@
498 */672 */
499class IXR_Client extends DokuHTTPClient {673class IXR_Client extends DokuHTTPClient {
500 var $posturl = '';674 var $posturl = '';
675 /** @var IXR_Message|bool */
501 var $message = false;676 var $message = false;
677
678 // Storage place for an error message
679 /** @var IXR_Error|bool */
502 var $xmlerror = false;680 var $xmlerror = false;
503681
504 function IXR_Client($server, $path = false, $port = 80) {682 /**
683 * @param string $server
684 * @param string|bool $path
685 * @param int $port
686 * @param int $timeout
687 */
688 function __construct($server, $path = false, $port = 80, $timeout = 15) {
505 parent::__construct();689 parent::__construct();
506 if (!$path) {690 if(!$path) {
507 // Assume we have been given a URL instead691 // Assume we have been given a URL instead
508 $this->posturl = $server;692 $this->posturl = $server;
509 }else{693 } else {
510 $this->posturl = 'http://'.$server.':'.$port.$path;694 $this->posturl = 'http://' . $server . ':' . $port . $path;
511 }695 }
696 $this->timeout = $timeout;
512 }697 }
513698
699 /**
700 * parameters: method and arguments
701 * @return bool success or error
702 */
514 function query() {703 function query() {
515 $args = func_get_args();704 $args = func_get_args();
516 $method = array_shift($args);705 $method = array_shift($args);
@@ -518,55 +707,87 @@
518 $xml = $request->getXml();707 $xml = $request->getXml();
519708
520 $this->headers['Content-Type'] = 'text/xml';709 $this->headers['Content-Type'] = 'text/xml';
521 if(!$this->sendRequest($this->posturl,$xml,'POST')){710 if(!$this->sendRequest($this->posturl, $xml, 'POST')) {
522 $this->xmlerror = new IXR_Error(-32300, 'transport error - '.$this->error);711 $this->xmlerror = new IXR_Error(-32300, 'transport error - ' . $this->error);
523 return false;712 return false;
524 }713 }
525714
526 // Check HTTP Response code715 // Check HTTP Response code
527 if($this->status < 200 || $this->status > 206){716 if($this->status < 200 || $this->status > 206) {
528 $this->xmlerror = new IXR_Error(-32300, 'transport error - HTTP status '.$this->status);717 $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: