1
0
mirror of https://github.com/pierre42100/comunic synced 2025-07-11 12:32:56 +00:00

First commit

This commit is contained in:
Pierre Hubert
2016-11-19 12:08:12 +01:00
commit 990540b2b9
4706 changed files with 931207 additions and 0 deletions
.gitignore.htaccess
3rdparty
RestServer
analysing_page
crypt
fancyapps
gestionnaire_upload
luminous
.htaccess.travis.ymlCHANGES.markdownDoxyfileLICENSEREADME.markdownapi-docs.html
client
composer.json
docs
html
annotated.htmlbc_s.pngbdwn.pngclassLuminousEmbeddedWebScript-members.htmlclassLuminousEmbeddedWebScript.htmlclassLuminousEmbeddedWebScript__coll__graph.dotclassLuminousEmbeddedWebScript__coll__graph.md5classLuminousEmbeddedWebScript__inherit__graph.dotclassLuminousEmbeddedWebScript__inherit__graph.md5classLuminousFilters-members.htmlclassLuminousFilters.htmlclassLuminousOptions-members.htmlclassLuminousOptions.htmlclassLuminousScanner-members.htmlclassLuminousScanner.htmlclassLuminousScanner__coll__graph.dotclassLuminousScanner__coll__graph.md5classLuminousScanner__inherit__graph.dotclassLuminousScanner__inherit__graph.md5classLuminousSimpleScanner-members.htmlclassLuminousSimpleScanner.htmlclassLuminousSimpleScanner__coll__graph.dotclassLuminousSimpleScanner__coll__graph.md5classLuminousSimpleScanner__inherit__graph.dotclassLuminousSimpleScanner__inherit__graph.md5classLuminousStatefulScanner-members.htmlclassLuminousStatefulScanner.htmlclassLuminousStatefulScanner__coll__graph.dotclassLuminousStatefulScanner__coll__graph.md5classLuminousStatefulScanner__inherit__graph.dotclassLuminousStatefulScanner__inherit__graph.md5classLuminousStringSearch-members.htmlclassLuminousStringSearch.htmlclassLuminousTokenPresets-members.htmlclassLuminousTokenPresets.htmlclassLuminousUtils-members.htmlclassLuminousUtils.htmlclassScanner-members.htmlclassScanner.htmlclassScanner__inherit__graph.dotclassScanner__inherit__graph.md5classes.htmlclassluminous-members.htmlclassluminous.htmlclosed.pngdir_313caf1132e152dd9b58bea13a4052ca.htmldir_313caf1132e152dd9b58bea13a4052ca_dep.dotdir_313caf1132e152dd9b58bea13a4052ca_dep.md5dir_68267d1309a1af8e8297ef4c3efbcdba.htmldir_68267d1309a1af8e8297ef4c3efbcdba_dep.dotdir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5dir_6dd2d287d08a289e9849dd6e2f6b9333.htmldir_6dd2d287d08a289e9849dd6e2f6b9333_dep.dotdir_6dd2d287d08a289e9849dd6e2f6b9333_dep.md5dir_aebb8dcc11953d78e620bbef0b9e2183.htmldir_aebb8dcc11953d78e620bbef0b9e2183_dep.dotdir_aebb8dcc11953d78e620bbef0b9e2183_dep.md5dir_c5f232a4203c130ceb9aba0edfa2d75b.htmldir_c5f232a4203c130ceb9aba0edfa2d75b_dep.dotdir_c5f232a4203c130ceb9aba0edfa2d75b_dep.md5doxygen.cssdoxygen.pngdynsections.jsfiles.htmlftv2blank.pngftv2cl.pngftv2doc.pngftv2folderclosed.pngftv2folderopen.pngftv2lastnode.pngftv2link.pngftv2mlastnode.pngftv2mnode.pngftv2mo.pngftv2node.pngftv2ns.pngftv2plastnode.pngftv2pnode.pngftv2splitbar.pngftv2vertline.pngfunctions.htmlfunctions_func.htmlfunctions_vars.htmlgraph_legend.dotgraph_legend.htmlgraph_legend.md5hierarchy.htmlindex.htmlinherit_graph_0.dotinherit_graph_0.md5inherit_graph_1.dotinherit_graph_1.md5inherit_graph_2.dotinherit_graph_2.md5inherit_graph_3.dotinherit_graph_3.md5inherit_graph_4.dotinherit_graph_4.md5inherit_graph_5.dotinherit_graph_5.md5inherit_graph_6.dotinherit_graph_6.md5inherits.htmljquery.jsnav_f.pngnav_g.pngnav_h.pngopen.pngscanner_8class_8php.html
search
sync_off.pngsync_on.pngtab_a.pngtab_b.pngtab_h.pngtab_s.pngtabs.css
site
examples
index.html
languages
luminous.php
src
style
supported.phpversioncheck.php
pdf.js
.gitattributes.gitignore.gitmodules.jshintignore.jshintrc.travis.ymlAUTHORSCONTRIBUTING.mdLICENSEREADME.md
docs
examples
extensions
external
.gitignore
bcmaps
.gitattributes78-EUC-H.bcmap78-EUC-V.bcmap78-H.bcmap78-RKSJ-H.bcmap78-RKSJ-V.bcmap78-V.bcmap78ms-RKSJ-H.bcmap78ms-RKSJ-V.bcmap83pv-RKSJ-H.bcmap90ms-RKSJ-H.bcmap90ms-RKSJ-V.bcmap90msp-RKSJ-H.bcmap90msp-RKSJ-V.bcmap90pv-RKSJ-H.bcmap90pv-RKSJ-V.bcmapAdd-H.bcmapAdd-RKSJ-H.bcmapAdd-RKSJ-V.bcmapAdd-V.bcmapAdobe-CNS1-0.bcmapAdobe-CNS1-1.bcmapAdobe-CNS1-2.bcmapAdobe-CNS1-3.bcmapAdobe-CNS1-4.bcmapAdobe-CNS1-5.bcmapAdobe-CNS1-6.bcmapAdobe-CNS1-UCS2.bcmapAdobe-GB1-0.bcmapAdobe-GB1-1.bcmapAdobe-GB1-2.bcmapAdobe-GB1-3.bcmapAdobe-GB1-4.bcmapAdobe-GB1-5.bcmapAdobe-GB1-UCS2.bcmapAdobe-Japan1-0.bcmapAdobe-Japan1-1.bcmapAdobe-Japan1-2.bcmapAdobe-Japan1-3.bcmapAdobe-Japan1-4.bcmapAdobe-Japan1-5.bcmapAdobe-Japan1-6.bcmapAdobe-Japan1-UCS2.bcmapAdobe-Korea1-0.bcmapAdobe-Korea1-1.bcmapAdobe-Korea1-2.bcmapAdobe-Korea1-UCS2.bcmapB5-H.bcmapB5-V.bcmapB5pc-H.bcmapB5pc-V.bcmapCNS-EUC-H.bcmapCNS-EUC-V.bcmapCNS1-H.bcmapCNS1-V.bcmapCNS2-H.bcmapCNS2-V.bcmapETHK-B5-H.bcmapETHK-B5-V.bcmapETen-B5-H.bcmapETen-B5-V.bcmapETenms-B5-H.bcmapETenms-B5-V.bcmapEUC-H.bcmapEUC-V.bcmapExt-H.bcmapExt-RKSJ-H.bcmapExt-RKSJ-V.bcmapExt-V.bcmapGB-EUC-H.bcmapGB-EUC-V.bcmapGB-H.bcmapGB-V.bcmapGBK-EUC-H.bcmapGBK-EUC-V.bcmapGBK2K-H.bcmapGBK2K-V.bcmapGBKp-EUC-H.bcmapGBKp-EUC-V.bcmapGBT-EUC-H.bcmapGBT-EUC-V.bcmapGBT-H.bcmapGBT-V.bcmapGBTpc-EUC-H.bcmapGBTpc-EUC-V.bcmapGBpc-EUC-H.bcmapGBpc-EUC-V.bcmapH.bcmapHKdla-B5-H.bcmapHKdla-B5-V.bcmapHKdlb-B5-H.bcmapHKdlb-B5-V.bcmapHKgccs-B5-H.bcmapHKgccs-B5-V.bcmapHKm314-B5-H.bcmapHKm314-B5-V.bcmapHKm471-B5-H.bcmapHKm471-B5-V.bcmapHKscs-B5-H.bcmapHKscs-B5-V.bcmapHankaku.bcmapHiragana.bcmapKSC-EUC-H.bcmapKSC-EUC-V.bcmapKSC-H.bcmapKSC-Johab-H.bcmapKSC-Johab-V.bcmapKSC-V.bcmapKSCms-UHC-H.bcmapKSCms-UHC-HW-H.bcmapKSCms-UHC-HW-V.bcmapKSCms-UHC-V.bcmapKSCpc-EUC-H.bcmapKSCpc-EUC-V.bcmapKatakana.bcmapLICENSENWP-H.bcmapNWP-V.bcmapRKSJ-H.bcmapRKSJ-V.bcmapRoman.bcmapUniCNS-UCS2-H.bcmapUniCNS-UCS2-V.bcmapUniCNS-UTF16-H.bcmapUniCNS-UTF16-V.bcmapUniCNS-UTF32-H.bcmapUniCNS-UTF32-V.bcmapUniCNS-UTF8-H.bcmapUniCNS-UTF8-V.bcmapUniGB-UCS2-H.bcmapUniGB-UCS2-V.bcmapUniGB-UTF16-H.bcmapUniGB-UTF16-V.bcmapUniGB-UTF32-H.bcmapUniGB-UTF32-V.bcmapUniGB-UTF8-H.bcmapUniGB-UTF8-V.bcmapUniJIS-UCS2-H.bcmapUniJIS-UCS2-HW-H.bcmapUniJIS-UCS2-HW-V.bcmapUniJIS-UCS2-V.bcmapUniJIS-UTF16-H.bcmapUniJIS-UTF16-V.bcmapUniJIS-UTF32-H.bcmapUniJIS-UTF32-V.bcmapUniJIS-UTF8-H.bcmapUniJIS-UTF8-V.bcmapUniJIS2004-UTF16-H.bcmapUniJIS2004-UTF16-V.bcmapUniJIS2004-UTF32-H.bcmapUniJIS2004-UTF32-V.bcmapUniJIS2004-UTF8-H.bcmapUniJIS2004-UTF8-V.bcmapUniJISPro-UCS2-HW-V.bcmapUniJISPro-UCS2-V.bcmapUniJISPro-UTF8-V.bcmapUniJISX0213-UTF32-H.bcmapUniJISX0213-UTF32-V.bcmapUniJISX02132004-UTF32-H.bcmapUniJISX02132004-UTF32-V.bcmapUniKS-UCS2-H.bcmapUniKS-UCS2-V.bcmapUniKS-UTF16-H.bcmapUniKS-UTF16-V.bcmapUniKS-UTF32-H.bcmapUniKS-UTF32-V.bcmapUniKS-UTF8-H.bcmapUniKS-UTF8-V.bcmapV.bcmapWP-Symbol.bcmap
builder
cmapscompress
crlfchecker
dist
importL10n
jasmine
webL10n
l10n
README.md
ach
af
ak
an
ar
as
ast
az
be
bg
bn-BD
bn-IN
br
bs
ca
cs
csb
cy
da
de
el
en-GB
en-US
en-ZA
eo
es-AR
es-CL
es-ES
es-MX
et
eu
fa
ff
fi
fr
fy-NL
ga-IE
gd
gl
gu-IN
he
hi-IN
hr
hu
hy-AM
id
is
it
ja
ka
kk
km
kn
ko
ku
lg
lij
lt
lv
mai
mk
ml
mn
mr
ms
my
nb-NO
nl
nn-NO
nso
oc
or
pa-IN
pl
pt-BR
pt-PT
rm
ro
ru
rw
sah
si
sk
sl
son
sq
sr
sv-SE
sw
ta-LK
ta
te
th
tl
tn
tr
uk
ur
vi
wo
xh
zh-CN
zh-TW
zu
make.jspackage.jsonpdfjs.config
src
test
.gitignoredownloadutils.jsdriver.js
features
font
mozcentral
pdfs
.gitattributes.gitignore20130226130259.pdf.linkArabicCIDTrueType.pdfDiwanProfile.pdf.linkJST2007-5.pdf.linkP020121130574743273239.pdf.linkS2.pdfSFAA_Japanese.pdf.linkTAMReview.pdfTaroUTR50SortedList112.pdf.linkThuluthFeatures.pdfZapfDingbats.pdfaboutstacks.pdf.linkalphatrans.pdfannotation-as.pdf.linkarial_unicode_ab_cidfont.pdfarial_unicode_en_cidfont.pdfartofwar.pdf.linkasciihexdecode.pdfbasicapi.pdfbpl13210.pdf.linkbug1011159.pdfbug1027533.pdfbug1028735.pdfbug1046314.pdfbug1050040.pdfbug1064894.pdf.linkbug1065245.pdfbug1072164.pdf.linkbug1077808.pdf.linkbug1108301.pdfbug1108753.pdf.linkbug1140761.pdf.linkbug1142033.pdf.linkbug1157493.pdfbug766138.pdf.linkbug808084.pdf.linkbug847420.pdfbug850854.pdfbug859204.pdfbug860632.pdfbug864847.pdfbug865858.pdf.linkbug866395.pdfbug867484.pdf.linkbug868745.pdfbug878026.pdfbug878194.pdf.linkbug887152.pdf.linkbug888437.pdf.linkbug889327.pdf.linkbug893730.pdfbug894572.pdfbug900822.pdfbug903856.pdfbug911034.pdfbug921760.pdf.linkbug946506.pdfcable.pdf.linkcanvas.pdfclose-path-bug.pdfcmykjpeg.pdfcomplex_ttf_font.pdfdevicen.pdfecma262.pdf.linkendchar.pdfextgstate.pdff1040.pdf.linkfilled-background.pdffips197.pdf.linkfit11-talk.pdf.linkfranz.pdffreeculture.pdfgeothermal.pdf.linkgerman-umlaut.pdf.linkgesamt.pdf.linkglyph_accent.pdfgradientfill.pdfhelloworld-bad.pdfhmm.pdf.linkhtml5checker.pdf.linkhudsonsurvey.pdf.linki9.pdf.linkibwa-bad.pdf.linkichiji.pdf.linkintelisa.pdf.linkissue1002.pdfissue1010.pdf.linkissue1015.pdf.linkissue1049.pdf.linkissue1055.pdf.linkissue1096.pdf.linkissue1127.pdf.linkissue1133.pdf.linkissue1155.pdf.linkissue1169.pdf.linkissue1171.pdfissue1233.pdf.linkissue1243.pdf.linkissue1249.pdfissue1257.pdf.linkissue1293.pdf.linkissue1309.pdf.linkissue1317.pdf.linkissue1350.pdfissue1419.pdf.linkissue1466.pdf.linkissue1512.pdf.linkissue1597.pdf.linkissue1629.pdf.linkissue1655.pdf.linkissue1658.pdf.linkissue1685.pdf.linkissue1687.pdf.linkissue1709.pdf.linkissue1721.pdf.linkissue1729.pdf.linkissue1796.pdf.linkissue1810.pdf.linkissue1878.pdf.linkissue1905.pdfissue1912.pdf.linkissue1936.pdf.linkissue1998.pdf.linkissue2006.pdf.linkissue2074.pdfissue2099-1.pdfissue2128.pdf.linkissue2129.pdf.linkissue2139.pdf.linkissue2386.pdf.linkissue2391-1.pdfissue2391-2.pdfissue2442.pdf.linkissue2531.pdf.linkissue2537.pdf.linkissue2537r.pdfissue2627.pdf.linkissue2642.pdf.linkissue2770.pdf.linkissue2799.pdf.linkissue2829.pdf.linkissue2833.pdfissue2840.pdfissue2853.pdf.linkissue2881.pdf.linkissue2931.pdfissue2956.pdfissue2984.pdf.linkissue3025.pdfissue3062.pdf.linkissue3064.pdf.linkissue3115.pdf.linkissue3205.pdf.linkissue3207.pdf.linkissue3263.pdf.linkissue3323.pdfissue3371.pdfissue3384.pdf.linkissue3405.pdf.linkissue3427.pdf.linkissue3438.pdfissue3591.pdf.linkissue3666.pdf.linkissue3848.pdf.linkissue3879.pdf.linkissue3885.pdfissue3903.pdf.linkissue3925.pdf.linkissue3999.pdf.linkissue4061.pdfissue4246.pdfissue4304.pdfissue4379.pdfissue4436.pdf.linkissue4461.pdfissue4550.pdfissue4573.pdfissue4630.pdfissue4650.pdfissue4668.pdfissue4722.pdfissue4800.pdfissue4801.pdfissue4875.pdfissue4881.pdfissue4883.pdf.linkissue4926.pdf.linkissue4934.pdfissue5010.pdfissue5039.pdfissue5070.pdfissue5202.pdfissue5238.pdfissue5244.pdfissue5280.pdfissue5291.pdfissue5334.pdfissue5421.pdfissue5470.pdfissue5475.pdfissue5481.pdfissue5501.pdfissue5509.pdf.linkissue5549.pdfissue5567.pdfissue5592.pdf.linkissue5599.pdfissue5644.pdf.linkissue5701.pdfissue5704.pdfissue5726.pdf.linkissue5734.pdfissue5747.pdfissue5751.pdfissue5801.pdfissue5874.pdfissue5896.pdfissue5909.pdfissue5939.pdf.linkissue5954.pdfissue5972.pdfissue5994.pdfissue6010_1.pdfissue6010_2.pdfissue6068.pdfissue6081.pdfissue6099.pdfissue6117.pdf.linkissue818.pdf.linkissue840.pdfissue845.pdf.linkissue918.pdfissue919.pdf.linkissue925.pdfjai.pdf.linkjavauninstall-7.pdf.linkkdchart.pdf.linklink-annotation-border.pdf.linkliveprogramming.pdf.linkmao.pdf.linkmixedfonts.pdfmmtype1.pdfnoembed-eucjp.pdfnoembed-identity-2.pdfnoembed-identity.pdfnoembed-jis7.pdfnoembed-sjis.pdfocs.pdf.linkohkubo-SS04.pdf.linkpal-o47.pdf.linkpdf.pdf.linkpdfjsbad1586.pdfpdfkit_compressed.pdfpdkids.pdf.linkpersonwithdog.pdfpiperine.pdf.linkpreistabelle.pdf.linkprotectip.pdf.linkrotated.pdfrotation.pdfscan-bad.pdfshading_extend.pdfshavian.pdf.linksimpletype3font.pdfsizes.pdfsmaskdim.pdftcpdf_033.pdf.linktracemonkey.pdftutorial.pdf.linktxt2pdf.pdf.linktype4psfunc.pdfunix01.pdf.linkusmanm-bad.pdf.linkvertical.pdfvesta.pdf.linkwdsg_fitc.pdf.linkwnv_chinese.pdf.linkyo01.pdf.linkzerowidthline.pdf
resources
stats
test.jstest_manifest.jsontest_slave.htmltestutils.js
ttx
unit
webbrowser.jswebserver.js
viewer.php
web
.gitignoreannotations_layer_builder.jschromecom.jscompatibility.jscompressed.tracemonkey-pldi-09.pdfdebugger.jsdefault_preferences.jsdownload_manager.jsfirefoxcom.jsgrab_to_pan.jshand_tool.js
images
annotation-check.svgannotation-comment.svgannotation-help.svgannotation-insert.svgannotation-key.svgannotation-newparagraph.svgannotation-noicon.svgannotation-note.svgannotation-paragraph.svgfindbarButton-next-rtl.pngfindbarButton-next-rtl@2x.pngfindbarButton-next.pngfindbarButton-next@2x.pngfindbarButton-previous-rtl.pngfindbarButton-previous-rtl@2x.pngfindbarButton-previous.pngfindbarButton-previous@2x.pnggrab.curgrabbing.curloading-icon.gifloading-small.pngloading-small@2x.pngsecondaryToolbarButton-documentProperties.pngsecondaryToolbarButton-documentProperties@2x.pngsecondaryToolbarButton-firstPage.pngsecondaryToolbarButton-firstPage@2x.pngsecondaryToolbarButton-handTool.pngsecondaryToolbarButton-handTool@2x.pngsecondaryToolbarButton-lastPage.pngsecondaryToolbarButton-lastPage@2x.pngsecondaryToolbarButton-rotateCcw.pngsecondaryToolbarButton-rotateCcw@2x.pngsecondaryToolbarButton-rotateCw.pngsecondaryToolbarButton-rotateCw@2x.pngshadow.pngtexture.pngtoolbarButton-bookmark.pngtoolbarButton-bookmark@2x.pngtoolbarButton-download.pngtoolbarButton-download@2x.pngtoolbarButton-menuArrows.pngtoolbarButton-menuArrows@2x.pngtoolbarButton-openFile.pngtoolbarButton-openFile@2x.pngtoolbarButton-pageDown-rtl.pngtoolbarButton-pageDown-rtl@2x.pngtoolbarButton-pageDown.pngtoolbarButton-pageDown@2x.pngtoolbarButton-pageUp-rtl.pngtoolbarButton-pageUp-rtl@2x.pngtoolbarButton-pageUp.pngtoolbarButton-pageUp@2x.pngtoolbarButton-presentationMode.pngtoolbarButton-presentationMode@2x.pngtoolbarButton-print.pngtoolbarButton-print@2x.pngtoolbarButton-search.pngtoolbarButton-search@2x.pngtoolbarButton-secondaryToolbarToggle-rtl.pngtoolbarButton-secondaryToolbarToggle-rtl@2x.pngtoolbarButton-secondaryToolbarToggle.pngtoolbarButton-secondaryToolbarToggle@2x.pngtoolbarButton-sidebarToggle-rtl.pngtoolbarButton-sidebarToggle-rtl@2x.pngtoolbarButton-sidebarToggle.pngtoolbarButton-sidebarToggle@2x.pngtoolbarButton-viewAttachments.pngtoolbarButton-viewAttachments@2x.pngtoolbarButton-viewOutline-rtl.pngtoolbarButton-viewOutline-rtl@2x.pngtoolbarButton-viewOutline.pngtoolbarButton-viewOutline@2x.pngtoolbarButton-viewThumbnail.pngtoolbarButton-viewThumbnail@2x.pngtoolbarButton-zoomIn.pngtoolbarButton-zoomIn@2x.pngtoolbarButton-zoomOut.pngtoolbarButton-zoomOut@2x.png
interfaces.jsmozPrintCallback_polyfill.jsoverlay_manager.jspassword_prompt.jspdf_attachment_view.jspdf_document_properties.jspdf_find_bar.jspdf_find_controller.jspdf_history.jspdf_link_service.jspdf_outline_view.jspdf_page_view.jspdf_presentation_mode.jspdf_rendering_queue.jspdf_thumbnail_view.jspdf_thumbnail_viewer.jspdf_viewer.component.jspdf_viewer.csspdf_viewer.jspreferences.jssecondary_toolbar.jstext_layer_builder.csstext_layer_builder.jsui_utils.jsview_history.jsviewer-snippet-chrome-extension.htmlviewer-snippet-firefox-extension.htmlviewer-snippet-minified.htmlviewer-snippet-mozPrintCallback-polyfill.htmlviewer-snippet.htmlviewer.cssviewer.htmlviewer.js
phpmailer
.gitignore.scrutinizer.yml.travis.ymlLICENSEPHPMailerAutoload.phpREADME.mdchangelog.mdclass.phpmailer.phpclass.pop3.phpclass.smtp.phpcomposer.json
docs
examples
extras
language
test
travis.phpunit.xml.dist
tcpdf
CHANGELOG.TXTLICENSE.TXTREADME.TXTcomposer.json
config
examples
barcodes
config
data
example_001.phpexample_002.phpexample_003.phpexample_004.phpexample_005.phpexample_006.phpexample_007.phpexample_008.phpexample_009.phpexample_010.phpexample_011.phpexample_012.pdfexample_012.phpexample_013.phpexample_014.phpexample_015.phpexample_016.phpexample_017.phpexample_018.phpexample_019.phpexample_020.phpexample_021.phpexample_022.phpexample_023.phpexample_024.phpexample_025.phpexample_026.phpexample_027.phpexample_028.phpexample_029.phpexample_030.phpexample_031.phpexample_032.phpexample_033.phpexample_034.phpexample_035.phpexample_036.phpexample_037.phpexample_038.phpexample_039.phpexample_040.phpexample_041.phpexample_042.phpexample_043.phpexample_044.phpexample_045.phpexample_046.phpexample_047.phpexample_048.phpexample_049.phpexample_050.phpexample_051.phpexample_052.phpexample_053.phpexample_054.phpexample_055.phpexample_056.phpexample_057.phpexample_058.phpexample_059.phpexample_060.phpexample_061.phpexample_062.phpexample_063.phpexample_064.phpexample_065.php
images
index.php
lang
tcpdf_include.php
fonts
ae_fonts_2.0
aealarabiya.ctg.zaealarabiya.phpaealarabiya.zaefurat.ctg.zaefurat.phpaefurat.zcid0cs.phpcid0ct.phpcid0jp.phpcid0kr.phpcourier.phpcourierb.phpcourierbi.phpcourieri.php
dejavu-fonts-ttf-2.33
dejavusans.ctg.zdejavusans.phpdejavusans.zdejavusansb.ctg.zdejavusansb.phpdejavusansb.zdejavusansbi.ctg.zdejavusansbi.phpdejavusansbi.zdejavusanscondensed.ctg.zdejavusanscondensed.phpdejavusanscondensed.zdejavusanscondensedb.ctg.zdejavusanscondensedb.phpdejavusanscondensedb.zdejavusanscondensedbi.ctg.zdejavusanscondensedbi.phpdejavusanscondensedbi.zdejavusanscondensedi.ctg.zdejavusanscondensedi.phpdejavusanscondensedi.zdejavusansextralight.ctg.zdejavusansextralight.phpdejavusansextralight.zdejavusansi.ctg.zdejavusansi.phpdejavusansi.zdejavusansmono.ctg.zdejavusansmono.phpdejavusansmono.zdejavusansmonob.ctg.zdejavusansmonob.phpdejavusansmonob.zdejavusansmonobi.ctg.zdejavusansmonobi.phpdejavusansmonobi.zdejavusansmonoi.ctg.zdejavusansmonoi.phpdejavusansmonoi.zdejavuserif.ctg.zdejavuserif.phpdejavuserif.zdejavuserifb.ctg.zdejavuserifb.phpdejavuserifb.zdejavuserifbi.ctg.zdejavuserifbi.phpdejavuserifbi.zdejavuserifcondensed.ctg.zdejavuserifcondensed.phpdejavuserifcondensed.zdejavuserifcondensedb.ctg.zdejavuserifcondensedb.phpdejavuserifcondensedb.zdejavuserifcondensedbi.ctg.zdejavuserifcondensedbi.phpdejavuserifcondensedbi.zdejavuserifcondensedi.ctg.zdejavuserifcondensedi.phpdejavuserifcondensedi.zdejavuserifi.ctg.zdejavuserifi.phpdejavuserifi.z
freefont-20120503
freemono.ctg.zfreemono.phpfreemono.zfreemonob.ctg.zfreemonob.phpfreemonob.zfreemonobi.ctg.zfreemonobi.phpfreemonobi.zfreemonoi.ctg.zfreemonoi.phpfreemonoi.zfreesans.ctg.zfreesans.phpfreesans.zfreesansb.ctg.zfreesansb.phpfreesansb.zfreesansbi.ctg.zfreesansbi.phpfreesansbi.zfreesansi.ctg.zfreesansi.phpfreesansi.zfreeserif.ctg.zfreeserif.phpfreeserif.zfreeserifb.ctg.zfreeserifb.phpfreeserifb.zfreeserifbi.ctg.zfreeserifbi.phpfreeserifbi.zfreeserifi.ctg.zfreeserifi.phpfreeserifi.zhelvetica.phphelveticab.phphelveticabi.phphelveticai.phphysmyeongjostdmedium.phpkozgopromedium.phpkozminproregular.phpmsungstdlight.phppdfacourier.phppdfacourier.zpdfacourierb.phppdfacourierb.zpdfacourierbi.phppdfacourierbi.zpdfacourieri.phppdfacourieri.zpdfahelvetica.phppdfahelvetica.zpdfahelveticab.phppdfahelveticab.zpdfahelveticabi.phppdfahelveticabi.zpdfahelveticai.phppdfahelveticai.zpdfasymbol.phppdfasymbol.zpdfatimes.phppdfatimes.zpdfatimesb.phppdfatimesb.zpdfatimesbi.phppdfatimesbi.zpdfatimesi.phppdfatimesi.zpdfazapfdingbats.phppdfazapfdingbats.zstsongstdlight.phpsymbol.phptimes.phptimesb.phptimesbi.phptimesi.phpuni2cid_ac15.phpuni2cid_ag15.phpuni2cid_aj16.phpuni2cid_ak12.phpzapfdingbats.php
include
tcpdf.phptcpdf_autoconfig.phptcpdf_barcodes_1d.phptcpdf_barcodes_2d.phptcpdf_import.phptcpdf_parser.php
tools
video_js
README.mdacceuil-aide-en.htmlacceuil-aide-fr.htmlaction.phpaide.phpamis.phpapi.phparchive_private_chat.php
assets
audio
css
SpryMenuBar
SpryTabbedPanels.cssSpryTooltip.cssSpryValidationTextField.csschat.cssglobal.cssglobal.phpglobal_notifications.cssgrand_dialogue_smiley.cssheader_global.cssiconFont_2.cssie.css
imgareaselect
index.phpjquery.mobile-1.3.0.min.css
less
metro-bootstrap-responsive_2.cssmetro-bootstrap_2.cssmetro-icons_3.cssmetro_3.cssminifyURL.cssmobile-metro.cssmobile.cssprivate_chat_contener.cssprivatechat.css
themes
base
images
index.phpjquery-ui.cssjquery.ui.accordion.cssjquery.ui.all.cssjquery.ui.autocomplete.cssjquery.ui.base.cssjquery.ui.button.cssjquery.ui.core.cssjquery.ui.datepicker.cssjquery.ui.dialog.cssjquery.ui.menu.cssjquery.ui.progressbar.cssjquery.ui.resizable.cssjquery.ui.selectable.cssjquery.ui.slider.cssjquery.ui.spinner.cssjquery.ui.tabs.cssjquery.ui.theme.cssjquery.ui.tooltip.css
minified
index.php
warning_update.css
fonts
html
img
accepte_webcam.jpgaccepte_webcam_vide.jpg
acceuil
activer_webcam.pngadd_text.gifaime.pngaime_vide.pngaimeplus.pngbannercucc.gifbullet_arrow_right.pngbyethost.pngcapatcha.pngchargement.gifclose.gifcomments.pngcomunic_share_small_button_fr.jpgdelete.pngdelete_user.pngdiscover_comunic_modifie.pngdiscover_comunic_vierge.pngdiscover_private_chat.pngdisponible.pngecranvide.pngecranvide_old.pngedit.pngemail.png
ensembles
erreur.pngexclamation.png
fancybox
favicon.icofavicon_64.icofile_extension_pdf.pngformulaire_recherche.pngfrance.pnghelp.pnghelp_big.pnghome_login_background.pngimage_delete.pngimage_edit.png
img_actualite
index.phpindisponible.pnginterrogation.pnglock.pnglogo-facebook.pnglogo-youtube.pnglogo_comunic.pnglogo_comunic_services.pnglogoacceuil.jpglogomoderne.jpgmail_green.pngmini_logo_comunic.pngnew.pngnotification_old.pngnouveaute_user.pngpage_add.pngprendre_photo.pngpresentationrapide.pngpresentationrapide_old.pngprive.png
ps
raspberry-pi-logo.pngrefresh.pngsafe.pngsearch_accounts.pngset_password.pngshare.pngsharecomunic.png
small
smiley
anchor.pngandroid.pngapple.pngattach.pngaward_star_gold_green.pngbad.gifbeer.pngbell.pngbomb.pngbook.pngbook_open.pngbug.pngbus.pngcake.pngcamera_black.pngcd.pngcomputer.pngdevil_smile.gifemail.pngemotion_bigsmile.pngemotion_party.png
flag
flag_afghanistan.pngflag_albania.pngflag_algeria.pngflag_american_samoa.pngflag_andorra.pngflag_angola.pngflag_anguilla.pngflag_antigua_and_barbuda.pngflag_argentina.pngflag_armenia.pngflag_aruba.pngflag_australia.pngflag_austria.pngflag_azerbaijan.pngflag_bahamas.pngflag_bahrain.pngflag_bangladesh.pngflag_barbados.pngflag_belarus.pngflag_belgium.pngflag_belize.pngflag_benin.pngflag_bermuda.pngflag_bhutan.pngflag_bolivia.pngflag_bosnia.pngflag_botswana.pngflag_boy_scout.pngflag_brazil.pngflag_british_indian_ocean.pngflag_british_virgin_islands.pngflag_brunei.pngflag_bulgaria.pngflag_burkina_faso.pngflag_burma.pngflag_burundi.pngflag_cambodia.pngflag_cameroon.pngflag_canada.pngflag_cape_verde.pngflag_cayman_islands.pngflag_central_african_republic.pngflag_chad.pngflag_chile.pngflag_china.pngflag_colombia.pngflag_comoros.pngflag_congo_democratic_republic.pngflag_congo_republic.pngflag_cook_islands.pngflag_costa_rica.pngflag_cote_divoire.pngflag_croatia.pngflag_cuba.pngflag_cyprus.pngflag_czech_republic.pngflag_denmark.pngflag_djibouti.pngflag_dominica.pngflag_dominican_republic.pngflag_east_timor.pngflag_egypt.pngflag_el_salvador.pngflag_england.pngflag_equador.pngflag_equatorial_guinea.pngflag_eritrea.pngflag_estonia.pngflag_ethiopia.pngflag_european_union.pngflag_falkland_islands.pngflag_faroe_islands.pngflag_fiji.pngflag_finish.pngflag_finland.pngflag_france.pngflag_french_polynesia.pngflag_gabon.pngflag_gambia.pngflag_georgia.pngflag_germany.pngflag_ghana.pngflag_gibraltar.pngflag_great_britain.pngflag_greece.pngflag_greenland.pngflag_grenada.pngflag_guam.pngflag_guatemala.pngflag_guernsey.pngflag_guinea.pngflag_guinea_bissau.pngflag_guyana.pngflag_haiti.pngflag_honduras.pngflag_hong_kong.pngflag_hot.pngflag_hungary.pngflag_iceland.pngflag_india.pngflag_indonesia.pngflag_iran.pngflag_iraq.pngflag_ireland.pngflag_isle_of_man.pngflag_israel.pngflag_italy.pngflag_jamaica.pngflag_japan.pngflag_jersey.pngflag_jordan.pngflag_kazakhstan.pngflag_kenya.pngflag_kiribati.pngflag_kuwait.pngflag_kyrgyzstan.pngflag_laos.pngflag_latvia.pngflag_lebanon.pngflag_lesotho.pngflag_liberia.pngflag_libya.pngflag_liechtenstein.pngflag_lithuania.pngflag_luxembourg.pngflag_macau.pngflag_macedonia.pngflag_madagascar.pngflag_malawi.pngflag_malaysia.pngflag_maledives.pngflag_mali.pngflag_malta.pngflag_marshall_islands.pngflag_martinique.pngflag_mauretania.pngflag_mauritius.pngflag_mexico.pngflag_micronesia.pngflag_moldova.pngflag_monaco.pngflag_mongolia.pngflag_montserrat.pngflag_morocco.pngflag_mozambique.pngflag_namibia.pngflag_nato.pngflag_nauru.pngflag_nepal.pngflag_netherlands.pngflag_netherlands_antilles.pngflag_new.pngflag_new_zealand.pngflag_nicaragua.pngflag_niger.pngflag_nigeria.pngflag_niue.pngflag_norfolk_islands.pngflag_north_korea.pngflag_northern_mariana_islands.pngflag_norway.pngflag_olympic.pngflag_oman.pngflag_pakistan.pngflag_palau.pngflag_panama.pngflag_papua_new_guinea.pngflag_paraquay.pngflag_peru.pngflag_philippines.pngflag_pitcairn_islands.pngflag_poland.pngflag_portugal.pngflag_puerto_rico.pngflag_qatar.pngflag_red_cross.pngflag_red_dull.pngflag_romania.pngflag_russia.pngflag_rwanda.pngflag_saint_helena.pngflag_saint_kitts_and_nevis.pngflag_saint_lucia.pngflag_saint_pierre_and_miquelon.pngflag_saint_vincent_and_grenadines.pngflag_samoa.pngflag_san_marino.pngflag_sao_tome_and_principe.pngflag_saudi_arabia.pngflag_scotland.pngflag_senegal.pngflag_serbia_montenegro.pngflag_seychelles.pngflag_sierra_leone.pngflag_singapore.pngflag_slovakia.pngflag_slovenia.pngflag_solomon_islands.pngflag_somalia.pngflag_south_africa.pngflag_south_georgia.pngflag_south_korea.pngflag_spain.pngflag_sri_lanka.pngflag_sudan.pngflag_suriname.pngflag_swaziland.pngflag_sweden.pngflag_switzerland.pngflag_syria.pngflag_taiwan.pngflag_tajikistan.pngflag_tanzania.pngflag_thailand.pngflag_tibet.pngflag_togo.pngflag_tonga.pngflag_trinidad_and_tobago.pngflag_tunisia.pngflag_turkey.pngflag_turkmenistan.pngflag_turks_and_caicos_islands.pngflag_tuvalu.pngflag_uganda.pngflag_ukraine.pngflag_unesco.pngflag_united_arab_emirates.pngflag_united_nations.pngflag_uruquay.pngflag_usa.pngflag_uzbekistan.pngflag_vanuatu.pngflag_vatican_city.pngflag_venezuela.pngflag_vietnam.pngflag_virgin_islands.pngflag_wales.pngflag_wallis_and_futuna.pngflag_wto.pngflag_wwf.pngflag_yemen.pngflag_zambia.pngflag_zimbabwe.png
flower.pnggood.gifheart.pngheart_break.pngindex.phplaptop.pnglogo_comunic.pnglogo_smiley.pngmap.pngmicrophone.pngmoney_dollar.pngmovies.pngmusic.pngphone.pngpizza.pngrain.pngsmile.gifsmile_gris.gifsmiley-cool.gifsmiley-cry.gifsmiley-laughing.gifsmiley-sealed.gifsmiley-surprised.gifsmiley-tongue-out.gifsmiley-yell.gifstar.pngsun.pngtea_cup.pngteddy_bear.pngtick.pngtime.pngtree.pngubuntu.pnguser.pnguser_king.pngvlc.pngwhat.png
succes.pngsupp.pngtext_list_numbers.pngthumb_up.pngtick.png
tuile
usa.pnguser.pnguser_add.pngusers_3.pngusers_5.pngvoir.pngwait.gifwarning_update.pngwebcam.pngworld.png
js
SpryTabbedPanels.jsSpryTooltip.jsSpryValidationTextField.jsaide_smiley.jsajoutevolue.jsajoutsimple.jsamisajax.jsavertissement_console.jschat.jscommentairesmobile.jsconfirmdeleteaccount.jscountdown.jscountdown_countdown.js.jsglobal.jsglobal.phpglobal_ie.jsgrand_dialogue_smiley.jsgroupes.jsheader_global.js
holder
imgareaselect
index.phpinitialise_fancybox.js
ipwEditor
jquery-1.8.3.jsjquery-1.8.3.min.jsjquery-1.9.1.jsjquery-ui-1.9.2.custom.jsjquery.ui.autocomplete.jsjquery.ui.core.jsjquery.ui.dialog.jsjquery.ui.draggable.jsjquery.ui.menu.jsjquery.ui.mouse.jsjquery.ui.position.jsjquery.ui.tabs.jsjquery.ui.widget.js
jquery
liste_smile.jsload-metro_2.js
metro
metro_2.min.jsmetro_3.jspanneau_private_chat.jspostcommentaire.js
prettify
private_chat.js
tiny_mce
langs
license.txt
plugins
advhr
advimage
advlink
advlist
autolink
autoresize
autosave
bbcode
contextmenu
directionality
emotions
example
example_dependency
fullpage
fullscreen
iespell
inlinepopups
insertdatetime
layer
legacyoutput
lists
media
nonbreaking
noneditable
pagebreak
paste
preview
print
save
searchreplace
spellchecker
style
tabfocus
table
template
visualblocks
visualchars
wordcount
xhtmlxtras
themes
tiny_mce.jstiny_mce_popup.jstiny_mce_src.js
utils
webrtc_main.js
legal
browserconfig.xmlchat.phpcommentaire.phpconnecter.phpconnexiondb.phpcreercompte.phpdeconnexion.php
developer
.htaccessCHANGELOG.mdCONTRIBUTING.mdLICENSE.txtREADME.md
assets
backup
bin
composer.jsoncomposer.lock
images
index.php
logs
robots.txt
system
assets
blueprints
config
defines.php
images
languages
pages
src
Grav
Common
Assets.php
Backup
Browser.phpCache.phpComposer.php
Config
Data
Debugger.php
Errors
File
Filesystem
GPM
Getters.phpGrav.phpGravTrait.php
Helpers
Inflector.phpIterator.php
Language
Markdown
Page
Plugin.phpPlugins.php
Processors
Service
Session.phpTaxonomy.phpTheme.phpThemes.php
Twig
Uri.php
User
Utils.php
Console
tmp
user
accounts
config
data
pages
01.home
02.tools
03.getComunic
04.default
plugins
themes
.gitkeep
antimatter
CHANGELOG.mdLICENSEREADME.mdantimatter.phpantimatter.yaml
assets
blueprints.yaml
blueprints
css-compiled
css
fonts
googleFonts
images
js
languages.yamlscreenshot.jpgscss.sh
scss
configuration
nucleus.scss
nucleus
particles.scsstemplate.scss
template
vendor
bourbon
color-schemer
templates
thumbnail.jpg
vendor
antoligy
autoload.php
composer
doctrine
donatj
erusev
filp
gregwar
league
matthiasmullie
maximebf
monolog
monolog
.php_csCHANGELOG.mdownLICENSEREADME.mdown
src
Monolog
ErrorHandler.php
Formatter
Handler
Logger.php
Processor
Registry.php
pimple
psr
rockettheme
seld
symfony
console
event-dispatcher
polyfill-iconv
polyfill-mbstring
var-dumper
yaml
twig
twig
CHANGELOGLICENSEREADME.rst
lib
Twig
Autoloader.phpBaseNodeVisitor.php
Cache
CacheInterface.phpCompiler.phpCompilerInterface.phpEnvironment.phpError.php
Error
ExistsLoaderInterface.phpExpressionParser.phpExtension.php
Extension
ExtensionInterface.phpFileExtensionEscapingStrategy.phpFilter.php
Filter
FilterCallableInterface.phpFilterInterface.phpFunction.php
Function
FunctionCallableInterface.phpFunctionInterface.phpLexer.phpLexerInterface.php
Loader
LoaderInterface.phpMarkup.phpNode.php
Node
NodeInterface.phpNodeOutputInterface.phpNodeTraverser.php
NodeVisitor
NodeVisitorInterface.phpParser.phpParserInterface.php
Profiler
Sandbox
SimpleFilter.phpSimpleFunction.phpSimpleTest.phpTemplate.phpTemplateInterface.phpTest.php
Test
TestCallableInterface.phpTestInterface.phpToken.phpTokenParser.php
TokenParser
TokenParserBroker.phpTokenParserBrokerInterface.phpTokenParserInterface.phpTokenStream.php
Util
webserver-configs
doc
exportdonnees.phpgalerie_videos.phpgalerieimages.phpimgcommentaire.php
inc
.htaccess404.htmlaccount_created.phpadd_comunic_as_search_engine.phpajax_search_users.php
api
change_avatar_webcam.phpchange_hauteur_chat.phpchange_niveau_visibilite_post.phpcode_session_private_chat.php
config
conversations_private_chat.php
core
delete_avatar_img_background.phpdelete_old_notifications.phpdelete_request_become_friend.phpedit_commentaire.htmledit_niveau_visibilite.htmledit_nom_video.htmleffectuer_maintenance_account.phpenvoi_mail.php
functions
generate_pdf.phpgere_abonnement_ami.phpgestion_piwik.phpheader_page.php
helpers
index.phpinitPage.php
lang
like_comment.phplike_external_page.phplike_texte_page.phpliste_descriptions.phpliste_smile.phpload.htmlloading.htmllogout_with_roundcube.htmlmanage_flux.htmlmenu_contextuel.phpmessage_fil_vu.phpmessage_update.htmlnettoyage_automatique_notifications.phpouvre_ferme_session_chat.php
pages
private_chat.phpshow_hide_private_chat_contener.phpsmile_javascript.phpsupp_commentaire_id.htmlsupp_commentaire_id.phpupload_video.phpupload_video_suite.phpvideo_type_allowed_list.phpvote_sondage.php
index.phplisteamis.phpmessagerie.php
minifyurl
notification.phpnotification_old.phpparametres.phpprivatechat.phpr.phprobots.txtrss.phpsecurite.phpsitemap.xmlsolvepassword.phpsuppcompte.php
tools
3rdparty
assets
index.phpmenu.php
nobin
speaker
svgedit
browser-not-supported.htmlbrowser.js
canvg
config-sample.jscontextmenu.js
contextmenu
coords.jsdraw.jsembedapi-dom.jsembedapi.htmlembedapi.js
extensions
history.js
images
index.php
jgraduate
jquery-svg.js
jquery-ui
jquery.js
jquerybbq
js-hotkeys
jspdf
locale
math.jspath.jspathseg.jsrecalculate.jssanitize.jsselect.js
spinbtn
svg-editor.csssvg-editor.htmlsvg-editor.jssvg-editor.manifestsvgcanvas.jssvgedit.js
svgicons
svgtransformlist.jssvgutils.jstouch.jsunits.js

@ -0,0 +1,339 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Input;
use Symfony\Component\Console\Exception\RuntimeException;
/**
* ArgvInput represents an input coming from the CLI arguments.
*
* Usage:
*
* $input = new ArgvInput();
*
* By default, the `$_SERVER['argv']` array is used for the input values.
*
* This can be overridden by explicitly passing the input values in the constructor:
*
* $input = new ArgvInput($_SERVER['argv']);
*
* If you pass it yourself, don't forget that the first element of the array
* is the name of the running application.
*
* When passing an argument to the constructor, be sure that it respects
* the same rules as the argv one. It's almost always better to use the
* `StringInput` when you want to provide your own input.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
* @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
*/
class ArgvInput extends Input
{
private $tokens;
private $parsed;
/**
* Constructor.
*
* @param array|null $argv An array of parameters from the CLI (in the argv format)
* @param InputDefinition|null $definition A InputDefinition instance
*/
public function __construct(array $argv = null, InputDefinition $definition = null)
{
if (null === $argv) {
$argv = $_SERVER['argv'];
}
// strip the application name
array_shift($argv);
$this->tokens = $argv;
parent::__construct($definition);
}
protected function setTokens(array $tokens)
{
$this->tokens = $tokens;
}
/**
* {@inheritdoc}
*/
protected function parse()
{
$parseOptions = true;
$this->parsed = $this->tokens;
while (null !== $token = array_shift($this->parsed)) {
if ($parseOptions && '' == $token) {
$this->parseArgument($token);
} elseif ($parseOptions && '--' == $token) {
$parseOptions = false;
} elseif ($parseOptions && 0 === strpos($token, '--')) {
$this->parseLongOption($token);
} elseif ($parseOptions && '-' === $token[0] && '-' !== $token) {
$this->parseShortOption($token);
} else {
$this->parseArgument($token);
}
}
}
/**
* Parses a short option.
*
* @param string $token The current token
*/
private function parseShortOption($token)
{
$name = substr($token, 1);
if (strlen($name) > 1) {
if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) {
// an option with a value (with no space)
$this->addShortOption($name[0], substr($name, 1));
} else {
$this->parseShortOptionSet($name);
}
} else {
$this->addShortOption($name, null);
}
}
/**
* Parses a short option set.
*
* @param string $name The current token
*
* @throws RuntimeException When option given doesn't exist
*/
private function parseShortOptionSet($name)
{
$len = strlen($name);
for ($i = 0; $i < $len; ++$i) {
if (!$this->definition->hasShortcut($name[$i])) {
throw new RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i]));
}
$option = $this->definition->getOptionForShortcut($name[$i]);
if ($option->acceptValue()) {
$this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1));
break;
} else {
$this->addLongOption($option->getName(), null);
}
}
}
/**
* Parses a long option.
*
* @param string $token The current token
*/
private function parseLongOption($token)
{
$name = substr($token, 2);
if (false !== $pos = strpos($name, '=')) {
$this->addLongOption(substr($name, 0, $pos), substr($name, $pos + 1));
} else {
$this->addLongOption($name, null);
}
}
/**
* Parses an argument.
*
* @param string $token The current token
*
* @throws RuntimeException When too many arguments are given
*/
private function parseArgument($token)
{
$c = count($this->arguments);
// if input is expecting another argument, add it
if ($this->definition->hasArgument($c)) {
$arg = $this->definition->getArgument($c);
$this->arguments[$arg->getName()] = $arg->isArray() ? array($token) : $token;
// if last argument isArray(), append token to last argument
} elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) {
$arg = $this->definition->getArgument($c - 1);
$this->arguments[$arg->getName()][] = $token;
// unexpected argument
} else {
$all = $this->definition->getArguments();
if (count($all)) {
throw new RuntimeException(sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))));
}
throw new RuntimeException(sprintf('No arguments expected, got "%s".', $token));
}
}
/**
* Adds a short option value.
*
* @param string $shortcut The short option key
* @param mixed $value The value for the option
*
* @throws RuntimeException When option given doesn't exist
*/
private function addShortOption($shortcut, $value)
{
if (!$this->definition->hasShortcut($shortcut)) {
throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut));
}
$this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value);
}
/**
* Adds a long option value.
*
* @param string $name The long option key
* @param mixed $value The value for the option
*
* @throws RuntimeException When option given doesn't exist
*/
private function addLongOption($name, $value)
{
if (!$this->definition->hasOption($name)) {
throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name));
}
$option = $this->definition->getOption($name);
// Convert empty values to null
if (!isset($value[0])) {
$value = null;
}
if (null !== $value && !$option->acceptValue()) {
throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name));
}
if (null === $value && $option->acceptValue() && count($this->parsed)) {
// if option accepts an optional or mandatory argument
// let's see if there is one provided
$next = array_shift($this->parsed);
if (isset($next[0]) && '-' !== $next[0]) {
$value = $next;
} elseif (empty($next)) {
$value = '';
} else {
array_unshift($this->parsed, $next);
}
}
if (null === $value) {
if ($option->isValueRequired()) {
throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name));
}
if (!$option->isArray()) {
$value = $option->isValueOptional() ? $option->getDefault() : true;
}
}
if ($option->isArray()) {
$this->options[$name][] = $value;
} else {
$this->options[$name] = $value;
}
}
/**
* {@inheritdoc}
*/
public function getFirstArgument()
{
foreach ($this->tokens as $token) {
if ($token && '-' === $token[0]) {
continue;
}
return $token;
}
}
/**
* {@inheritdoc}
*/
public function hasParameterOption($values)
{
$values = (array) $values;
foreach ($this->tokens as $token) {
foreach ($values as $value) {
if ($token === $value || 0 === strpos($token, $value.'=')) {
return true;
}
}
}
return false;
}
/**
* {@inheritdoc}
*/
public function getParameterOption($values, $default = false)
{
$values = (array) $values;
$tokens = $this->tokens;
while (0 < count($tokens)) {
$token = array_shift($tokens);
foreach ($values as $value) {
if ($token === $value || 0 === strpos($token, $value.'=')) {
if (false !== $pos = strpos($token, '=')) {
return substr($token, $pos + 1);
}
return array_shift($tokens);
}
}
}
return $default;
}
/**
* Returns a stringified representation of the args passed to the command.
*
* @return string
*/
public function __toString()
{
$self = $this;
$tokens = array_map(function ($token) use ($self) {
if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) {
return $match[1].$self->escapeToken($match[2]);
}
if ($token && $token[0] !== '-') {
return $self->escapeToken($token);
}
return $token;
}, $this->tokens);
return implode(' ', $tokens);
}
}

@ -0,0 +1,193 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Input;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\InvalidOptionException;
/**
* ArrayInput represents an input provided as an array.
*
* Usage:
*
* $input = new ArrayInput(array('name' => 'foo', '--bar' => 'foobar'));
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class ArrayInput extends Input
{
private $parameters;
/**
* Constructor.
*
* @param array $parameters An array of parameters
* @param InputDefinition|null $definition A InputDefinition instance
*/
public function __construct(array $parameters, InputDefinition $definition = null)
{
$this->parameters = $parameters;
parent::__construct($definition);
}
/**
* {@inheritdoc}
*/
public function getFirstArgument()
{
foreach ($this->parameters as $key => $value) {
if ($key && '-' === $key[0]) {
continue;
}
return $value;
}
}
/**
* {@inheritdoc}
*/
public function hasParameterOption($values)
{
$values = (array) $values;
foreach ($this->parameters as $k => $v) {
if (!is_int($k)) {
$v = $k;
}
if (in_array($v, $values)) {
return true;
}
}
return false;
}
/**
* {@inheritdoc}
*/
public function getParameterOption($values, $default = false)
{
$values = (array) $values;
foreach ($this->parameters as $k => $v) {
if (is_int($k)) {
if (in_array($v, $values)) {
return true;
}
} elseif (in_array($k, $values)) {
return $v;
}
}
return $default;
}
/**
* Returns a stringified representation of the args passed to the command.
*
* @return string
*/
public function __toString()
{
$params = array();
foreach ($this->parameters as $param => $val) {
if ($param && '-' === $param[0]) {
$params[] = $param.('' != $val ? '='.$this->escapeToken($val) : '');
} else {
$params[] = $this->escapeToken($val);
}
}
return implode(' ', $params);
}
/**
* {@inheritdoc}
*/
protected function parse()
{
foreach ($this->parameters as $key => $value) {
if (0 === strpos($key, '--')) {
$this->addLongOption(substr($key, 2), $value);
} elseif ('-' === $key[0]) {
$this->addShortOption(substr($key, 1), $value);
} else {
$this->addArgument($key, $value);
}
}
}
/**
* Adds a short option value.
*
* @param string $shortcut The short option key
* @param mixed $value The value for the option
*
* @throws InvalidOptionException When option given doesn't exist
*/
private function addShortOption($shortcut, $value)
{
if (!$this->definition->hasShortcut($shortcut)) {
throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut));
}
$this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value);
}
/**
* Adds a long option value.
*
* @param string $name The long option key
* @param mixed $value The value for the option
*
* @throws InvalidOptionException When option given doesn't exist
* @throws InvalidOptionException When a required value is missing
*/
private function addLongOption($name, $value)
{
if (!$this->definition->hasOption($name)) {
throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name));
}
$option = $this->definition->getOption($name);
if (null === $value) {
if ($option->isValueRequired()) {
throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name));
}
$value = $option->isValueOptional() ? $option->getDefault() : true;
}
$this->options[$name] = $value;
}
/**
* Adds an argument value.
*
* @param string $name The argument name
* @param mixed $value The value for the argument
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
private function addArgument($name, $value)
{
if (!$this->definition->hasArgument($name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
$this->arguments[$name] = $value;
}
}

@ -0,0 +1,194 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Input;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\RuntimeException;
/**
* Input is the base class for all concrete Input classes.
*
* Three concrete classes are provided by default:
*
* * `ArgvInput`: The input comes from the CLI arguments (argv)
* * `StringInput`: The input is provided as a string
* * `ArrayInput`: The input is provided as an array
*
* @author Fabien Potencier <fabien@symfony.com>
*/
abstract class Input implements InputInterface
{
/**
* @var InputDefinition
*/
protected $definition;
protected $options = array();
protected $arguments = array();
protected $interactive = true;
/**
* Constructor.
*
* @param InputDefinition|null $definition A InputDefinition instance
*/
public function __construct(InputDefinition $definition = null)
{
if (null === $definition) {
$this->definition = new InputDefinition();
} else {
$this->bind($definition);
$this->validate();
}
}
/**
* {@inheritdoc}
*/
public function bind(InputDefinition $definition)
{
$this->arguments = array();
$this->options = array();
$this->definition = $definition;
$this->parse();
}
/**
* Processes command line arguments.
*/
abstract protected function parse();
/**
* {@inheritdoc}
*/
public function validate()
{
$definition = $this->definition;
$givenArguments = $this->arguments;
$missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) {
return !array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired();
});
if (count($missingArguments) > 0) {
throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments)));
}
}
/**
* {@inheritdoc}
*/
public function isInteractive()
{
return $this->interactive;
}
/**
* {@inheritdoc}
*/
public function setInteractive($interactive)
{
$this->interactive = (bool) $interactive;
}
/**
* {@inheritdoc}
*/
public function getArguments()
{
return array_merge($this->definition->getArgumentDefaults(), $this->arguments);
}
/**
* {@inheritdoc}
*/
public function getArgument($name)
{
if (!$this->definition->hasArgument($name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name)->getDefault();
}
/**
* {@inheritdoc}
*/
public function setArgument($name, $value)
{
if (!$this->definition->hasArgument($name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
$this->arguments[$name] = $value;
}
/**
* {@inheritdoc}
*/
public function hasArgument($name)
{
return $this->definition->hasArgument($name);
}
/**
* {@inheritdoc}
*/
public function getOptions()
{
return array_merge($this->definition->getOptionDefaults(), $this->options);
}
/**
* {@inheritdoc}
*/
public function getOption($name)
{
if (!$this->definition->hasOption($name)) {
throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
}
return isset($this->options[$name]) ? $this->options[$name] : $this->definition->getOption($name)->getDefault();
}
/**
* {@inheritdoc}
*/
public function setOption($name, $value)
{
if (!$this->definition->hasOption($name)) {
throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
}
$this->options[$name] = $value;
}
/**
* {@inheritdoc}
*/
public function hasOption($name)
{
return $this->definition->hasOption($name);
}
/**
* Escapes a token through escapeshellarg if it contains unsafe chars.
*
* @param string $token
*
* @return string
*/
public function escapeToken($token)
{
return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token);
}
}

@ -0,0 +1,131 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Input;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\LogicException;
/**
* Represents a command line argument.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class InputArgument
{
const REQUIRED = 1;
const OPTIONAL = 2;
const IS_ARRAY = 4;
private $name;
private $mode;
private $default;
private $description;
/**
* Constructor.
*
* @param string $name The argument name
* @param int $mode The argument mode: self::REQUIRED or self::OPTIONAL
* @param string $description A description text
* @param mixed $default The default value (for self::OPTIONAL mode only)
*
* @throws InvalidArgumentException When argument mode is not valid
*/
public function __construct($name, $mode = null, $description = '', $default = null)
{
if (null === $mode) {
$mode = self::OPTIONAL;
} elseif (!is_int($mode) || $mode > 7 || $mode < 1) {
throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode));
}
$this->name = $name;
$this->mode = $mode;
$this->description = $description;
$this->setDefault($default);
}
/**
* Returns the argument name.
*
* @return string The argument name
*/
public function getName()
{
return $this->name;
}
/**
* Returns true if the argument is required.
*
* @return bool true if parameter mode is self::REQUIRED, false otherwise
*/
public function isRequired()
{
return self::REQUIRED === (self::REQUIRED & $this->mode);
}
/**
* Returns true if the argument can take multiple values.
*
* @return bool true if mode is self::IS_ARRAY, false otherwise
*/
public function isArray()
{
return self::IS_ARRAY === (self::IS_ARRAY & $this->mode);
}
/**
* Sets the default value.
*
* @param mixed $default The default value
*
* @throws LogicException When incorrect default value is given
*/
public function setDefault($default = null)
{
if (self::REQUIRED === $this->mode && null !== $default) {
throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.');
}
if ($this->isArray()) {
if (null === $default) {
$default = array();
} elseif (!is_array($default)) {
throw new LogicException('A default value for an array argument must be an array.');
}
}
$this->default = $default;
}
/**
* Returns the default value.
*
* @return mixed The default value
*/
public function getDefault()
{
return $this->default;
}
/**
* Returns the description text.
*
* @return string The description text
*/
public function getDescription()
{
return $this->description;
}
}

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Input;
/**
* InputAwareInterface should be implemented by classes that depends on the
* Console Input.
*
* @author Wouter J <waldio.webdesign@gmail.com>
*/
interface InputAwareInterface
{
/**
* Sets the Console Input.
*
* @param InputInterface
*/
public function setInput(InputInterface $input);
}

@ -0,0 +1,457 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Input;
use Symfony\Component\Console\Descriptor\TextDescriptor;
use Symfony\Component\Console\Descriptor\XmlDescriptor;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\LogicException;
/**
* A InputDefinition represents a set of valid command line arguments and options.
*
* Usage:
*
* $definition = new InputDefinition(array(
* new InputArgument('name', InputArgument::REQUIRED),
* new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
* ));
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class InputDefinition
{
private $arguments;
private $requiredCount;
private $hasAnArrayArgument = false;
private $hasOptional;
private $options;
private $shortcuts;
/**
* Constructor.
*
* @param array $definition An array of InputArgument and InputOption instance
*/
public function __construct(array $definition = array())
{
$this->setDefinition($definition);
}
/**
* Sets the definition of the input.
*
* @param array $definition The definition array
*/
public function setDefinition(array $definition)
{
$arguments = array();
$options = array();
foreach ($definition as $item) {
if ($item instanceof InputOption) {
$options[] = $item;
} else {
$arguments[] = $item;
}
}
$this->setArguments($arguments);
$this->setOptions($options);
}
/**
* Sets the InputArgument objects.
*
* @param InputArgument[] $arguments An array of InputArgument objects
*/
public function setArguments($arguments = array())
{
$this->arguments = array();
$this->requiredCount = 0;
$this->hasOptional = false;
$this->hasAnArrayArgument = false;
$this->addArguments($arguments);
}
/**
* Adds an array of InputArgument objects.
*
* @param InputArgument[] $arguments An array of InputArgument objects
*/
public function addArguments($arguments = array())
{
if (null !== $arguments) {
foreach ($arguments as $argument) {
$this->addArgument($argument);
}
}
}
/**
* Adds an InputArgument object.
*
* @param InputArgument $argument An InputArgument object
*
* @throws LogicException When incorrect argument is given
*/
public function addArgument(InputArgument $argument)
{
if (isset($this->arguments[$argument->getName()])) {
throw new LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName()));
}
if ($this->hasAnArrayArgument) {
throw new LogicException('Cannot add an argument after an array argument.');
}
if ($argument->isRequired() && $this->hasOptional) {
throw new LogicException('Cannot add a required argument after an optional one.');
}
if ($argument->isArray()) {
$this->hasAnArrayArgument = true;
}
if ($argument->isRequired()) {
++$this->requiredCount;
} else {
$this->hasOptional = true;
}
$this->arguments[$argument->getName()] = $argument;
}
/**
* Returns an InputArgument by name or by position.
*
* @param string|int $name The InputArgument name or position
*
* @return InputArgument An InputArgument object
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
public function getArgument($name)
{
if (!$this->hasArgument($name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
$arguments = is_int($name) ? array_values($this->arguments) : $this->arguments;
return $arguments[$name];
}
/**
* Returns true if an InputArgument object exists by name or position.
*
* @param string|int $name The InputArgument name or position
*
* @return bool true if the InputArgument object exists, false otherwise
*/
public function hasArgument($name)
{
$arguments = is_int($name) ? array_values($this->arguments) : $this->arguments;
return isset($arguments[$name]);
}
/**
* Gets the array of InputArgument objects.
*
* @return InputArgument[] An array of InputArgument objects
*/
public function getArguments()
{
return $this->arguments;
}
/**
* Returns the number of InputArguments.
*
* @return int The number of InputArguments
*/
public function getArgumentCount()
{
return $this->hasAnArrayArgument ? PHP_INT_MAX : count($this->arguments);
}
/**
* Returns the number of required InputArguments.
*
* @return int The number of required InputArguments
*/
public function getArgumentRequiredCount()
{
return $this->requiredCount;
}
/**
* Gets the default values.
*
* @return array An array of default values
*/
public function getArgumentDefaults()
{
$values = array();
foreach ($this->arguments as $argument) {
$values[$argument->getName()] = $argument->getDefault();
}
return $values;
}
/**
* Sets the InputOption objects.
*
* @param InputOption[] $options An array of InputOption objects
*/
public function setOptions($options = array())
{
$this->options = array();
$this->shortcuts = array();
$this->addOptions($options);
}
/**
* Adds an array of InputOption objects.
*
* @param InputOption[] $options An array of InputOption objects
*/
public function addOptions($options = array())
{
foreach ($options as $option) {
$this->addOption($option);
}
}
/**
* Adds an InputOption object.
*
* @param InputOption $option An InputOption object
*
* @throws LogicException When option given already exist
*/
public function addOption(InputOption $option)
{
if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) {
throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName()));
}
if ($option->getShortcut()) {
foreach (explode('|', $option->getShortcut()) as $shortcut) {
if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) {
throw new LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut));
}
}
}
$this->options[$option->getName()] = $option;
if ($option->getShortcut()) {
foreach (explode('|', $option->getShortcut()) as $shortcut) {
$this->shortcuts[$shortcut] = $option->getName();
}
}
}
/**
* Returns an InputOption by name.
*
* @param string $name The InputOption name
*
* @return InputOption A InputOption object
*
* @throws InvalidArgumentException When option given doesn't exist
*/
public function getOption($name)
{
if (!$this->hasOption($name)) {
throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name));
}
return $this->options[$name];
}
/**
* Returns true if an InputOption object exists by name.
*
* @param string $name The InputOption name
*
* @return bool true if the InputOption object exists, false otherwise
*/
public function hasOption($name)
{
return isset($this->options[$name]);
}
/**
* Gets the array of InputOption objects.
*
* @return InputOption[] An array of InputOption objects
*/
public function getOptions()
{
return $this->options;
}
/**
* Returns true if an InputOption object exists by shortcut.
*
* @param string $name The InputOption shortcut
*
* @return bool true if the InputOption object exists, false otherwise
*/
public function hasShortcut($name)
{
return isset($this->shortcuts[$name]);
}
/**
* Gets an InputOption by shortcut.
*
* @param string $shortcut the Shortcut name
*
* @return InputOption An InputOption object
*/
public function getOptionForShortcut($shortcut)
{
return $this->getOption($this->shortcutToName($shortcut));
}
/**
* Gets an array of default values.
*
* @return array An array of all default values
*/
public function getOptionDefaults()
{
$values = array();
foreach ($this->options as $option) {
$values[$option->getName()] = $option->getDefault();
}
return $values;
}
/**
* Returns the InputOption name given a shortcut.
*
* @param string $shortcut The shortcut
*
* @return string The InputOption name
*
* @throws InvalidArgumentException When option given does not exist
*/
private function shortcutToName($shortcut)
{
if (!isset($this->shortcuts[$shortcut])) {
throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut));
}
return $this->shortcuts[$shortcut];
}
/**
* Gets the synopsis.
*
* @param bool $short Whether to return the short version (with options folded) or not
*
* @return string The synopsis
*/
public function getSynopsis($short = false)
{
$elements = array();
if ($short && $this->getOptions()) {
$elements[] = '[options]';
} elseif (!$short) {
foreach ($this->getOptions() as $option) {
$value = '';
if ($option->acceptValue()) {
$value = sprintf(
' %s%s%s',
$option->isValueOptional() ? '[' : '',
strtoupper($option->getName()),
$option->isValueOptional() ? ']' : ''
);
}
$shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : '';
$elements[] = sprintf('[%s--%s%s]', $shortcut, $option->getName(), $value);
}
}
if (count($elements) && $this->getArguments()) {
$elements[] = '[--]';
}
foreach ($this->getArguments() as $argument) {
$element = '<'.$argument->getName().'>';
if (!$argument->isRequired()) {
$element = '['.$element.']';
} elseif ($argument->isArray()) {
$element = $element.' ('.$element.')';
}
if ($argument->isArray()) {
$element .= '...';
}
$elements[] = $element;
}
return implode(' ', $elements);
}
/**
* Returns a textual representation of the InputDefinition.
*
* @return string A string representing the InputDefinition
*
* @deprecated since version 2.3, to be removed in 3.0.
*/
public function asText()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED);
$descriptor = new TextDescriptor();
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
$descriptor->describe($output, $this, array('raw_output' => true));
return $output->fetch();
}
/**
* Returns an XML representation of the InputDefinition.
*
* @param bool $asDom Whether to return a DOM or an XML string
*
* @return string|\DOMDocument An XML string representing the InputDefinition
*
* @deprecated since version 2.3, to be removed in 3.0.
*/
public function asXml($asDom = false)
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED);
$descriptor = new XmlDescriptor();
if ($asDom) {
return $descriptor->getInputDefinitionDocument($this);
}
$output = new BufferedOutput();
$descriptor->describe($output, $this);
return $output->fetch();
}
}

@ -0,0 +1,157 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Input;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\RuntimeException;
/**
* InputInterface is the interface implemented by all input classes.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface InputInterface
{
/**
* Returns the first argument from the raw parameters (not parsed).
*
* @return string The value of the first argument or null otherwise
*/
public function getFirstArgument();
/**
* Returns true if the raw parameters (not parsed) contain a value.
*
* This method is to be used to introspect the input parameters
* before they have been validated. It must be used carefully.
*
* @param string|array $values The values to look for in the raw parameters (can be an array)
*
* @return bool true if the value is contained in the raw parameters
*/
public function hasParameterOption($values);
/**
* Returns the value of a raw option (not parsed).
*
* This method is to be used to introspect the input parameters
* before they have been validated. It must be used carefully.
*
* @param string|array $values The value(s) to look for in the raw parameters (can be an array)
* @param mixed $default The default value to return if no result is found
*
* @return mixed The option value
*/
public function getParameterOption($values, $default = false);
/**
* Binds the current Input instance with the given arguments and options.
*
* @param InputDefinition $definition A InputDefinition instance
*/
public function bind(InputDefinition $definition);
/**
* Validates the input.
*
* @throws RuntimeException When not enough arguments are given
*/
public function validate();
/**
* Returns all the given arguments merged with the default values.
*
* @return array
*/
public function getArguments();
/**
* Returns the argument value for a given argument name.
*
* @param string $name The argument name
*
* @return mixed The argument value
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
public function getArgument($name);
/**
* Sets an argument value by name.
*
* @param string $name The argument name
* @param string $value The argument value
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
public function setArgument($name, $value);
/**
* Returns true if an InputArgument object exists by name or position.
*
* @param string|int $name The InputArgument name or position
*
* @return bool true if the InputArgument object exists, false otherwise
*/
public function hasArgument($name);
/**
* Returns all the given options merged with the default values.
*
* @return array
*/
public function getOptions();
/**
* Returns the option value for a given option name.
*
* @param string $name The option name
*
* @return mixed The option value
*
* @throws InvalidArgumentException When option given doesn't exist
*/
public function getOption($name);
/**
* Sets an option value by name.
*
* @param string $name The option name
* @param string|bool $value The option value
*
* @throws InvalidArgumentException When option given doesn't exist
*/
public function setOption($name, $value);
/**
* Returns true if an InputOption object exists by name.
*
* @param string $name The InputOption name
*
* @return bool true if the InputOption object exists, false otherwise
*/
public function hasOption($name);
/**
* Is this input means interactive?
*
* @return bool
*/
public function isInteractive();
/**
* Sets the input interactivity.
*
* @param bool $interactive If the input should be interactive
*/
public function setInteractive($interactive);
}

@ -0,0 +1,212 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Input;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\LogicException;
/**
* Represents a command line option.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class InputOption
{
const VALUE_NONE = 1;
const VALUE_REQUIRED = 2;
const VALUE_OPTIONAL = 4;
const VALUE_IS_ARRAY = 8;
private $name;
private $shortcut;
private $mode;
private $default;
private $description;
/**
* Constructor.
*
* @param string $name The option name
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param int $mode The option mode: One of the VALUE_* constants
* @param string $description A description text
* @param mixed $default The default value (must be null for self::VALUE_NONE)
*
* @throws InvalidArgumentException If option mode is invalid or incompatible
*/
public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null)
{
if (0 === strpos($name, '--')) {
$name = substr($name, 2);
}
if (empty($name)) {
throw new InvalidArgumentException('An option name cannot be empty.');
}
if (empty($shortcut)) {
$shortcut = null;
}
if (null !== $shortcut) {
if (is_array($shortcut)) {
$shortcut = implode('|', $shortcut);
}
$shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-'));
$shortcuts = array_filter($shortcuts);
$shortcut = implode('|', $shortcuts);
if (empty($shortcut)) {
throw new InvalidArgumentException('An option shortcut cannot be empty.');
}
}
if (null === $mode) {
$mode = self::VALUE_NONE;
} elseif (!is_int($mode) || $mode > 15 || $mode < 1) {
throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode));
}
$this->name = $name;
$this->shortcut = $shortcut;
$this->mode = $mode;
$this->description = $description;
if ($this->isArray() && !$this->acceptValue()) {
throw new InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.');
}
$this->setDefault($default);
}
/**
* Returns the option shortcut.
*
* @return string The shortcut
*/
public function getShortcut()
{
return $this->shortcut;
}
/**
* Returns the option name.
*
* @return string The name
*/
public function getName()
{
return $this->name;
}
/**
* Returns true if the option accepts a value.
*
* @return bool true if value mode is not self::VALUE_NONE, false otherwise
*/
public function acceptValue()
{
return $this->isValueRequired() || $this->isValueOptional();
}
/**
* Returns true if the option requires a value.
*
* @return bool true if value mode is self::VALUE_REQUIRED, false otherwise
*/
public function isValueRequired()
{
return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode);
}
/**
* Returns true if the option takes an optional value.
*
* @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise
*/
public function isValueOptional()
{
return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode);
}
/**
* Returns true if the option can take multiple values.
*
* @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise
*/
public function isArray()
{
return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode);
}
/**
* Sets the default value.
*
* @param mixed $default The default value
*
* @throws LogicException When incorrect default value is given
*/
public function setDefault($default = null)
{
if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) {
throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.');
}
if ($this->isArray()) {
if (null === $default) {
$default = array();
} elseif (!is_array($default)) {
throw new LogicException('A default value for an array option must be an array.');
}
}
$this->default = $this->acceptValue() ? $default : false;
}
/**
* Returns the default value.
*
* @return mixed The default value
*/
public function getDefault()
{
return $this->default;
}
/**
* Returns the description text.
*
* @return string The description text
*/
public function getDescription()
{
return $this->description;
}
/**
* Checks whether the given option equals this one.
*
* @param InputOption $option option to compare
*
* @return bool
*/
public function equals(InputOption $option)
{
return $option->getName() === $this->getName()
&& $option->getShortcut() === $this->getShortcut()
&& $option->getDefault() === $this->getDefault()
&& $option->isArray() === $this->isArray()
&& $option->isValueRequired() === $this->isValueRequired()
&& $option->isValueOptional() === $this->isValueOptional()
;
}
}

@ -0,0 +1,85 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Input;
use Symfony\Component\Console\Exception\InvalidArgumentException;
/**
* StringInput represents an input provided as a string.
*
* Usage:
*
* $input = new StringInput('foo --bar="foobar"');
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class StringInput extends ArgvInput
{
const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
/**
* Constructor.
*
* @param string $input An array of parameters from the CLI (in the argv format)
* @param InputDefinition $definition A InputDefinition instance
*
* @deprecated The second argument is deprecated as it does not work (will be removed in 3.0), use 'bind' method instead
*/
public function __construct($input, InputDefinition $definition = null)
{
if ($definition) {
@trigger_error('The $definition argument of the '.__METHOD__.' method is deprecated and will be removed in 3.0. Set this parameter with the bind() method instead.', E_USER_DEPRECATED);
}
parent::__construct(array(), null);
$this->setTokens($this->tokenize($input));
if (null !== $definition) {
$this->bind($definition);
}
}
/**
* Tokenizes a string.
*
* @param string $input The input to tokenize
*
* @return array An array of tokens
*
* @throws InvalidArgumentException When unable to parse input (should never happen)
*/
private function tokenize($input)
{
$tokens = array();
$length = strlen($input);
$cursor = 0;
while ($cursor < $length) {
if (preg_match('/\s+/A', $input, $match, null, $cursor)) {
} elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, null, $cursor)) {
$tokens[] = $match[1].$match[2].stripcslashes(str_replace(array('"\'', '\'"', '\'\'', '""'), '', substr($match[3], 1, strlen($match[3]) - 2)));
} elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, null, $cursor)) {
$tokens[] = stripcslashes(substr($match[0], 1, strlen($match[0]) - 2));
} elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, null, $cursor)) {
$tokens[] = stripcslashes($match[1]);
} else {
// should never happen
throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10)));
}
$cursor += strlen($match[0]);
}
return $tokens;
}
}