12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018610196102061021610226102361024610256102661027610286102961030610316103261033610346103561036610376103861039610406104161042610436104461045610466104761048610496105061051610526105361054610556105661057610586105961060610616106261063610646106561066610676106861069610706107161072610736107461075610766107761078610796108061081610826108361084610856108661087610886108961090610916109261093610946109561096610976109861099611006110161102611036110461105611066110761108611096111061111611126111361114611156111661117611186111961120611216112261123611246112561126611276112861129611306113161132611336113461135611366113761138611396114061141611426114361144611456114661147611486114961150611516115261153611546115561156611576115861159611606116161162611636116461165611666116761168611696117061171611726117361174611756117661177611786117961180611816118261183611846118561186611876118861189611906119161192611936119461195611966119761198611996120061201612026120361204612056120661207612086120961210612116121261213612146121561216612176121861219612206122161222612236122461225612266122761228612296123061231612326123361234612356123661237612386123961240612416124261243612446124561246612476124861249612506125161252612536125461255612566125761258612596126061261612626126361264612656126661267612686126961270612716127261273612746127561276612776127861279612806128161282612836128461285612866128761288612896129061291612926129361294612956129661297612986129961300613016130261303613046130561306613076130861309613106131161312613136131461315613166131761318613196132061321613226132361324613256132661327613286132961330613316133261333613346133561336613376133861339613406134161342613436134461345613466134761348613496135061351613526135361354613556135661357613586135961360613616136261363613646136561366613676136861369613706137161372613736137461375613766137761378613796138061381613826138361384613856138661387613886138961390613916139261393613946139561396613976139861399614006140161402614036140461405614066140761408614096141061411614126141361414614156141661417614186141961420614216142261423614246142561426614276142861429614306143161432614336143461435614366143761438614396144061441614426144361444614456144661447614486144961450614516145261453614546145561456614576145861459614606146161462614636146461465614666146761468614696147061471614726147361474614756147661477614786147961480614816148261483614846148561486614876148861489614906149161492614936149461495614966149761498614996150061501615026150361504615056150661507615086150961510615116151261513615146151561516615176151861519615206152161522615236152461525615266152761528615296153061531615326153361534615356153661537615386153961540615416154261543615446154561546615476154861549615506155161552615536155461555615566155761558615596156061561615626156361564615656156661567615686156961570615716157261573615746157561576615776157861579615806158161582615836158461585615866158761588615896159061591615926159361594615956159661597615986159961600616016160261603616046160561606616076160861609616106161161612616136161461615616166161761618616196162061621616226162361624616256162661627616286162961630616316163261633616346163561636616376163861639616406164161642616436164461645616466164761648616496165061651616526165361654616556165661657616586165961660616616166261663616646166561666616676166861669616706167161672616736167461675616766167761678616796168061681616826168361684616856168661687616886168961690616916169261693616946169561696616976169861699617006170161702617036170461705617066170761708617096171061711617126171361714617156171661717617186171961720617216172261723617246172561726617276172861729617306173161732617336173461735617366173761738617396174061741617426174361744617456174661747617486174961750617516175261753617546175561756617576175861759617606176161762617636176461765617666176761768617696177061771617726177361774617756177661777617786177961780617816178261783617846178561786617876178861789617906179161792617936179461795617966179761798617996180061801618026180361804618056180661807618086180961810618116181261813618146181561816618176181861819618206182161822618236182461825618266182761828618296183061831618326183361834618356183661837618386183961840618416184261843618446184561846618476184861849618506185161852618536185461855618566185761858618596186061861618626186361864618656186661867618686186961870618716187261873618746187561876618776187861879618806188161882618836188461885618866188761888618896189061891618926189361894618956189661897618986189961900619016190261903619046190561906619076190861909619106191161912619136191461915619166191761918619196192061921619226192361924619256192661927619286192961930619316193261933619346193561936619376193861939619406194161942619436194461945619466194761948619496195061951619526195361954619556195661957619586195961960619616196261963619646196561966619676196861969619706197161972619736197461975619766197761978619796198061981619826198361984619856198661987619886198961990619916199261993619946199561996619976199861999620006200162002620036200462005620066200762008620096201062011620126201362014620156201662017620186201962020620216202262023620246202562026620276202862029620306203162032620336203462035620366203762038620396204062041620426204362044620456204662047620486204962050620516205262053620546205562056620576205862059620606206162062620636206462065620666206762068620696207062071620726207362074620756207662077620786207962080620816208262083620846208562086620876208862089620906209162092620936209462095620966209762098620996210062101621026210362104621056210662107621086210962110621116211262113621146211562116621176211862119621206212162122621236212462125621266212762128621296213062131621326213362134621356213662137621386213962140621416214262143621446214562146621476214862149621506215162152621536215462155621566215762158621596216062161621626216362164621656216662167621686216962170621716217262173621746217562176621776217862179621806218162182621836218462185621866218762188621896219062191621926219362194621956219662197621986219962200622016220262203622046220562206622076220862209622106221162212622136221462215622166221762218622196222062221622226222362224622256222662227622286222962230622316223262233622346223562236622376223862239622406224162242622436224462245622466224762248622496225062251622526225362254622556225662257622586225962260622616226262263622646226562266622676226862269622706227162272622736227462275622766227762278622796228062281622826228362284622856228662287622886228962290622916229262293622946229562296622976229862299623006230162302623036230462305623066230762308623096231062311623126231362314623156231662317623186231962320623216232262323623246232562326623276232862329623306233162332623336233462335623366233762338623396234062341623426234362344623456234662347623486234962350623516235262353623546235562356623576235862359623606236162362623636236462365623666236762368623696237062371623726237362374623756237662377623786237962380623816238262383623846238562386623876238862389623906239162392623936239462395623966239762398623996240062401624026240362404624056240662407624086240962410624116241262413624146241562416624176241862419624206242162422624236242462425624266242762428624296243062431624326243362434624356243662437624386243962440624416244262443624446244562446624476244862449624506245162452624536245462455624566245762458624596246062461624626246362464624656246662467624686246962470624716247262473624746247562476624776247862479624806248162482624836248462485624866248762488624896249062491624926249362494624956249662497624986249962500625016250262503625046250562506625076250862509625106251162512625136251462515625166251762518625196252062521625226252362524625256252662527625286252962530625316253262533625346253562536625376253862539625406254162542625436254462545625466254762548625496255062551625526255362554625556255662557625586255962560625616256262563625646256562566625676256862569625706257162572625736257462575625766257762578625796258062581625826258362584625856258662587625886258962590625916259262593625946259562596625976259862599626006260162602626036260462605626066260762608626096261062611626126261362614626156261662617626186261962620626216262262623626246262562626626276262862629626306263162632626336263462635626366263762638626396264062641626426264362644626456264662647626486264962650626516265262653626546265562656626576265862659626606266162662626636266462665626666266762668626696267062671626726267362674626756267662677626786267962680626816268262683626846268562686626876268862689626906269162692626936269462695626966269762698626996270062701627026270362704627056270662707627086270962710627116271262713627146271562716627176271862719627206272162722627236272462725627266272762728627296273062731627326273362734627356273662737627386273962740627416274262743627446274562746627476274862749627506275162752627536275462755627566275762758627596276062761627626276362764627656276662767627686276962770627716277262773627746277562776627776277862779627806278162782627836278462785627866278762788627896279062791627926279362794627956279662797627986279962800628016280262803628046280562806628076280862809628106281162812628136281462815628166281762818628196282062821628226282362824628256282662827628286282962830628316283262833628346283562836628376283862839628406284162842628436284462845628466284762848628496285062851628526285362854628556285662857628586285962860628616286262863628646286562866628676286862869628706287162872628736287462875628766287762878628796288062881628826288362884628856288662887628886288962890628916289262893628946289562896628976289862899629006290162902629036290462905629066290762908629096291062911629126291362914629156291662917629186291962920629216292262923629246292562926629276292862929629306293162932629336293462935629366293762938629396294062941629426294362944629456294662947629486294962950629516295262953629546295562956629576295862959629606296162962629636296462965629666296762968629696297062971629726297362974629756297662977629786297962980629816298262983629846298562986629876298862989629906299162992629936299462995629966299762998629996300063001630026300363004630056300663007630086300963010630116301263013630146301563016630176301863019630206302163022630236302463025630266302763028630296303063031630326303363034630356303663037630386303963040630416304263043630446304563046630476304863049630506305163052630536305463055630566305763058630596306063061630626306363064630656306663067630686306963070630716307263073630746307563076630776307863079630806308163082630836308463085630866308763088630896309063091630926309363094630956309663097630986309963100631016310263103631046310563106631076310863109631106311163112631136311463115631166311763118631196312063121631226312363124631256312663127631286312963130631316313263133631346313563136631376313863139631406314163142631436314463145631466314763148631496315063151631526315363154631556315663157631586315963160631616316263163631646316563166631676316863169631706317163172631736317463175631766317763178631796318063181631826318363184631856318663187631886318963190631916319263193631946319563196631976319863199632006320163202632036320463205632066320763208632096321063211632126321363214632156321663217632186321963220632216322263223632246322563226632276322863229632306323163232632336323463235632366323763238632396324063241632426324363244632456324663247632486324963250632516325263253632546325563256632576325863259632606326163262632636326463265632666326763268632696327063271632726327363274632756327663277632786327963280632816328263283632846328563286632876328863289632906329163292632936329463295632966329763298632996330063301633026330363304633056330663307633086330963310633116331263313633146331563316633176331863319633206332163322633236332463325633266332763328633296333063331633326333363334633356333663337633386333963340633416334263343633446334563346633476334863349633506335163352633536335463355633566335763358633596336063361633626336363364633656336663367633686336963370633716337263373633746337563376633776337863379633806338163382633836338463385633866338763388633896339063391633926339363394633956339663397633986339963400634016340263403634046340563406634076340863409634106341163412634136341463415634166341763418634196342063421634226342363424634256342663427634286342963430634316343263433634346343563436634376343863439634406344163442634436344463445634466344763448634496345063451634526345363454634556345663457634586345963460634616346263463634646346563466634676346863469634706347163472634736347463475634766347763478634796348063481634826348363484634856348663487634886348963490634916349263493634946349563496634976349863499635006350163502635036350463505635066350763508635096351063511635126351363514635156351663517635186351963520635216352263523635246352563526635276352863529635306353163532635336353463535635366353763538635396354063541635426354363544635456354663547635486354963550635516355263553635546355563556635576355863559635606356163562635636356463565635666356763568635696357063571635726357363574635756357663577635786357963580635816358263583635846358563586635876358863589635906359163592635936359463595635966359763598635996360063601636026360363604636056360663607636086360963610636116361263613636146361563616636176361863619636206362163622636236362463625636266362763628636296363063631636326363363634636356363663637636386363963640636416364263643636446364563646636476364863649636506365163652636536365463655636566365763658636596366063661636626366363664636656366663667636686366963670636716367263673636746367563676636776367863679636806368163682636836368463685636866368763688636896369063691636926369363694636956369663697636986369963700637016370263703637046370563706637076370863709637106371163712637136371463715637166371763718637196372063721637226372363724637256372663727637286372963730637316373263733637346373563736637376373863739637406374163742637436374463745637466374763748637496375063751637526375363754637556375663757637586375963760637616376263763637646376563766637676376863769637706377163772637736377463775637766377763778637796378063781637826378363784637856378663787637886378963790637916379263793637946379563796637976379863799638006380163802638036380463805638066380763808638096381063811638126381363814638156381663817638186381963820638216382263823638246382563826638276382863829638306383163832638336383463835638366383763838638396384063841638426384363844638456384663847638486384963850638516385263853638546385563856638576385863859638606386163862638636386463865638666386763868638696387063871638726387363874638756387663877638786387963880638816388263883638846388563886638876388863889638906389163892638936389463895638966389763898638996390063901639026390363904639056390663907639086390963910639116391263913639146391563916639176391863919639206392163922639236392463925639266392763928639296393063931639326393363934639356393663937639386393963940639416394263943639446394563946639476394863949639506395163952639536395463955639566395763958639596396063961639626396363964639656396663967639686396963970639716397263973639746397563976639776397863979639806398163982639836398463985639866398763988639896399063991639926399363994639956399663997639986399964000640016400264003640046400564006640076400864009640106401164012640136401464015640166401764018640196402064021640226402364024640256402664027640286402964030640316403264033640346403564036640376403864039640406404164042640436404464045640466404764048640496405064051640526405364054640556405664057640586405964060640616406264063640646406564066640676406864069640706407164072640736407464075640766407764078640796408064081640826408364084640856408664087640886408964090640916409264093640946409564096640976409864099641006410164102641036410464105641066410764108641096411064111641126411364114641156411664117641186411964120641216412264123641246412564126641276412864129641306413164132641336413464135641366413764138641396414064141641426414364144641456414664147641486414964150641516415264153641546415564156641576415864159641606416164162641636416464165641666416764168641696417064171641726417364174641756417664177641786417964180641816418264183641846418564186641876418864189641906419164192641936419464195641966419764198641996420064201642026420364204642056420664207642086420964210642116421264213642146421564216642176421864219642206422164222642236422464225642266422764228642296423064231642326423364234642356423664237642386423964240642416424264243642446424564246642476424864249642506425164252642536425464255642566425764258642596426064261642626426364264642656426664267642686426964270642716427264273642746427564276642776427864279642806428164282642836428464285642866428764288642896429064291642926429364294642956429664297642986429964300643016430264303643046430564306643076430864309643106431164312643136431464315643166431764318643196432064321643226432364324643256432664327643286432964330643316433264333643346433564336643376433864339643406434164342643436434464345643466434764348643496435064351643526435364354643556435664357643586435964360643616436264363643646436564366643676436864369643706437164372643736437464375643766437764378643796438064381643826438364384643856438664387643886438964390643916439264393643946439564396643976439864399644006440164402644036440464405644066440764408644096441064411644126441364414644156441664417644186441964420644216442264423644246442564426644276442864429644306443164432644336443464435644366443764438644396444064441644426444364444644456444664447644486444964450644516445264453644546445564456644576445864459644606446164462644636446464465644666446764468644696447064471644726447364474644756447664477644786447964480644816448264483644846448564486644876448864489644906449164492644936449464495644966449764498644996450064501645026450364504645056450664507645086450964510645116451264513645146451564516645176451864519645206452164522645236452464525645266452764528645296453064531645326453364534645356453664537645386453964540645416454264543645446454564546645476454864549645506455164552645536455464555645566455764558645596456064561645626456364564645656456664567645686456964570645716457264573645746457564576645776457864579645806458164582645836458464585645866458764588645896459064591645926459364594645956459664597645986459964600646016460264603646046460564606646076460864609646106461164612646136461464615646166461764618646196462064621646226462364624646256462664627646286462964630646316463264633646346463564636646376463864639646406464164642646436464464645646466464764648646496465064651646526465364654646556465664657646586465964660646616466264663646646466564666646676466864669646706467164672646736467464675646766467764678646796468064681646826468364684646856468664687646886468964690646916469264693646946469564696646976469864699647006470164702647036470464705647066470764708647096471064711647126471364714647156471664717647186471964720647216472264723647246472564726647276472864729647306473164732647336473464735647366473764738647396474064741647426474364744647456474664747647486474964750647516475264753647546475564756647576475864759647606476164762647636476464765647666476764768647696477064771647726477364774647756477664777647786477964780647816478264783647846478564786647876478864789647906479164792647936479464795647966479764798647996480064801648026480364804648056480664807648086480964810648116481264813648146481564816648176481864819648206482164822648236482464825648266482764828648296483064831648326483364834648356483664837648386483964840648416484264843648446484564846648476484864849648506485164852648536485464855648566485764858648596486064861648626486364864648656486664867648686486964870648716487264873648746487564876648776487864879648806488164882648836488464885648866488764888648896489064891648926489364894648956489664897648986489964900649016490264903649046490564906649076490864909649106491164912649136491464915649166491764918649196492064921649226492364924649256492664927649286492964930649316493264933649346493564936649376493864939649406494164942649436494464945649466494764948649496495064951649526495364954649556495664957649586495964960649616496264963649646496564966649676496864969649706497164972649736497464975649766497764978649796498064981649826498364984649856498664987649886498964990649916499264993649946499564996649976499864999650006500165002650036500465005650066500765008650096501065011650126501365014650156501665017650186501965020650216502265023650246502565026650276502865029650306503165032650336503465035650366503765038650396504065041650426504365044650456504665047650486504965050650516505265053650546505565056650576505865059650606506165062650636506465065650666506765068650696507065071650726507365074650756507665077650786507965080650816508265083650846508565086650876508865089650906509165092650936509465095650966509765098650996510065101651026510365104651056510665107651086510965110651116511265113651146511565116651176511865119651206512165122651236512465125651266512765128651296513065131651326513365134651356513665137651386513965140651416514265143651446514565146651476514865149651506515165152651536515465155651566515765158651596516065161651626516365164651656516665167651686516965170651716517265173651746517565176651776517865179651806518165182651836518465185651866518765188651896519065191651926519365194651956519665197651986519965200652016520265203652046520565206652076520865209652106521165212652136521465215652166521765218652196522065221652226522365224652256522665227652286522965230652316523265233652346523565236652376523865239652406524165242652436524465245652466524765248652496525065251652526525365254652556525665257652586525965260652616526265263652646526565266652676526865269652706527165272652736527465275652766527765278652796528065281652826528365284652856528665287652886528965290652916529265293652946529565296652976529865299653006530165302653036530465305653066530765308653096531065311653126531365314653156531665317653186531965320653216532265323653246532565326653276532865329653306533165332653336533465335653366533765338653396534065341653426534365344653456534665347653486534965350653516535265353653546535565356653576535865359653606536165362653636536465365653666536765368653696537065371653726537365374653756537665377653786537965380653816538265383653846538565386653876538865389653906539165392653936539465395653966539765398653996540065401654026540365404654056540665407654086540965410654116541265413654146541565416654176541865419654206542165422654236542465425654266542765428654296543065431654326543365434654356543665437654386543965440654416544265443654446544565446654476544865449654506545165452654536545465455654566545765458654596546065461654626546365464654656546665467654686546965470654716547265473654746547565476654776547865479654806548165482654836548465485654866548765488654896549065491654926549365494654956549665497654986549965500655016550265503655046550565506655076550865509655106551165512655136551465515655166551765518655196552065521655226552365524655256552665527655286552965530655316553265533655346553565536655376553865539655406554165542655436554465545655466554765548655496555065551655526555365554655556555665557655586555965560655616556265563655646556565566655676556865569655706557165572655736557465575655766557765578655796558065581655826558365584655856558665587655886558965590655916559265593655946559565596655976559865599656006560165602656036560465605656066560765608656096561065611656126561365614656156561665617656186561965620656216562265623656246562565626656276562865629656306563165632656336563465635656366563765638656396564065641656426564365644656456564665647656486564965650656516565265653656546565565656656576565865659656606566165662656636566465665656666566765668656696567065671656726567365674656756567665677656786567965680656816568265683656846568565686656876568865689656906569165692656936569465695656966569765698656996570065701657026570365704657056570665707657086570965710657116571265713657146571565716657176571865719657206572165722657236572465725657266572765728657296573065731657326573365734657356573665737657386573965740657416574265743657446574565746657476574865749657506575165752657536575465755657566575765758657596576065761657626576365764657656576665767657686576965770657716577265773657746577565776657776577865779657806578165782657836578465785657866578765788657896579065791657926579365794657956579665797657986579965800658016580265803658046580565806658076580865809658106581165812658136581465815658166581765818658196582065821658226582365824658256582665827658286582965830658316583265833658346583565836658376583865839658406584165842658436584465845658466584765848658496585065851658526585365854658556585665857658586585965860658616586265863658646586565866658676586865869658706587165872658736587465875658766587765878658796588065881658826588365884658856588665887658886588965890658916589265893658946589565896658976589865899659006590165902659036590465905659066590765908659096591065911659126591365914659156591665917659186591965920659216592265923659246592565926659276592865929659306593165932659336593465935659366593765938659396594065941659426594365944659456594665947659486594965950659516595265953659546595565956659576595865959659606596165962659636596465965659666596765968659696597065971659726597365974659756597665977659786597965980659816598265983659846598565986659876598865989659906599165992659936599465995659966599765998659996600066001660026600366004660056600666007660086600966010660116601266013660146601566016660176601866019660206602166022660236602466025660266602766028660296603066031660326603366034660356603666037660386603966040660416604266043660446604566046660476604866049660506605166052660536605466055660566605766058660596606066061660626606366064660656606666067660686606966070660716607266073660746607566076660776607866079660806608166082660836608466085660866608766088660896609066091660926609366094660956609666097660986609966100661016610266103661046610566106661076610866109661106611166112661136611466115661166611766118661196612066121661226612366124661256612666127661286612966130661316613266133661346613566136661376613866139661406614166142661436614466145661466614766148661496615066151661526615366154661556615666157661586615966160661616616266163661646616566166661676616866169661706617166172661736617466175661766617766178661796618066181661826618366184661856618666187661886618966190661916619266193661946619566196661976619866199662006620166202662036620466205662066620766208662096621066211662126621366214662156621666217662186621966220662216622266223662246622566226662276622866229662306623166232662336623466235662366623766238662396624066241662426624366244662456624666247662486624966250662516625266253662546625566256662576625866259662606626166262662636626466265662666626766268662696627066271662726627366274662756627666277662786627966280662816628266283662846628566286662876628866289662906629166292662936629466295662966629766298662996630066301663026630366304663056630666307663086630966310663116631266313663146631566316663176631866319663206632166322663236632466325663266632766328663296633066331663326633366334663356633666337663386633966340663416634266343663446634566346663476634866349663506635166352663536635466355663566635766358663596636066361663626636366364663656636666367663686636966370663716637266373663746637566376663776637866379663806638166382663836638466385663866638766388663896639066391663926639366394663956639666397663986639966400664016640266403664046640566406664076640866409664106641166412664136641466415664166641766418664196642066421664226642366424664256642666427664286642966430664316643266433664346643566436664376643866439664406644166442664436644466445664466644766448664496645066451664526645366454664556645666457664586645966460664616646266463664646646566466664676646866469664706647166472664736647466475664766647766478664796648066481664826648366484664856648666487664886648966490664916649266493664946649566496664976649866499665006650166502665036650466505665066650766508665096651066511665126651366514665156651666517665186651966520665216652266523665246652566526665276652866529665306653166532665336653466535665366653766538665396654066541665426654366544665456654666547665486654966550665516655266553665546655566556665576655866559665606656166562665636656466565665666656766568665696657066571665726657366574665756657666577665786657966580665816658266583665846658566586665876658866589665906659166592665936659466595665966659766598665996660066601666026660366604666056660666607666086660966610666116661266613666146661566616666176661866619666206662166622666236662466625666266662766628666296663066631666326663366634666356663666637666386663966640666416664266643666446664566646666476664866649666506665166652666536665466655666566665766658666596666066661666626666366664666656666666667666686666966670666716667266673666746667566676666776667866679666806668166682666836668466685666866668766688666896669066691666926669366694666956669666697666986669966700667016670266703667046670566706667076670866709667106671166712667136671466715667166671766718667196672066721667226672366724667256672666727667286672966730667316673266733667346673566736667376673866739667406674166742667436674466745667466674766748667496675066751667526675366754667556675666757667586675966760667616676266763667646676566766667676676866769667706677166772667736677466775667766677766778667796678066781667826678366784667856678666787667886678966790667916679266793667946679566796667976679866799668006680166802668036680466805668066680766808668096681066811668126681366814668156681666817668186681966820668216682266823668246682566826668276682866829668306683166832668336683466835668366683766838668396684066841668426684366844668456684666847668486684966850668516685266853668546685566856668576685866859668606686166862668636686466865668666686766868668696687066871668726687366874668756687666877668786687966880668816688266883668846688566886668876688866889668906689166892668936689466895668966689766898668996690066901669026690366904669056690666907669086690966910669116691266913669146691566916669176691866919669206692166922669236692466925669266692766928669296693066931669326693366934669356693666937669386693966940669416694266943669446694566946669476694866949669506695166952669536695466955669566695766958669596696066961669626696366964669656696666967669686696966970669716697266973669746697566976669776697866979669806698166982669836698466985669866698766988669896699066991669926699366994669956699666997669986699967000670016700267003670046700567006670076700867009670106701167012670136701467015670166701767018670196702067021670226702367024670256702667027670286702967030670316703267033670346703567036670376703867039670406704167042670436704467045670466704767048670496705067051670526705367054670556705667057670586705967060670616706267063670646706567066670676706867069670706707167072670736707467075670766707767078670796708067081670826708367084670856708667087670886708967090670916709267093670946709567096670976709867099671006710167102671036710467105671066710767108671096711067111671126711367114671156711667117671186711967120671216712267123671246712567126671276712867129671306713167132671336713467135671366713767138671396714067141671426714367144671456714667147671486714967150671516715267153671546715567156671576715867159671606716167162671636716467165671666716767168671696717067171671726717367174671756717667177671786717967180671816718267183671846718567186671876718867189671906719167192671936719467195671966719767198671996720067201672026720367204672056720667207672086720967210672116721267213672146721567216672176721867219672206722167222672236722467225672266722767228672296723067231672326723367234672356723667237672386723967240672416724267243672446724567246672476724867249672506725167252672536725467255672566725767258672596726067261672626726367264672656726667267672686726967270672716727267273672746727567276672776727867279672806728167282672836728467285672866728767288672896729067291672926729367294672956729667297672986729967300673016730267303673046730567306673076730867309673106731167312673136731467315673166731767318673196732067321673226732367324673256732667327673286732967330673316733267333673346733567336673376733867339673406734167342673436734467345673466734767348673496735067351673526735367354673556735667357673586735967360673616736267363673646736567366673676736867369673706737167372673736737467375673766737767378673796738067381673826738367384673856738667387673886738967390673916739267393673946739567396673976739867399674006740167402674036740467405674066740767408674096741067411674126741367414674156741667417674186741967420674216742267423674246742567426674276742867429674306743167432674336743467435674366743767438674396744067441674426744367444674456744667447674486744967450674516745267453674546745567456674576745867459674606746167462674636746467465674666746767468674696747067471674726747367474674756747667477674786747967480674816748267483674846748567486674876748867489674906749167492674936749467495674966749767498674996750067501675026750367504675056750667507675086750967510675116751267513675146751567516675176751867519675206752167522675236752467525675266752767528675296753067531675326753367534675356753667537675386753967540675416754267543675446754567546675476754867549675506755167552675536755467555675566755767558675596756067561675626756367564675656756667567675686756967570675716757267573675746757567576675776757867579675806758167582675836758467585675866758767588675896759067591675926759367594675956759667597675986759967600676016760267603676046760567606676076760867609676106761167612676136761467615676166761767618676196762067621676226762367624676256762667627676286762967630676316763267633676346763567636676376763867639676406764167642676436764467645676466764767648676496765067651676526765367654676556765667657676586765967660676616766267663676646766567666676676766867669676706767167672676736767467675676766767767678676796768067681676826768367684676856768667687676886768967690676916769267693676946769567696676976769867699677006770167702677036770467705677066770767708677096771067711677126771367714677156771667717677186771967720677216772267723677246772567726677276772867729677306773167732677336773467735677366773767738677396774067741677426774367744677456774667747677486774967750677516775267753677546775567756677576775867759677606776167762677636776467765677666776767768677696777067771677726777367774677756777667777677786777967780677816778267783677846778567786677876778867789677906779167792677936779467795677966779767798677996780067801678026780367804678056780667807678086780967810678116781267813678146781567816678176781867819678206782167822678236782467825678266782767828678296783067831678326783367834678356783667837678386783967840678416784267843678446784567846678476784867849678506785167852678536785467855678566785767858678596786067861678626786367864678656786667867678686786967870678716787267873678746787567876678776787867879678806788167882678836788467885678866788767888678896789067891678926789367894678956789667897678986789967900679016790267903679046790567906679076790867909679106791167912679136791467915679166791767918679196792067921679226792367924679256792667927679286792967930679316793267933679346793567936679376793867939679406794167942679436794467945679466794767948679496795067951679526795367954679556795667957679586795967960679616796267963679646796567966679676796867969679706797167972679736797467975679766797767978679796798067981679826798367984679856798667987679886798967990679916799267993679946799567996679976799867999680006800168002680036800468005680066800768008680096801068011680126801368014680156801668017680186801968020680216802268023680246802568026680276802868029680306803168032680336803468035680366803768038680396804068041680426804368044680456804668047680486804968050680516805268053680546805568056680576805868059680606806168062680636806468065680666806768068680696807068071680726807368074680756807668077680786807968080680816808268083680846808568086680876808868089680906809168092680936809468095680966809768098680996810068101681026810368104681056810668107681086810968110681116811268113681146811568116681176811868119681206812168122681236812468125681266812768128681296813068131681326813368134681356813668137681386813968140681416814268143681446814568146681476814868149681506815168152681536815468155681566815768158681596816068161681626816368164681656816668167681686816968170681716817268173681746817568176681776817868179681806818168182681836818468185681866818768188681896819068191681926819368194681956819668197681986819968200682016820268203682046820568206682076820868209682106821168212682136821468215682166821768218682196822068221682226822368224682256822668227682286822968230682316823268233682346823568236682376823868239682406824168242682436824468245682466824768248682496825068251682526825368254682556825668257682586825968260682616826268263682646826568266682676826868269682706827168272682736827468275682766827768278682796828068281682826828368284682856828668287682886828968290682916829268293682946829568296682976829868299683006830168302683036830468305683066830768308683096831068311683126831368314683156831668317683186831968320683216832268323683246832568326683276832868329683306833168332683336833468335683366833768338683396834068341683426834368344683456834668347683486834968350683516835268353683546835568356683576835868359683606836168362683636836468365683666836768368683696837068371683726837368374683756837668377683786837968380683816838268383683846838568386683876838868389683906839168392683936839468395683966839768398683996840068401684026840368404684056840668407684086840968410684116841268413684146841568416684176841868419684206842168422684236842468425684266842768428684296843068431684326843368434684356843668437684386843968440684416844268443684446844568446684476844868449684506845168452684536845468455684566845768458684596846068461684626846368464684656846668467684686846968470684716847268473684746847568476684776847868479684806848168482684836848468485684866848768488684896849068491684926849368494684956849668497684986849968500685016850268503685046850568506685076850868509685106851168512685136851468515685166851768518685196852068521685226852368524685256852668527685286852968530685316853268533685346853568536685376853868539685406854168542685436854468545685466854768548685496855068551685526855368554685556855668557685586855968560685616856268563685646856568566685676856868569685706857168572685736857468575685766857768578685796858068581685826858368584685856858668587685886858968590685916859268593685946859568596685976859868599686006860168602686036860468605686066860768608686096861068611686126861368614686156861668617686186861968620686216862268623686246862568626686276862868629686306863168632686336863468635686366863768638686396864068641686426864368644686456864668647686486864968650686516865268653686546865568656686576865868659686606866168662686636866468665686666866768668686696867068671686726867368674686756867668677686786867968680686816868268683686846868568686686876868868689686906869168692686936869468695686966869768698686996870068701687026870368704687056870668707687086870968710687116871268713687146871568716687176871868719687206872168722687236872468725687266872768728687296873068731687326873368734687356873668737687386873968740687416874268743687446874568746687476874868749687506875168752687536875468755687566875768758687596876068761687626876368764687656876668767687686876968770687716877268773687746877568776687776877868779687806878168782687836878468785687866878768788687896879068791687926879368794687956879668797687986879968800688016880268803688046880568806688076880868809688106881168812688136881468815688166881768818688196882068821688226882368824688256882668827688286882968830688316883268833688346883568836688376883868839688406884168842688436884468845688466884768848688496885068851688526885368854688556885668857688586885968860688616886268863688646886568866688676886868869688706887168872688736887468875688766887768878688796888068881688826888368884688856888668887688886888968890688916889268893688946889568896688976889868899689006890168902689036890468905689066890768908689096891068911689126891368914689156891668917689186891968920689216892268923689246892568926689276892868929689306893168932689336893468935689366893768938689396894068941689426894368944689456894668947689486894968950689516895268953689546895568956689576895868959689606896168962689636896468965689666896768968689696897068971689726897368974689756897668977689786897968980689816898268983689846898568986689876898868989689906899168992689936899468995689966899768998689996900069001690026900369004690056900669007690086900969010690116901269013690146901569016690176901869019690206902169022690236902469025690266902769028690296903069031690326903369034690356903669037690386903969040690416904269043690446904569046690476904869049690506905169052690536905469055690566905769058690596906069061690626906369064690656906669067690686906969070690716907269073690746907569076690776907869079690806908169082690836908469085690866908769088690896909069091690926909369094690956909669097690986909969100691016910269103691046910569106691076910869109691106911169112691136911469115691166911769118691196912069121691226912369124691256912669127691286912969130691316913269133691346913569136691376913869139691406914169142691436914469145691466914769148691496915069151691526915369154691556915669157691586915969160691616916269163691646916569166691676916869169691706917169172691736917469175691766917769178691796918069181691826918369184691856918669187691886918969190691916919269193691946919569196691976919869199692006920169202692036920469205692066920769208692096921069211692126921369214692156921669217692186921969220692216922269223692246922569226692276922869229692306923169232692336923469235692366923769238692396924069241692426924369244692456924669247692486924969250692516925269253692546925569256692576925869259692606926169262692636926469265692666926769268692696927069271692726927369274692756927669277692786927969280692816928269283692846928569286692876928869289692906929169292692936929469295692966929769298692996930069301693026930369304693056930669307693086930969310693116931269313693146931569316693176931869319693206932169322693236932469325693266932769328693296933069331693326933369334693356933669337693386933969340693416934269343693446934569346693476934869349693506935169352693536935469355693566935769358693596936069361693626936369364693656936669367693686936969370693716937269373693746937569376693776937869379693806938169382693836938469385693866938769388693896939069391693926939369394693956939669397693986939969400694016940269403694046940569406694076940869409694106941169412694136941469415694166941769418694196942069421694226942369424694256942669427694286942969430694316943269433694346943569436694376943869439694406944169442694436944469445694466944769448694496945069451694526945369454694556945669457694586945969460694616946269463694646946569466694676946869469694706947169472694736947469475694766947769478694796948069481694826948369484694856948669487694886948969490694916949269493694946949569496694976949869499695006950169502695036950469505695066950769508695096951069511695126951369514695156951669517695186951969520695216952269523695246952569526695276952869529695306953169532695336953469535695366953769538695396954069541695426954369544695456954669547695486954969550695516955269553695546955569556695576955869559695606956169562695636956469565695666956769568695696957069571695726957369574695756957669577695786957969580695816958269583695846958569586695876958869589695906959169592695936959469595695966959769598695996960069601696026960369604696056960669607696086960969610696116961269613696146961569616696176961869619696206962169622696236962469625696266962769628696296963069631696326963369634696356963669637696386963969640696416964269643696446964569646696476964869649696506965169652696536965469655696566965769658696596966069661696626966369664696656966669667696686966969670696716967269673696746967569676696776967869679696806968169682696836968469685696866968769688696896969069691696926969369694696956969669697696986969969700697016970269703697046970569706697076970869709697106971169712697136971469715697166971769718697196972069721697226972369724697256972669727697286972969730697316973269733697346973569736697376973869739697406974169742697436974469745697466974769748697496975069751697526975369754697556975669757697586975969760697616976269763697646976569766697676976869769697706977169772697736977469775697766977769778697796978069781697826978369784697856978669787697886978969790697916979269793697946979569796697976979869799698006980169802698036980469805698066980769808698096981069811698126981369814698156981669817698186981969820698216982269823698246982569826698276982869829698306983169832698336983469835698366983769838698396984069841698426984369844698456984669847698486984969850698516985269853698546985569856698576985869859698606986169862698636986469865698666986769868698696987069871698726987369874698756987669877698786987969880698816988269883698846988569886698876988869889698906989169892698936989469895698966989769898698996990069901699026990369904699056990669907699086990969910699116991269913699146991569916699176991869919699206992169922699236992469925699266992769928699296993069931699326993369934699356993669937699386993969940699416994269943699446994569946699476994869949699506995169952699536995469955699566995769958699596996069961699626996369964699656996669967699686996969970699716997269973699746997569976699776997869979699806998169982699836998469985699866998769988699896999069991699926999369994699956999669997699986999970000700017000270003700047000570006700077000870009700107001170012700137001470015700167001770018700197002070021700227002370024700257002670027700287002970030700317003270033700347003570036700377003870039700407004170042700437004470045700467004770048700497005070051700527005370054700557005670057700587005970060700617006270063700647006570066700677006870069700707007170072700737007470075700767007770078700797008070081700827008370084700857008670087700887008970090700917009270093700947009570096700977009870099701007010170102701037010470105701067010770108701097011070111701127011370114701157011670117701187011970120701217012270123701247012570126701277012870129701307013170132701337013470135701367013770138701397014070141701427014370144701457014670147701487014970150701517015270153701547015570156701577015870159701607016170162701637016470165701667016770168701697017070171701727017370174701757017670177701787017970180701817018270183701847018570186701877018870189701907019170192701937019470195701967019770198701997020070201702027020370204702057020670207702087020970210702117021270213702147021570216702177021870219702207022170222702237022470225702267022770228702297023070231702327023370234702357023670237702387023970240702417024270243702447024570246702477024870249702507025170252702537025470255702567025770258702597026070261702627026370264702657026670267702687026970270702717027270273702747027570276702777027870279702807028170282702837028470285702867028770288702897029070291702927029370294702957029670297702987029970300703017030270303703047030570306703077030870309703107031170312703137031470315703167031770318703197032070321703227032370324703257032670327703287032970330703317033270333703347033570336703377033870339703407034170342703437034470345703467034770348703497035070351703527035370354703557035670357703587035970360703617036270363703647036570366703677036870369703707037170372703737037470375703767037770378703797038070381703827038370384703857038670387703887038970390703917039270393703947039570396703977039870399704007040170402704037040470405704067040770408704097041070411704127041370414704157041670417704187041970420704217042270423704247042570426704277042870429704307043170432704337043470435704367043770438704397044070441704427044370444704457044670447704487044970450704517045270453704547045570456704577045870459704607046170462704637046470465704667046770468704697047070471704727047370474704757047670477704787047970480704817048270483704847048570486704877048870489704907049170492704937049470495704967049770498704997050070501705027050370504705057050670507705087050970510705117051270513705147051570516705177051870519705207052170522705237052470525705267052770528705297053070531705327053370534705357053670537705387053970540705417054270543705447054570546705477054870549705507055170552705537055470555705567055770558705597056070561705627056370564705657056670567705687056970570705717057270573705747057570576705777057870579705807058170582705837058470585705867058770588705897059070591705927059370594705957059670597705987059970600706017060270603706047060570606706077060870609706107061170612706137061470615706167061770618706197062070621706227062370624706257062670627706287062970630706317063270633706347063570636706377063870639706407064170642706437064470645706467064770648706497065070651706527065370654706557065670657706587065970660706617066270663706647066570666706677066870669706707067170672706737067470675706767067770678706797068070681706827068370684706857068670687706887068970690706917069270693706947069570696706977069870699707007070170702707037070470705707067070770708707097071070711707127071370714707157071670717707187071970720707217072270723707247072570726707277072870729707307073170732707337073470735707367073770738707397074070741707427074370744707457074670747707487074970750707517075270753707547075570756707577075870759707607076170762707637076470765707667076770768707697077070771707727077370774707757077670777707787077970780707817078270783707847078570786707877078870789707907079170792707937079470795707967079770798707997080070801708027080370804708057080670807708087080970810708117081270813708147081570816708177081870819708207082170822708237082470825708267082770828708297083070831708327083370834708357083670837708387083970840708417084270843708447084570846708477084870849708507085170852708537085470855708567085770858708597086070861708627086370864708657086670867708687086970870708717087270873708747087570876708777087870879708807088170882708837088470885708867088770888708897089070891708927089370894708957089670897708987089970900709017090270903709047090570906709077090870909709107091170912709137091470915709167091770918709197092070921709227092370924709257092670927709287092970930709317093270933709347093570936709377093870939709407094170942709437094470945709467094770948709497095070951709527095370954709557095670957709587095970960709617096270963709647096570966709677096870969709707097170972709737097470975709767097770978709797098070981709827098370984709857098670987709887098970990709917099270993709947099570996709977099870999710007100171002710037100471005710067100771008710097101071011710127101371014710157101671017710187101971020710217102271023710247102571026710277102871029710307103171032710337103471035710367103771038710397104071041710427104371044710457104671047710487104971050710517105271053710547105571056710577105871059710607106171062710637106471065710667106771068710697107071071710727107371074710757107671077710787107971080710817108271083710847108571086710877108871089710907109171092710937109471095710967109771098710997110071101711027110371104711057110671107711087110971110711117111271113711147111571116711177111871119711207112171122711237112471125711267112771128711297113071131711327113371134711357113671137711387113971140711417114271143711447114571146711477114871149711507115171152711537115471155711567115771158711597116071161711627116371164711657116671167711687116971170711717117271173711747117571176711777117871179711807118171182711837118471185711867118771188711897119071191711927119371194711957119671197711987119971200712017120271203712047120571206712077120871209712107121171212712137121471215712167121771218712197122071221712227122371224712257122671227712287122971230712317123271233712347123571236712377123871239712407124171242712437124471245712467124771248712497125071251712527125371254712557125671257712587125971260712617126271263712647126571266712677126871269712707127171272712737127471275712767127771278712797128071281712827128371284712857128671287712887128971290712917129271293712947129571296712977129871299713007130171302713037130471305713067130771308713097131071311713127131371314713157131671317713187131971320713217132271323713247132571326713277132871329713307133171332713337133471335713367133771338713397134071341713427134371344713457134671347713487134971350713517135271353713547135571356713577135871359713607136171362713637136471365713667136771368713697137071371713727137371374713757137671377713787137971380713817138271383713847138571386713877138871389713907139171392713937139471395713967139771398713997140071401714027140371404714057140671407714087140971410714117141271413714147141571416714177141871419714207142171422714237142471425714267142771428714297143071431714327143371434714357143671437714387143971440714417144271443714447144571446714477144871449714507145171452714537145471455714567145771458714597146071461714627146371464714657146671467714687146971470714717147271473714747147571476714777147871479714807148171482714837148471485714867148771488714897149071491714927149371494714957149671497714987149971500715017150271503715047150571506715077150871509715107151171512715137151471515715167151771518715197152071521715227152371524715257152671527715287152971530715317153271533715347153571536715377153871539715407154171542715437154471545715467154771548715497155071551715527155371554715557155671557715587155971560715617156271563715647156571566715677156871569715707157171572715737157471575715767157771578715797158071581715827158371584715857158671587715887158971590715917159271593715947159571596715977159871599716007160171602716037160471605716067160771608716097161071611716127161371614716157161671617716187161971620716217162271623716247162571626716277162871629716307163171632716337163471635716367163771638716397164071641716427164371644716457164671647716487164971650716517165271653716547165571656716577165871659716607166171662716637166471665716667166771668716697167071671716727167371674716757167671677716787167971680716817168271683716847168571686716877168871689716907169171692716937169471695716967169771698716997170071701717027170371704717057170671707717087170971710717117171271713717147171571716717177171871719717207172171722717237172471725717267172771728717297173071731717327173371734717357173671737717387173971740717417174271743717447174571746717477174871749717507175171752717537175471755717567175771758717597176071761717627176371764717657176671767717687176971770717717177271773717747177571776717777177871779717807178171782717837178471785717867178771788717897179071791717927179371794717957179671797717987179971800718017180271803718047180571806718077180871809718107181171812718137181471815718167181771818718197182071821718227182371824718257182671827718287182971830718317183271833718347183571836718377183871839718407184171842718437184471845718467184771848718497185071851718527185371854718557185671857718587185971860718617186271863718647186571866718677186871869718707187171872718737187471875718767187771878718797188071881718827188371884718857188671887718887188971890718917189271893718947189571896718977189871899719007190171902719037190471905719067190771908719097191071911719127191371914719157191671917719187191971920719217192271923719247192571926719277192871929719307193171932719337193471935719367193771938719397194071941719427194371944719457194671947719487194971950719517195271953719547195571956719577195871959719607196171962719637196471965719667196771968719697197071971719727197371974719757197671977719787197971980719817198271983719847198571986719877198871989719907199171992719937199471995719967199771998719997200072001720027200372004720057200672007720087200972010720117201272013720147201572016720177201872019720207202172022720237202472025720267202772028720297203072031720327203372034720357203672037720387203972040720417204272043720447204572046720477204872049720507205172052720537205472055720567205772058720597206072061720627206372064720657206672067720687206972070720717207272073720747207572076720777207872079720807208172082720837208472085720867208772088720897209072091720927209372094720957209672097720987209972100721017210272103721047210572106721077210872109721107211172112721137211472115721167211772118721197212072121721227212372124721257212672127721287212972130721317213272133721347213572136721377213872139721407214172142721437214472145721467214772148721497215072151721527215372154721557215672157721587215972160721617216272163721647216572166721677216872169721707217172172721737217472175721767217772178721797218072181721827218372184721857218672187721887218972190721917219272193721947219572196721977219872199722007220172202722037220472205722067220772208722097221072211722127221372214722157221672217722187221972220722217222272223722247222572226722277222872229722307223172232722337223472235722367223772238722397224072241722427224372244722457224672247722487224972250722517225272253722547225572256722577225872259722607226172262722637226472265722667226772268722697227072271722727227372274722757227672277722787227972280722817228272283722847228572286722877228872289722907229172292722937229472295722967229772298722997230072301723027230372304723057230672307723087230972310723117231272313723147231572316723177231872319723207232172322723237232472325723267232772328723297233072331723327233372334723357233672337723387233972340723417234272343723447234572346723477234872349723507235172352723537235472355723567235772358723597236072361723627236372364723657236672367723687236972370723717237272373723747237572376723777237872379723807238172382723837238472385723867238772388723897239072391723927239372394723957239672397723987239972400724017240272403724047240572406724077240872409724107241172412724137241472415724167241772418724197242072421724227242372424724257242672427724287242972430724317243272433724347243572436724377243872439724407244172442724437244472445724467244772448724497245072451724527245372454724557245672457724587245972460724617246272463724647246572466724677246872469724707247172472724737247472475724767247772478724797248072481724827248372484724857248672487724887248972490724917249272493724947249572496724977249872499725007250172502725037250472505725067250772508725097251072511725127251372514725157251672517725187251972520725217252272523725247252572526725277252872529725307253172532725337253472535725367253772538725397254072541725427254372544725457254672547725487254972550725517255272553725547255572556725577255872559725607256172562725637256472565725667256772568725697257072571725727257372574725757257672577725787257972580725817258272583725847258572586725877258872589725907259172592725937259472595725967259772598725997260072601726027260372604726057260672607726087260972610726117261272613726147261572616726177261872619726207262172622726237262472625726267262772628726297263072631726327263372634726357263672637726387263972640726417264272643726447264572646726477264872649726507265172652726537265472655726567265772658726597266072661726627266372664726657266672667726687266972670726717267272673726747267572676726777267872679726807268172682726837268472685726867268772688726897269072691726927269372694726957269672697726987269972700727017270272703727047270572706727077270872709727107271172712727137271472715727167271772718727197272072721727227272372724727257272672727727287272972730727317273272733727347273572736727377273872739727407274172742727437274472745727467274772748727497275072751727527275372754727557275672757727587275972760727617276272763727647276572766727677276872769727707277172772727737277472775727767277772778727797278072781727827278372784727857278672787727887278972790727917279272793727947279572796727977279872799728007280172802728037280472805728067280772808728097281072811728127281372814728157281672817728187281972820728217282272823728247282572826728277282872829728307283172832728337283472835728367283772838728397284072841728427284372844728457284672847728487284972850728517285272853728547285572856728577285872859728607286172862728637286472865728667286772868728697287072871728727287372874728757287672877728787287972880728817288272883728847288572886728877288872889728907289172892728937289472895728967289772898728997290072901729027290372904729057290672907729087290972910729117291272913729147291572916729177291872919729207292172922729237292472925729267292772928729297293072931729327293372934729357293672937729387293972940729417294272943729447294572946729477294872949729507295172952729537295472955729567295772958729597296072961729627296372964729657296672967729687296972970729717297272973 |
- #!/usr/bin/env php
- <?php
- /*
- * This file is part of Composer.
- *
- * (c) Nils Adermann <naderman@naderman.de>
- * Jordi Boggiano <j.boggiano@seld.be>
- *
- * For the full copyright and license information, please view
- * the license that is located at the bottom of this file.
- */
- // Avoid APC causing random fatal errors per https://github.com/composer/composer/issues/264
- if (extension_loaded('apc') && ini_get('apc.enable_cli') && ini_get('apc.cache_by_default')) {
- if (version_compare(phpversion('apc'), '3.0.12', '>=')) {
- ini_set('apc.cache_by_default', 0);
- } else {
- fwrite(STDERR, 'Warning: APC <= 3.0.12 may cause fatal errors when running composer commands.'.PHP_EOL);
- fwrite(STDERR, 'Update APC, or set apc.enable_cli or apc.cache_by_default to 0 in your php.ini.'.PHP_EOL);
- }
- }
- Phar::mapPhar('composer.phar');
- define('COMPOSER_DEV_WARNING_TIME', 1461527641);
- require 'phar://composer.phar/bin/composer';
- __HALT_COMPILER(); ?>
- \y��ž������
���composer.phar����+���src/Composer/Autoload/AutoloadGenerator.phpS��Y
- ÎVS��,,a¶������+���src/Composer/Autoload/ClassMapGenerator.phpS��Y
- ÎVS��1aÕ¶���������src/Composer/Cache.php…��Y
- ÎV…���”&¶������%���src/Composer/Command/AboutCommand.phpÀ��Y
- ÎVÀ��ÄiWR¶������'���src/Composer/Command/ArchiveCommand.phpá��Y
- ÎVá��Øpʶ������$���src/Composer/Command/BaseCommand.phpz��Y
- ÎVz��D\䦶������.���src/Composer/Command/BaseDependencyCommand.php¯��Y
- ÎV¯��9‚˜R¶������*���src/Composer/Command/ClearCacheCommand.php^��Y
- ÎV^��ƒ÷�¶������&���src/Composer/Command/ConfigCommand.php£:��Y
- ÎV£:��äy¶������-���src/Composer/Command/CreateProjectCommand.php‘4��Y
- ÎV‘4��<b¢"¶������'���src/Composer/Command/DependsCommand.php¶��Y
- ÎV¶��á0¶������(���src/Composer/Command/DiagnoseCommand.phpùC��Y
- ÎVùC���¿�¿¶������,���src/Composer/Command/DumpAutoloadCommand.phpß��Y
- ÎVß��¬xxK¶������&���src/Composer/Command/GlobalCommand.php��Y
- ÎV��ñç2¶������$���src/Composer/Command/HomeCommand.phpq
��Y
- ÎVq
��5�„�¶������$���src/Composer/Command/InitCommand.php8��Y
- ÎV8��2™4¶������'���src/Composer/Command/InstallCommand.php��Y
- ÎV��žß U¶������(���src/Composer/Command/LicensesCommand.php"��Y
- ÎV"��L8}'¶������)���src/Composer/Command/ProhibitsCommand.phpÊ��Y
- ÎVÊ��—ÕÓ€¶������&���src/Composer/Command/RemoveCommand.phpî��Y
- ÎVî��§hÁ¶������'���src/Composer/Command/RequireCommand.phpO��Y
- ÎVO��(ʨ“¶������)���src/Composer/Command/RunScriptCommand.phpg��Y
- ÎVg��^�ý4¶������+���src/Composer/Command/ScriptAliasCommand.php��Y
- ÎV��®%þ›¶������&���src/Composer/Command/SearchCommand.phpe ��Y
- ÎVe ��;e=¶������*���src/Composer/Command/SelfUpdateCommand.php ,��Y
- ÎV ,��Ô�\Ó¶������$���src/Composer/Command/ShowCommand.phpN@��Y
- ÎVN@��W@c²¶������&���src/Composer/Command/StatusCommand.php ��Y
- ÎV ��ïí�‹¶������(���src/Composer/Command/SuggestsCommand.php��Y
- ÎV��2ZÉa¶������&���src/Composer/Command/UpdateCommand.php‡ ��Y
- ÎV‡ ��í\1“¶������(���src/Composer/Command/ValidateCommand.php9��Y
- ÎV9��äø>®¶���������src/Composer/Composer.php) ��Y
- ÎV) ��ò§f¥¶���������src/Composer/Config.phpí��Y
- ÎVí��çmžK¶������-���src/Composer/Config/ConfigSourceInterface.php®��Y
- ÎV®��6J[ª¶������(���src/Composer/Config/JsonConfigSource.phpø
��Y
- ÎVø
��ïÓIP¶������$���src/Composer/Console/Application.phpw#��Y
- ÎVw#��åÕ'¶������,���src/Composer/Console/HtmlOutputFormatter.php3��Y
- ÎV3��Ú�Eu¶������-���src/Composer/DependencyResolver/Decisions.phpQ��Y
- ÎVQ��?˜¬$¶������1���src/Composer/DependencyResolver/DefaultPolicy.php��Y
- ÎV��õÝv¶������>���src/Composer/DependencyResolver/Operation/InstallOperation.phpC��Y
- ÎVC��´\õ*¶������I���src/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.php÷��Y
- ÎV÷��ïÎà÷¶������K���src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.phpý��Y
- ÎVý��3#†¶������@���src/Composer/DependencyResolver/Operation/OperationInterface.phpÓ���Y
- ÎVÓ���Ùâ&ä¶������=���src/Composer/DependencyResolver/Operation/SolverOperation.php¹��Y
- ÎV¹��&¢e
- ¶������@���src/Composer/DependencyResolver/Operation/UninstallOperation.phpI��Y
- ÎVI��FûÂɶ������=���src/Composer/DependencyResolver/Operation/UpdateOperation.phph��Y
- ÎVh��öSÕ]¶������3���src/Composer/DependencyResolver/PolicyInterface.php”��Y
- ÎV”��°�¶������(���src/Composer/DependencyResolver/Pool.php³!��Y
- ÎV³!��Td¥¶������+���src/Composer/DependencyResolver/Problem.phpí��Y
- ÎVí��nû…¶������+���src/Composer/DependencyResolver/Request.php€��Y
- ÎV€��Ðwƒ¶������(���src/Composer/DependencyResolver/Rule.phpã��Y
- ÎVã��,¤Y¬¶������+���src/Composer/DependencyResolver/RuleSet.php
- ��Y
- ÎV
- ��:Z�E¶������4���src/Composer/DependencyResolver/RuleSetGenerator.php]��Y
- ÎV]��4“Ñ9¶������3���src/Composer/DependencyResolver/RuleSetIterator.php��Y
- ÎV��}õÇù¶������2���src/Composer/DependencyResolver/RuleWatchChain.phpi��Y
- ÎVi��hïš,¶������2���src/Composer/DependencyResolver/RuleWatchGraph.phpÜ��Y
- ÎVÜ��‰8¶������1���src/Composer/DependencyResolver/RuleWatchNode.phpç��Y
- ÎVç��—Þȶ������*���src/Composer/DependencyResolver/Solver.php7��Y
- ÎV7��@ÿ¶������6���src/Composer/DependencyResolver/SolverBugException.php˜��Y
- ÎV˜��"qN¶������;���src/Composer/DependencyResolver/SolverProblemsException.php[��Y
- ÎV[��bQgJ¶������/���src/Composer/DependencyResolver/Transaction.phpÔ��Y
- ÎVÔ�� 3ô¶������-���src/Composer/Downloader/ArchiveDownloader.php¢��Y
- ÎV¢��vmtO¶������1���src/Composer/Downloader/ChangeReportInterface.phpÌ���Y
- ÎVÌ���¯à¨¿¶������+���src/Composer/Downloader/DownloadManager.phpÈ��Y
- ÎVÈ��Wõ8C¶������/���src/Composer/Downloader/DownloaderInterface.phpÊ��Y
- ÎVÊ��gs!l¶������*���src/Composer/Downloader/FileDownloader.php´��Y
- ÎV´��àïL“¶������/���src/Composer/Downloader/FilesystemException.php
- ��Y
- ÎV
- ��.-‹¶������)���src/Composer/Downloader/GitDownloader.php&��Y
- ÎV&��@§Ðw¶������*���src/Composer/Downloader/GzipDownloader.phpé��Y
- ÎVé��ÃïÞ÷¶������(���src/Composer/Downloader/HgDownloader.phpÊ��Y
- ÎVÊ��sG6÷¶������*���src/Composer/Downloader/PathDownloader.php
��Y
- ÎV
��+àý¶������0���src/Composer/Downloader/PearPackageExtractor.phpu��Y
- ÎVu��z„‡¶������.���src/Composer/Downloader/PerforceDownloader.php¾��Y
- ÎV¾��›lƒ“¶������*���src/Composer/Downloader/PharDownloader.phpå���Y
- ÎVå���ÞÉç¶������)���src/Composer/Downloader/RarDownloader.php%��Y
- ÎV%��û¥ .¶������)���src/Composer/Downloader/SvnDownloader.phpH��Y
- ÎVH��Tp¥¶������)���src/Composer/Downloader/TarDownloader.phpã���Y
- ÎVã���Í’X?¶������.���src/Composer/Downloader/TransportException.php=��Y
- ÎV=��ZÎÈÞ¶������)���src/Composer/Downloader/VcsDownloader.php®��Y
- ÎV®��v6¡þ¶������(���src/Composer/Downloader/XzDownloader.php§��Y
- ÎV§��W$;á¶������)���src/Composer/Downloader/ZipDownloader.php£��Y
- ÎV£��GYš¶������&���src/Composer/EventDispatcher/Event.php ��Y
- ÎV ��±™jï¶������0���src/Composer/EventDispatcher/EventDispatcher.phpE"��Y
- ÎVE"��f0Ǧ¶������9���src/Composer/EventDispatcher/EventSubscriberInterface.php©���Y
- ÎV©���h·0¶���������src/Composer/Factory.phpr@��Y
- ÎVr@��=$”P¶���������src/Composer/IO/BaseIO.php'��Y
- ÎV'��=DΧ¶���������src/Composer/IO/BufferIO.php,��Y
- ÎV,��§Y~¶���������src/Composer/IO/ConsoleIO.php[��Y
- ÎV[��<ÇÅÿ¶���������src/Composer/IO/IOInterface.phpU��Y
- ÎVU��@Èö���������src/Composer/IO/NullIO.php��Y
- ÎV��ôvA�¶���������src/Composer/Installer.phpÈ‚��Y
- ÎVÈ‚��Šå颶������.���src/Composer/Installer/InstallationManager.php��Y
- ÎV��ÓýÇÛ¶������)���src/Composer/Installer/InstallerEvent.php��Y
- ÎV��lÔzi¶������*���src/Composer/Installer/InstallerEvents.phpÞ���Y
- ÎVÞ���ìŸ@G¶������-���src/Composer/Installer/InstallerInterface.phpã��Y
- ÎVã��^ƒ“ʶ������+���src/Composer/Installer/LibraryInstaller.phpÆ!��Y
- ÎVÆ!��
- sµ¶������/���src/Composer/Installer/MetapackageInstaller.phpœ��Y
- ÎVœ��ÆÅ!¶������(���src/Composer/Installer/NoopInstaller.php+��Y
- ÎV+��À·M}¶������'���src/Composer/Installer/PackageEvent.phpe��Y
- ÎVe��;° ¶������(���src/Composer/Installer/PackageEvents.php¸��Y
- ÎV¸��dbØs¶������(���src/Composer/Installer/PearInstaller.php_��Y
- ÎV_��/G3á¶������*���src/Composer/Installer/PluginInstaller.php
- ��Y
- ÎV
- ��6À¢�¶������+���src/Composer/Installer/ProjectInstaller.php��Y
- ÎV��*0@P¶���������src/Composer/Json/JsonFile.php¯��Y
- ÎV¯��°«#\¶������#���src/Composer/Json/JsonFormatter.php��Y
- ÎV��Ðqu¶������%���src/Composer/Json/JsonManipulator.php*��Y
- ÎV*��r%¶������-���src/Composer/Json/JsonValidationException.php\��Y
- ÎV\��.Xóܶ������%���src/Composer/Package/AliasPackage.php��Y
- ÎV��PÈa£¶������7���src/Composer/Package/Archiver/ArchivableFilesFinder.php¾��Y
- ÎV¾��„Œõɶ������0���src/Composer/Package/Archiver/ArchiveManager.phpz��Y
- ÎVz��!sK™¶������3���src/Composer/Package/Archiver/ArchiverInterface.phpï���Y
- ÎVï���<ʸ¶������3���src/Composer/Package/Archiver/BaseExcludeFilter.php‘��Y
- ÎV‘��[ÿ0=¶������7���src/Composer/Package/Archiver/ComposerExcludeFilter.php��Y
- ÎV��‹SZ0¶������2���src/Composer/Package/Archiver/GitExcludeFilter.phpw��Y
- ÎVw��LgU»¶������1���src/Composer/Package/Archiver/HgExcludeFilter.php��Y
- ÎV��~”¸¶������.���src/Composer/Package/Archiver/PharArchiver.php¶��Y
- ÎV¶��øD½Ô¶������-���src/Composer/Package/Archiver/ZipArchiver.phpÿ��Y
- ÎVÿ��¼| ¶������$���src/Composer/Package/BasePackage.php=
��Y
- ÎV=
��Î�ç¶������(���src/Composer/Package/CompletePackage.phpÿ��Y
- ÎVÿ��o+ã ¶������1���src/Composer/Package/CompletePackageInterface.phpõ��Y
- ÎVõ��¦Ê�ò¶������+���src/Composer/Package/Dumper/ArrayDumper.phpì��Y
- ÎVì��ª–æ¶���������src/Composer/Package/Link.phpˆ��Y
- ÎVˆ��å¶Y«¶������7���src/Composer/Package/LinkConstraint/EmptyConstraint.php‚��Y
- ÎV‚��é~‹¶������?���src/Composer/Package/LinkConstraint/LinkConstraintInterface.phpd��Y
- ÎVd��¤ôLn¶������7���src/Composer/Package/LinkConstraint/MultiConstraint.php‚��Y
- ÎV‚��ób`ý¶������:���src/Composer/Package/LinkConstraint/SpecificConstraint.phpi��Y
- ÎVi��Þ”š%¶������9���src/Composer/Package/LinkConstraint/VersionConstraint.phpX��Y
- ÎVX��}`y¶������+���src/Composer/Package/Loader/ArrayLoader.php0��Y
- ÎV0��F±¶������7���src/Composer/Package/Loader/InvalidPackageException.phpE��Y
- ÎVE��xb¾¶������*���src/Composer/Package/Loader/JsonLoader.phpù��Y
- ÎVù��!~ˆ{¶������/���src/Composer/Package/Loader/LoaderInterface.php²���Y
- ÎV²���¦}úζ������1���src/Composer/Package/Loader/RootPackageLoader.php��Y
- ÎV��³PE^¶������5���src/Composer/Package/Loader/ValidatingArrayLoader.phpò/��Y
- ÎVò/��?Ðþ˜¶���������src/Composer/Package/Locker.php�!��Y
- ÎV�!��=-w’¶������ ���src/Composer/Package/Package.phpÉ��Y
- ÎVÉ��cÃ�h¶������)���src/Composer/Package/PackageInterface.php ��Y
- ÎV ��ûÇ^ƶ������)���src/Composer/Package/RootAliasPackage.php×��Y
- ÎV×�� ζ������$���src/Composer/Package/RootPackage.phpn��Y
- ÎVn��áACO¶������-���src/Composer/Package/RootPackageInterface.php–��Y
- ÎV–��ÿfÆg¶������/���src/Composer/Package/Version/VersionGuesser.phpû��Y
- ÎVû��9¼Ò¶������.���src/Composer/Package/Version/VersionParser.phpø��Y
- ÎVø��¾3l¶������0���src/Composer/Package/Version/VersionSelector.phpè��Y
- ÎVè��5j8׶������-���src/Composer/Plugin/Capability/Capability.phpW���Y
- ÎVW���æ_¨1¶���������src/Composer/Plugin/Capable.php���Y
- ÎV���Æq+¶������$���src/Composer/Plugin/CommandEvent.phpâ��Y
- ÎVâ��³ÆÇW¶������$���src/Composer/Plugin/PluginEvents.php¤���Y
- ÎV¤���0ïÞX¶������'���src/Composer/Plugin/PluginInterface.phpô���Y
- ÎVô���1‰%¶������%���src/Composer/Plugin/PluginManager.php ��Y
- ÎV ��R k3¶������,���src/Composer/Plugin/PreFileDownloadEvent.php`��Y
- ÎV`���9-ζ������+���src/Composer/Repository/ArrayRepository.php}
��Y
- ÎV}
��ç>Š¶������.���src/Composer/Repository/ArtifactRepository.phpÿ��Y
- ÎVÿ��[Ú�¶������*���src/Composer/Repository/BaseRepository.phpí��Y
- ÎVí��Í›} ¶������.���src/Composer/Repository/ComposerRepository.php!K��Y
- ÎV!K��„ lâ¶������/���src/Composer/Repository/CompositeRepository.php&��Y
- ÎV&��Á'f¶������;���src/Composer/Repository/ConfigurableRepositoryInterface.php…���Y
- ÎV…���±Ÿ_¶������0���src/Composer/Repository/FilesystemRepository.phpÀ��Y
- ÎVÀ��&xb£¶������4���src/Composer/Repository/InstalledArrayRepository.php£���Y
- ÎV£���/ö~>¶������9���src/Composer/Repository/InstalledFilesystemRepository.php£���Y
- ÎV£���V
- •_¶������8���src/Composer/Repository/InstalledRepositoryInterface.php‡���Y
- ÎV‡���£9p¶������6���src/Composer/Repository/InvalidRepositoryException.phpn���Y
- ÎVn���à“똶������-���src/Composer/Repository/PackageRepository.phpG��Y
- ÎVG��í:k¶������*���src/Composer/Repository/PathRepository.phpK��Y
- ÎVK�� yÐ˶������2���src/Composer/Repository/Pear/BaseChannelReader.php6��Y
- ÎV6��.fi!¶������,���src/Composer/Repository/Pear/ChannelInfo.phpÄ��Y
- ÎVÄ��:T*ɶ������.���src/Composer/Repository/Pear/ChannelReader.phpn��Y
- ÎVn��š8¶������4���src/Composer/Repository/Pear/ChannelRest10Reader.phpÁ ��Y
- ÎVÁ ��O€ë¶������4���src/Composer/Repository/Pear/ChannelRest11Reader.php& ��Y
- ÎV& ��òUb¶������5���src/Composer/Repository/Pear/DependencyConstraint.phpq��Y
- ÎVq��9=¶������/���src/Composer/Repository/Pear/DependencyInfo.phpq��Y
- ÎVq��fºTò¶������8���src/Composer/Repository/Pear/PackageDependencyParser.php%��Y
- ÎV%��j?“¶������,���src/Composer/Repository/Pear/PackageInfo.php°��Y
- ÎV°��Ÿ
¸¶������,���src/Composer/Repository/Pear/ReleaseInfo.php’��Y
- ÎV’��o“ŠÃ¶������*���src/Composer/Repository/PearRepository.php“��Y
- ÎV“��¾©IJ¶������.���src/Composer/Repository/PlatformRepository.phpG��Y
- ÎVG��}ýÙ¶������/���src/Composer/Repository/RepositoryInterface.phpÚ��Y
- ÎVÚ��7@€¶������-���src/Composer/Repository/RepositoryManager.php# ��Y
- ÎV# ���Ê>¶������7���src/Composer/Repository/RepositorySecurityException.phpo���Y
- ÎVo���pÕ«ª¶������2���src/Composer/Repository/Vcs/GitBitbucketDriver.php¥��Y
- ÎV¥�� ý¶������)���src/Composer/Repository/Vcs/GitDriver.php��Y
- ÎV��\îï¶������,���src/Composer/Repository/Vcs/GitHubDriver.phpã'��Y
- ÎVã'��ØŸô¶������,���src/Composer/Repository/Vcs/GitLabDriver.phpx��Y
- ÎVx��Tù‰¶������1���src/Composer/Repository/Vcs/HgBitbucketDriver.php��Y
- ÎV��š÷ÖT¶������(���src/Composer/Repository/Vcs/HgDriver.phpà��Y
- ÎVà��ñ‘綶������.���src/Composer/Repository/Vcs/PerforceDriver.php"
- ��Y
- ÎV"
- ��°`ìE¶������)���src/Composer/Repository/Vcs/SvnDriver.php²��Y
- ÎV²��Ë W¶������)���src/Composer/Repository/Vcs/VcsDriver.phpÿ��Y
- ÎVÿ��*ßÙ¶������2���src/Composer/Repository/Vcs/VcsDriverInterface.phpˆ��Y
- ÎVˆ��ŽP©Î¶������)���src/Composer/Repository/VcsRepository.php£��Y
- ÎV£���Žg¶������3���src/Composer/Repository/WritableArrayRepository.php��Y
- ÎV��¾G*¶������7���src/Composer/Repository/WritableRepositoryInterface.php‰��Y
- ÎV‰��‘/sï¶������$���src/Composer/Script/CommandEvent.phpW���Y
- ÎVW���£VZt¶���������src/Composer/Script/Event.phpµ��Y
- ÎVµ��lt¦M¶������$���src/Composer/Script/PackageEvent.phpœ���Y
- ÎVœ���§ÿÉ
¶������$���src/Composer/Script/ScriptEvents.phpP��Y
- ÎVP��‡�¶¶������ ���src/Composer/Util/AuthHelper.phpË��Y
- ÎVË��>zx–¶������$���src/Composer/Util/ComposerMirror.php±��Y
- ÎV±��½øض������%���src/Composer/Util/ConfigValidator.php&��Y
- ÎV&��î:äü¶������"���src/Composer/Util/ErrorHandler.php‡��Y
- ÎV‡��He"¶������ ���src/Composer/Util/Filesystem.phpƒ,��Y
- ÎVƒ,��“H_·¶���������src/Composer/Util/Git.php-��Y
- ÎV-��˜,…¬¶���������src/Composer/Util/GitHub.php¯
- ��Y
- ÎV¯
- ��àÏ ¶���������src/Composer/Util/GitLab.php³��Y
- ÎV³��4‚õ¶���������src/Composer/Util/Keys.php—��Y
- ÎV—��eƒd³¶������$���src/Composer/Util/NoProxyPattern.php¾��Y
- ÎV¾��Z+°m¶���������src/Composer/Util/Perforce.phpÅ2��Y
- ÎVÅ2��ì»^¶���������src/Composer/Util/Platform.php™���Y
- ÎV™���ù$5¶������%���src/Composer/Util/ProcessExecutor.phpÞ��Y
- ÎVÞ��Þíж������&���src/Composer/Util/RemoteFilesystem.phpBY��Y
- ÎVBY��Æÿ²œ¶���������src/Composer/Util/Silencer.phpñ��Y
- ÎVñ��mvý¶������!���src/Composer/Util/SpdxLicense.php��Y
- ÎV��¾7
- �����*���src/Composer/Util/StreamContextFactory.php�Y
- ÎVä��ÂB‰©¶���������src/Composer/Util/Svn.php†��Y
- ÎV†��e@î¶���������src/Composer/Util/TlsHelper.phpå��Y
- ÎVå���ÞŠ¶���������src/bootstrap.php¹��Y
- ÎV¹��I}œ¶������%���src/Composer/Autoload/ClassLoader.php²0��Y
- ÎV²0��ú�Ý]¶���������res/composer-schema.json¶_��Y
- ÎV¶_��r§¶������6���vendor/composer/spdx-licenses/res/spdx-exceptions.json¥��Y
- ÎV¥��vd�Š¶������4���vendor/composer/spdx-licenses/res/spdx-licenses.jsonK_��Y
- ÎVK_��€q ¾¶������*���vendor/seld/cli-prompt/res/hiddeninput.exe�$��Y
- ÎV�$��•�¥v¶������&���vendor/symfony/console/Application.phpºU��Y
- ÎVºU��µ×Æb¶������*���vendor/symfony/console/Command/Command.phpO ��Y
- ÎVO ��æ¾(¶������.���vendor/symfony/console/Command/HelpCommand.phpÝ��Y
- ÎVÝ��.Ø™u¶������.���vendor/symfony/console/Command/ListCommand.phpZ��Y
- ÎVZ��É£ ¶������(���vendor/symfony/console/ConsoleEvents.phpï���Y
- ÎVï���
ÕH¸¶������<���vendor/symfony/console/Descriptor/ApplicationDescription.phpß��Y
- ÎVß��µŒ°7¶������0���vendor/symfony/console/Descriptor/Descriptor.php���Y
- ÎV���;~Ķ������9���vendor/symfony/console/Descriptor/DescriptorInterface.phpü���Y
- ÎVü���±Qµ¶������4���vendor/symfony/console/Descriptor/JsonDescriptor.phpš
��Y
- ÎVš
��l¬¶������8���vendor/symfony/console/Descriptor/MarkdownDescriptor.php��Y
- ÎV��?wn¶������4���vendor/symfony/console/Descriptor/TextDescriptor.phpå��Y
- ÎVå��¯cŶ������3���vendor/symfony/console/Descriptor/XmlDescriptor.php��Y
- ÎV��‹P$¶������4���vendor/symfony/console/Event/ConsoleCommandEvent.php²��Y
- ÎV²��Zk‰2¶������-���vendor/symfony/console/Event/ConsoleEvent.phpÅ��Y
- ÎVÅ��ÒxÛ\¶������6���vendor/symfony/console/Event/ConsoleExceptionEvent.php��Y
- ÎV��á2é¶������6���vendor/symfony/console/Event/ConsoleTerminateEvent.phpz��Y
- ÎVz��³,îL¶������=���vendor/symfony/console/Exception/CommandNotFoundException.phpÔ��Y
- ÎVÔ��È÷ L¶������7���vendor/symfony/console/Exception/ExceptionInterface.phpf���Y
- ÎVf���¡ABª¶������=���vendor/symfony/console/Exception/InvalidArgumentException.php¦���Y
- ÎV¦���Ö̽Z¶������;���vendor/symfony/console/Exception/InvalidOptionException.php¦���Y
- ÎV¦���Ë×H¶������3���vendor/symfony/console/Exception/LogicException.php’���Y
- ÎV’���ÍO\e¶������5���vendor/symfony/console/Exception/RuntimeException.php–���Y
- ÎV–���Ùí,6¶������4���vendor/symfony/console/Formatter/OutputFormatter.php³��Y
- ÎV³��(¯o¶������=���vendor/symfony/console/Formatter/OutputFormatterInterface.phpŠ��Y
- ÎVŠ��:߶������9���vendor/symfony/console/Formatter/OutputFormatterStyle.phpL��Y
- ÎVL��Š�8<¶������B���vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php†��Y
- ÎV†��ÝRÚ¶������>���vendor/symfony/console/Formatter/OutputFormatterStyleStack.phpL��Y
- ÎVL��.=b¶������6���vendor/symfony/console/Helper/DebugFormatterHelper.phpx��Y
- ÎVx��N©Ø¼¶������2���vendor/symfony/console/Helper/DescriptorHelper.phpz��Y
- ÎVz��fÉÚý¶������.���vendor/symfony/console/Helper/DialogHelper.phpY��Y
- ÎVY��þkl»¶������1���vendor/symfony/console/Helper/FormatterHelper.phpc��Y
- ÎVc��“ý«N¶������(���vendor/symfony/console/Helper/Helper.php©��Y
- ÎV©��zɶ������1���vendor/symfony/console/Helper/HelperInterface.phpç���Y
- ÎVç��� Çã¶������+���vendor/symfony/console/Helper/HelperSet.phpÊ��Y
- ÎVÊ��f!6>¶������2���vendor/symfony/console/Helper/InputAwareHelper.phpc��Y
- ÎVc��ñø�|¶������/���vendor/symfony/console/Helper/ProcessHelper.phpÑ ��Y
- ÎVÑ ��@±ã�¶������-���vendor/symfony/console/Helper/ProgressBar.php;'��Y
- ÎV;'��Äڂ˶������0���vendor/symfony/console/Helper/ProgressHelper.phpÚ��Y
- ÎVÚ��ÙþñT¶������3���vendor/symfony/console/Helper/ProgressIndicator.php¶��Y
- ÎV¶��eØ¡¶������0���vendor/symfony/console/Helper/QuestionHelper.php��Y
- ÎV��䢜B¶������7���vendor/symfony/console/Helper/SymfonyQuestionHelper.phpl��Y
- ÎVl��C�æo¶������'���vendor/symfony/console/Helper/Table.php{)��Y
- ÎV{)���Ÿ|j¶������+���vendor/symfony/console/Helper/TableCell.php:��Y
- ÎV:��7®�¶������-���vendor/symfony/console/Helper/TableHelper.php��Y
- ÎV��¦pm‡¶������0���vendor/symfony/console/Helper/TableSeparator.phpÎ���Y
- ÎVÎ���<f;£¶������,���vendor/symfony/console/Helper/TableStyle.php
- ��Y
- ÎV
- ��PÞµ¦¶������*���vendor/symfony/console/Input/ArgvInput.php��Y
- ÎV��ä�~å¶������+���vendor/symfony/console/Input/ArrayInput.phpp
- ��Y
- ÎVp
- ��Õ¤¾¶������&���vendor/symfony/console/Input/Input.phpÔ��Y
- ÎVÔ��ä ñ¶������.���vendor/symfony/console/Input/InputArgument.php��Y
- ÎV��ÁÜ�¶������4���vendor/symfony/console/Input/InputAwareInterface.phpš���Y
- ÎVš���‡jTŸ¶������0���vendor/symfony/console/Input/InputDefinition.php“��Y
- ÎV“��Éÿÿã¶������/���vendor/symfony/console/Input/InputInterface.php ��Y
- ÎV ��9”øǶ������,���vendor/symfony/console/Input/InputOption.php��Y
- ÎV��‡¹§¶������,���vendor/symfony/console/Input/StringInput.php˜��Y
- ÎV˜�� Ú¤¶���������vendor/symfony/console/LICENSE)��Y
- ÎV)��¹ô¶������/���vendor/symfony/console/Logger/ConsoleLogger.php< ��Y
- ÎV< ��:âÇl¶������0���vendor/symfony/console/Output/BufferedOutput.php_��Y
- ÎV_��ûBÍ·¶������/���vendor/symfony/console/Output/ConsoleOutput.phpµ��Y
- ÎVµ��
- ¢S\¶������8���vendor/symfony/console/Output/ConsoleOutputInterface.phpå���Y
- ÎVå���rNô�¶������,���vendor/symfony/console/Output/NullOutput.phpÃ��Y
- ÎVÃ��ZÅl¶������(���vendor/symfony/console/Output/Output.phpŽ ��Y
- ÎVŽ ��x:l¥¶������1���vendor/symfony/console/Output/OutputInterface.php��Y
- ÎV��ÓÚ>¶������.���vendor/symfony/console/Output/StreamOutput.php7��Y
- ÎV7��iCœ¶������2���vendor/symfony/console/Question/ChoiceQuestion.phpÝ ��Y
- ÎVÝ ��°§Â¶������8���vendor/symfony/console/Question/ConfirmationQuestion.phpé��Y
- ÎVé��ƒQ@¶������,���vendor/symfony/console/Question/Question.php
- ��Y
- ÎV
- ���{¶������ ���vendor/symfony/console/Shell.phpé��Y
- ÎVé��½fü‘¶������,���vendor/symfony/console/Style/OutputStyle.php_��Y
- ÎV_��ûµ¶������/���vendor/symfony/console/Style/StyleInterface.phpÔ��Y
- ÎVÔ�� ßÊj¶������-���vendor/symfony/console/Style/SymfonyStyle.phpE��Y
- ÎVE���72¶������3���vendor/symfony/console/Tester/ApplicationTester.phpÔ��Y
- ÎVÔ��¬ì¤d¶������/���vendor/symfony/console/Tester/CommandTester.php®��Y
- ÎV®��EÙš|¶������:���vendor/symfony/filesystem/Exception/ExceptionInterface.phpi���Y
- ÎVi���$ ÿ›¶������=���vendor/symfony/filesystem/Exception/FileNotFoundException.php¼��Y
- ÎV¼��pí\¶¶������3���vendor/symfony/filesystem/Exception/IOException.php‡��Y
- ÎV‡��€ü#Ѷ������<���vendor/symfony/filesystem/Exception/IOExceptionInterface.php¦���Y
- ÎV¦���jÙwM¶������(���vendor/symfony/filesystem/Filesystem.php@+��Y
- ÎV@+��»ç¶������!���vendor/symfony/filesystem/LICENSE)��Y
- ÎV)��¹ô¶������)���vendor/symfony/filesystem/LockHandler.php���Y
- ÎV���f÷#ƒ¶������1���vendor/symfony/finder/Adapter/AbstractAdapter.php\��Y
- ÎV\��Æ“É€¶������5���vendor/symfony/finder/Adapter/AbstractFindAdapter.php™��Y
- ÎV™��p\Z3¶������2���vendor/symfony/finder/Adapter/AdapterInterface.php±��Y
- ÎV±��ä»Ê&¶������0���vendor/symfony/finder/Adapter/BsdFindAdapter.php2��Y
- ÎV2��Q/ÇC¶������0���vendor/symfony/finder/Adapter/GnuFindAdapter.php��Y
- ÎV��
¡¾¶������,���vendor/symfony/finder/Adapter/PhpAdapter.phpô��Y
- ÎVô��:?¶������/���vendor/symfony/finder/Comparator/Comparator.phpŒ��Y
- ÎVŒ��wþT¶������3���vendor/symfony/finder/Comparator/DateComparator.php%��Y
- ÎV%��L¿EǶ������5���vendor/symfony/finder/Comparator/NumberComparator.php~��Y
- ÎV~��”‡ x¶������9���vendor/symfony/finder/Exception/AccessDeniedException.php„���Y
- ÎV„���½¾sœ¶������;���vendor/symfony/finder/Exception/AdapterFailureException.php¯��Y
- ÎV¯��œôÔÁ¶������6���vendor/symfony/finder/Exception/ExceptionInterface.php„���Y
- ÎV„���Gz-¶������A���vendor/symfony/finder/Exception/OperationNotPermitedException.php)��Y
- ÎV)��ìcj=¶������@���vendor/symfony/finder/Exception/ShellCommandFailureException.phpÂ��Y
- ÎVÂ��v‚ȶ������/���vendor/symfony/finder/Expression/Expression.php��Y
- ÎV��µoÔ¶������)���vendor/symfony/finder/Expression/Glob.phpi��Y
- ÎVi��@Šº¶������*���vendor/symfony/finder/Expression/Regex.php��Y
- ÎV��p8�\¶������3���vendor/symfony/finder/Expression/ValueInterface.phpÍ��Y
- ÎVÍ��²~øb¶������ ���vendor/symfony/finder/Finder.phpÂ-��Y
- ÎVÂ-��˜f´¶���������vendor/symfony/finder/Glob.php4��Y
- ÎV4��°Ba³¶������7���vendor/symfony/finder/Iterator/CustomFilterIterator.php]��Y
- ÎV]��tà±µ¶������:���vendor/symfony/finder/Iterator/DateRangeFilterIterator.phpz��Y
- ÎVz��}¢¶������;���vendor/symfony/finder/Iterator/DepthRangeFilterIterator.phpð��Y
- ÎVð��ß0™¶������A���vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.phpÊ��Y
- ÎVÊ���96†¶������4���vendor/symfony/finder/Iterator/FilePathsIterator.php ��Y
- ÎV ��fQCe¶������9���vendor/symfony/finder/Iterator/FileTypeFilterIterator.php\��Y
- ÎV\��p‘'˜¶������<���vendor/symfony/finder/Iterator/FilecontentFilterIterator.php5��Y
- ÎV5��ší¶������9���vendor/symfony/finder/Iterator/FilenameFilterIterator.phpr��Y
- ÎVr��tu¶������1���vendor/symfony/finder/Iterator/FilterIterator.php†��Y
- ÎV†��0£¾Ô¶������=���vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php/��Y
- ÎV/��»ÇY¶������5���vendor/symfony/finder/Iterator/PathFilterIterator.phpÏ��Y
- ÎVÏ��ºªÇ¶������=���vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.phpw��Y
- ÎVw��op›¶������:���vendor/symfony/finder/Iterator/SizeRangeFilterIterator.phpg��Y
- ÎVg��!Ô—é¶������3���vendor/symfony/finder/Iterator/SortableIterator.phpØ��Y
- ÎVØ��`‹>c¶���������vendor/symfony/finder/LICENSE)��Y
- ÎV)��¹ô¶������'���vendor/symfony/finder/Shell/Command.phpS��Y
- ÎVS��cC…™¶������%���vendor/symfony/finder/Shell/Shell.phpp��Y
- ÎVp��Ó}g¶������%���vendor/symfony/finder/SplFileInfo.phpû��Y
- ÎVû��‘†6¶������(���vendor/symfony/polyfill-mbstring/LICENSE)��Y
- ÎV)��î*L¶������-���vendor/symfony/polyfill-mbstring/Mbstring.php50��Y
- ÎV50��ŠA�º¶������.���vendor/symfony/polyfill-mbstring/bootstrap.phpo��Y
- ÎVo��c×5¶������7���vendor/symfony/process/Exception/ExceptionInterface.phpf���Y
- ÎVf���]ö>T¶������=���vendor/symfony/process/Exception/InvalidArgumentException.php¨���Y
- ÎV¨���ÐÀ+_¶������3���vendor/symfony/process/Exception/LogicException.php”���Y
- ÎV”��� ³ãñ¶������;���vendor/symfony/process/Exception/ProcessFailedException.phpx��Y
- ÎVx��¨Ìzy¶������=���vendor/symfony/process/Exception/ProcessTimedOutException.php��Y
- ÎV��. Ãá¶������5���vendor/symfony/process/Exception/RuntimeException.php˜���Y
- ÎV˜���¢Ø:¶������+���vendor/symfony/process/ExecutableFinder.php���Y
- ÎV���ò)åܶ���������vendor/symfony/process/LICENSE)��Y
- ÎV)��¹ô¶������.���vendor/symfony/process/PhpExecutableFinder.phpg��Y
- ÎVg���絶������%���vendor/symfony/process/PhpProcess.phpü��Y
- ÎVü��_—9¶������.���vendor/symfony/process/Pipes/AbstractPipes.php���Y
- ÎV���˜|¥¾¶������/���vendor/symfony/process/Pipes/PipesInterface.phpD��Y
- ÎVD��vØ������*���vendor/symfony/process/Pipes/UnixPipes.php¤��Y
- ÎV¤��øUt¶������-���vendor/symfony/process/Pipes/WindowsPipes.php���Y
- ÎV���–)¾n¶������"���vendor/symfony/process/Process.phpQ��Y
- ÎVQ��Z¬Ë¶������)���vendor/symfony/process/ProcessBuilder.php��Y
- ÎV��„8<²¶������'���vendor/symfony/process/ProcessUtils.php��Y
- ÎV��^ܲ"¶���������vendor/seld/jsonlint/LICENSE"��Y
- ÎV"��aƒsy¶������@���vendor/seld/jsonlint/src/Seld/JsonLint/DuplicateKeyException.php*��Y
- ÎV*��•pñ¶������5���vendor/seld/jsonlint/src/Seld/JsonLint/JsonParser.php“1��Y
- ÎV“1���P¦¶������0���vendor/seld/jsonlint/src/Seld/JsonLint/Lexer.php��Y
- ÎV��‰„m!¶������;���vendor/seld/jsonlint/src/Seld/JsonLint/ParsingException.php��Y
- ÎV��‰²ñ¶������4���vendor/seld/jsonlint/src/Seld/JsonLint/Undefined.php>���Y
- ÎV>���ÿqŸŸ¶���������vendor/seld/cli-prompt/LICENSE"��Y
- ÎV"��ˆñ?e¶������&���vendor/seld/cli-prompt/res/example.php'��Y
- ÎV'��I£¶������(���vendor/seld/cli-prompt/src/CliPrompt.php��Y
- ÎV��é™v¶������(���vendor/justinrainbow/json-schema/LICENSE÷��Y
- ÎV÷��xÞxt¶������T���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/CollectionConstraint.phpù ��Y
- ÎVù ��ð&•Ø¶������J���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php›��Y
- ÎV›��˜‘(c¶������S���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ConstraintInterface.phpr��Y
- ÎVr��ã{s6¶������N���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.phpx��Y
- ÎVx��ÒÙ‘¶������G���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Factory.php€��Y
- ÎV€��£C¯¶������P���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php—��Y
- ÎV—��rÙ‚¶������P���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/NumberConstraint.php�
- ��Y
- ÎV�
- ��½K¸‰¶������P���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.phpÙ��Y
- ÎVÙ��ÆA€r¶������P���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php ��Y
- ÎV ��ÈÌÕâ¶������P���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.phpQ��Y
- ÎVQ��xÐø¼¶������N���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeConstraint.phpÆ��Y
- ÎVÆ��ÜòÚŠ¶������S���vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.phpç��Y
- ÎVç��^�gÓ¶������V���vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidArgumentException.phpv���Y
- ÎVv���¬ «"¶������]���vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidSchemaMediaTypeException.phpv���Y
- ÎVv���ŠCÓ¶������W���vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidSourceUriException.phpw���Y
- ÎVw���N-ò[¶������S���vendor/justinrainbow/json-schema/src/JsonSchema/Exception/JsonDecodingException.phpÞ��Y
- ÎVÞ��†¾©‘¶������W���vendor/justinrainbow/json-schema/src/JsonSchema/Exception/ResourceNotFoundException.phpo���Y
- ÎVo���Æ$"Ŷ������R���vendor/justinrainbow/json-schema/src/JsonSchema/Exception/UriResolverException.phpj���Y
- ÎVj���SÓdz¶������?���vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.phpÒ
��Y
- ÎVÒ
��K$¤¶������T���vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/AbstractRetriever.phpÜ���Y
- ÎVÜ���]j¶������G���vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.phpt��Y
- ÎVt��I·ý�¶������R���vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.phpb��Y
- ÎVb��WýÁ¶������R���vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php*��Y
- ÎV*��-3ÿ¶������X���vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/UriRetrieverInterface.php©���Y
- ÎV©���CO¶������C���vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.phpR ��Y
- ÎVR ��pÿi1¶������D���vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriRetriever.phpa��Y
- ÎVa��¾,Η¶������=���vendor/justinrainbow/json-schema/src/JsonSchema/Validator.phpÛ��Y
- ÎVÛ��zD4¶������%���vendor/composer/spdx-licenses/LICENSE��Y
- ÎV��Bhí¶������2���vendor/composer/spdx-licenses/src/SpdxLicenses.phpå��Y
- ÎVå��=Ø7¶���������vendor/composer/semver/LICENSE��Y
- ÎV��Bhí¶������)���vendor/composer/semver/src/Comparator.php��Y
- ÎV��wlƒï¶������<���vendor/composer/semver/src/Constraint/AbstractConstraint.php×��Y
- ÎV×��õî>Ž¶������4���vendor/composer/semver/src/Constraint/Constraint.phpª��Y
- ÎVª��ÇO7²¶������=���vendor/composer/semver/src/Constraint/ConstraintInterface.phpß���Y
- ÎVß���0C,‡¶������9���vendor/composer/semver/src/Constraint/EmptyConstraint.phpé��Y
- ÎVé��!-Ø™¶������9���vendor/composer/semver/src/Constraint/MultiConstraint.phpf��Y
- ÎVf��Dðì>¶������%���vendor/composer/semver/src/Semver.phpv��Y
- ÎVv��‹×È›¶������,���vendor/composer/semver/src/VersionParser.php<(��Y
- ÎV<(��ˆ‰Sx¶���������vendor/autoload.php‡���Y
- ÎV‡���ÎÅhp¶������'���vendor/composer/autoload_namespaces.phpd���Y
- ÎVd���Z¡¦H¶������!���vendor/composer/autoload_psr4.phpÐ��Y
- ÎVÐ��ÿ®Œ¶������%���vendor/composer/autoload_classmap.phpd���Y
- ÎVd���Z¡¦H¶������"���vendor/composer/autoload_files.phpÃ���Y
- ÎVÃ���ÒÂür¶������!���vendor/composer/autoload_real.php€��Y
- ÎV€��Àº,´¶���������vendor/composer/ClassLoader.phpB��Y
- ÎVB��é”í¶���������res/cacert.pemé�Y
- ÎVé�íŠÀ¶���������bin/composerl��Y
- ÎVl��Ԛà ¶���������LICENSE3��Y
- ÎV3��fýÞX¶������<?php
- namespace Composer\Autoload;
- use Composer\Config;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Installer\InstallationManager;
- use Composer\IO\IOInterface;
- use Composer\Package\AliasPackage;
- use Composer\Package\PackageInterface;
- use Composer\Repository\InstalledRepositoryInterface;
- use Composer\Util\Filesystem;
- use Composer\Script\ScriptEvents;
- class AutoloadGenerator
- {
- private $eventDispatcher;
- private $io;
- private $devMode = false;
- private $classMapAuthoritative = false;
- private $runScripts = false;
- public function __construct(EventDispatcher $eventDispatcher, IOInterface $io = null)
- {
- $this->eventDispatcher = $eventDispatcher;
- $this->io = $io;
- }
- public function setDevMode($devMode = true)
- {
- $this->devMode = (boolean) $devMode;
- }
- public function setClassMapAuthoritative($classMapAuthoritative)
- {
- $this->classMapAuthoritative = (boolean) $classMapAuthoritative;
- }
- public function setRunScripts($runScripts = true)
- {
- $this->runScripts = (boolean) $runScripts;
- }
- public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '')
- {
- if ($this->classMapAuthoritative) {
- $scanPsr0Packages = true;
- }
- if ($this->runScripts) {
- $this->eventDispatcher->dispatchScript(ScriptEvents::PRE_AUTOLOAD_DUMP, $this->devMode, array(), array(
- 'optimize' => (bool) $scanPsr0Packages,
- ));
- }
- $filesystem = new Filesystem();
- $filesystem->ensureDirectoryExists($config->get('vendor-dir'));
- $basePath = $filesystem->normalizePath(realpath(getcwd()));
- $vendorPath = $filesystem->normalizePath(realpath($config->get('vendor-dir')));
- $useGlobalIncludePath = (bool) $config->get('use-include-path');
- $prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true';
- $targetDir = $vendorPath.'/'.$targetDir;
- $filesystem->ensureDirectoryExists($targetDir);
- $vendorPathCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
- $vendorPathCode52 = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathCode);
- $vendorPathToTargetDirCode = $filesystem->findShortestPathCode($vendorPath, realpath($targetDir), true);
- $appBaseDirCode = $filesystem->findShortestPathCode($vendorPath, $basePath, true);
- $appBaseDirCode = str_replace('__DIR__', '$vendorDir', $appBaseDirCode);
- $namespacesFile = <<<EOF
- <?php
- // autoload_namespaces.php @generated by Composer
- \$vendorDir = $vendorPathCode52;
- \$baseDir = $appBaseDirCode;
- return array(
- EOF;
- $psr4File = <<<EOF
- <?php
- // autoload_psr4.php @generated by Composer
- \$vendorDir = $vendorPathCode52;
- \$baseDir = $appBaseDirCode;
- return array(
- EOF;
- $packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getCanonicalPackages());
- $autoloads = $this->parseAutoloads($packageMap, $mainPackage);
- foreach ($autoloads['psr-0'] as $namespace => $paths) {
- $exportedPaths = array();
- foreach ($paths as $path) {
- $exportedPaths[] = $this->getPathCode($filesystem, $basePath, $vendorPath, $path);
- }
- $exportedPrefix = var_export($namespace, true);
- $namespacesFile .= " $exportedPrefix => ";
- $namespacesFile .= "array(".implode(', ', $exportedPaths)."),\n";
- }
- $namespacesFile .= ");\n";
- foreach ($autoloads['psr-4'] as $namespace => $paths) {
- $exportedPaths = array();
- foreach ($paths as $path) {
- $exportedPaths[] = $this->getPathCode($filesystem, $basePath, $vendorPath, $path);
- }
- $exportedPrefix = var_export($namespace, true);
- $psr4File .= " $exportedPrefix => ";
- $psr4File .= "array(".implode(', ', $exportedPaths)."),\n";
- }
- $psr4File .= ");\n";
- $classmapFile = <<<EOF
- <?php
- // autoload_classmap.php @generated by Composer
- \$vendorDir = $vendorPathCode52;
- \$baseDir = $appBaseDirCode;
- return array(
- EOF;
- $targetDirLoader = null;
- $mainAutoload = $mainPackage->getAutoload();
- if ($mainPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {
- $levels = count(explode('/', $filesystem->normalizePath($mainPackage->getTargetDir())));
- $prefixes = implode(', ', array_map(function ($prefix) {
- return var_export($prefix, true);
- }, array_keys($mainAutoload['psr-0'])));
- $baseDirFromTargetDirCode = $filesystem->findShortestPathCode($targetDir, $basePath, true);
- $targetDirLoader = <<<EOF
- public static function autoload(\$class)
- {
- \$dir = $baseDirFromTargetDirCode . '/';
- \$prefixes = array($prefixes);
- foreach (\$prefixes as \$prefix) {
- if (0 !== strpos(\$class, \$prefix)) {
- continue;
- }
- \$path = \$dir . implode('/', array_slice(explode('\\\\', \$class), $levels)).'.php';
- if (!\$path = stream_resolve_include_path(\$path)) {
- return false;
- }
- require \$path;
- return true;
- }
- }
- EOF;
- }
- $blacklist = null;
- if (!empty($autoloads['exclude-from-classmap'])) {
- $blacklist = '{(' . implode('|', $autoloads['exclude-from-classmap']) . ')}';
- }
- $classMap = array();
- if ($scanPsr0Packages) {
- $namespacesToScan = array();
- foreach (array('psr-0', 'psr-4') as $psrType) {
- foreach ($autoloads[$psrType] as $namespace => $paths) {
- $namespacesToScan[$namespace][] = array('paths' => $paths, 'type' => $psrType);
- }
- }
- krsort($namespacesToScan);
- foreach ($namespacesToScan as $namespace => $groups) {
- foreach ($groups as $group) {
- $psrType = $group['type'];
- foreach ($group['paths'] as $dir) {
- $dir = $filesystem->normalizePath($filesystem->isAbsolutePath($dir) ? $dir : $basePath.'/'.$dir);
- if (!is_dir($dir)) {
- continue;
- }
- $namespaceFilter = $namespace === '' ? null : $namespace;
- $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, $namespaceFilter, $classMap);
- }
- }
- }
- }
- foreach ($autoloads['classmap'] as $dir) {
- $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, null, $classMap);
- }
- ksort($classMap);
- foreach ($classMap as $class => $code) {
- $classmapFile .= ' '.var_export($class, true).' => '.$code;
- }
- $classmapFile .= ");\n";
- if (!$suffix) {
- if (!$config->get('autoloader-suffix') && is_readable($vendorPath.'/autoload.php')) {
- $content = file_get_contents($vendorPath.'/autoload.php');
- if (preg_match('{ComposerAutoloaderInit([^:\s]+)::}', $content, $match)) {
- $suffix = $match[1];
- }
- }
- if (!$suffix) {
- $suffix = $config->get('autoloader-suffix') ?: md5(uniqid('', true));
- }
- }
- file_put_contents($targetDir.'/autoload_namespaces.php', $namespacesFile);
- file_put_contents($targetDir.'/autoload_psr4.php', $psr4File);
- file_put_contents($targetDir.'/autoload_classmap.php', $classmapFile);
- $includePathFilePath = $targetDir.'/include_paths.php';
- if ($includePathFileContents = $this->getIncludePathsFile($packageMap, $filesystem, $basePath, $vendorPath, $vendorPathCode52, $appBaseDirCode)) {
- file_put_contents($includePathFilePath, $includePathFileContents);
- } elseif (file_exists($includePathFilePath)) {
- unlink($includePathFilePath);
- }
- $includeFilesFilePath = $targetDir.'/autoload_files.php';
- if ($includeFilesFileContents = $this->getIncludeFilesFile($autoloads['files'], $filesystem, $basePath, $vendorPath, $vendorPathCode52, $appBaseDirCode)) {
- file_put_contents($includeFilesFilePath, $includeFilesFileContents);
- } elseif (file_exists($includeFilesFilePath)) {
- unlink($includeFilesFilePath);
- }
- file_put_contents($vendorPath.'/autoload.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
- file_put_contents($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader));
- $this->safeCopy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
- $this->safeCopy(__DIR__.'/../../../LICENSE', $targetDir.'/LICENSE');
- if ($this->runScripts) {
- $this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, $this->devMode, array(), array(
- 'optimize' => (bool) $scanPsr0Packages,
- ));
- }
- }
- private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist = null, $namespaceFilter = null, array $classMap = array())
- {
- foreach ($this->generateClassMap($dir, $blacklist, $namespaceFilter) as $class => $path) {
- $pathCode = $this->getPathCode($filesystem, $basePath, $vendorPath, $path).",\n";
- if (!isset($classMap[$class])) {
- $classMap[$class] = $pathCode;
- } elseif ($this->io && $classMap[$class] !== $pathCode && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($classMap[$class].' '.$path, '\\', '/'))) {
- $this->io->writeError(
- '<warning>Warning: Ambiguous class resolution, "'.$class.'"'.
- ' was found in both "'.str_replace(array('$vendorDir . \'', "',\n"), array($vendorPath, ''), $classMap[$class]).'" and "'.$path.'", the first will be used.</warning>'
- );
- }
- }
- return $classMap;
- }
- private function generateClassMap($dir, $blacklist = null, $namespaceFilter = null, $showAmbiguousWarning = true)
- {
- return ClassMapGenerator::createMap($dir, $blacklist, $showAmbiguousWarning ? $this->io : null, $namespaceFilter);
- }
- public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)
- {
- $packageMap = array(array($mainPackage, ''));
- foreach ($packages as $package) {
- if ($package instanceof AliasPackage) {
- continue;
- }
- $this->validatePackage($package);
- $packageMap[] = array(
- $package,
- $installationManager->getInstallPath($package),
- );
- }
- return $packageMap;
- }
- protected function validatePackage(PackageInterface $package)
- {
- $autoload = $package->getAutoload();
- if (!empty($autoload['psr-4']) && null !== $package->getTargetDir()) {
- $name = $package->getName();
- $package->getTargetDir();
- throw new \InvalidArgumentException("PSR-4 autoloading is incompatible with the target-dir property, remove the target-dir in package '$name'.");
- }
- if (!empty($autoload['psr-4'])) {
- foreach ($autoload['psr-4'] as $namespace => $dirs) {
- if ($namespace !== '' && '\\' !== substr($namespace, -1)) {
- throw new \InvalidArgumentException("psr-4 namespaces must end with a namespace separator, '$namespace' does not, use '$namespace\\'.");
- }
- }
- }
- }
- public function parseAutoloads(array $packageMap, PackageInterface $mainPackage)
- {
- $mainPackageMap = array_shift($packageMap);
- $sortedPackageMap = $this->sortPackageMap($packageMap);
- $sortedPackageMap[] = $mainPackageMap;
- array_unshift($packageMap, $mainPackageMap);
- $psr0 = $this->parseAutoloadsType($packageMap, 'psr-0', $mainPackage);
- $psr4 = $this->parseAutoloadsType($packageMap, 'psr-4', $mainPackage);
- $classmap = $this->parseAutoloadsType(array_reverse($sortedPackageMap), 'classmap', $mainPackage);
- $files = $this->parseAutoloadsType($sortedPackageMap, 'files', $mainPackage);
- $exclude = $this->parseAutoloadsType($sortedPackageMap, 'exclude-from-classmap', $mainPackage);
- krsort($psr0);
- krsort($psr4);
- return array(
- 'psr-0' => $psr0,
- 'psr-4' => $psr4,
- 'classmap' => $classmap,
- 'files' => $files,
- 'exclude-from-classmap' => $exclude,
- );
- }
- public function createLoader(array $autoloads)
- {
- $loader = new ClassLoader();
- if (isset($autoloads['psr-0'])) {
- foreach ($autoloads['psr-0'] as $namespace => $path) {
- $loader->add($namespace, $path);
- }
- }
- if (isset($autoloads['psr-4'])) {
- foreach ($autoloads['psr-4'] as $namespace => $path) {
- $loader->addPsr4($namespace, $path);
- }
- }
- if (isset($autoloads['classmap'])) {
- foreach ($autoloads['classmap'] as $dir) {
- try {
- $loader->addClassMap($this->generateClassMap($dir, null, null, false));
- } catch (\RuntimeException $e) {
- $this->io->writeError('<warning>'.$e->getMessage().'</warning>');
- }
- }
- }
- return $loader;
- }
- protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode)
- {
- $includePaths = array();
- foreach ($packageMap as $item) {
- list($package, $installPath) = $item;
- if (null !== $package->getTargetDir() && strlen($package->getTargetDir()) > 0) {
- $installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
- }
- foreach ($package->getIncludePaths() as $includePath) {
- $includePath = trim($includePath, '/');
- $includePaths[] = empty($installPath) ? $includePath : $installPath.'/'.$includePath;
- }
- }
- if (!$includePaths) {
- return;
- }
- $includePathsCode = '';
- foreach ($includePaths as $path) {
- $includePathsCode .= " " . $this->getPathCode($filesystem, $basePath, $vendorPath, $path) . ",\n";
- }
- return <<<EOF
- <?php
- // include_paths.php @generated by Composer
- \$vendorDir = $vendorPathCode;
- \$baseDir = $appBaseDirCode;
- return array(
- $includePathsCode);
- EOF;
- }
- protected function getIncludeFilesFile(array $files, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode)
- {
- $filesCode = '';
- foreach ($files as $fileIdentifier => $functionFile) {
- $filesCode .= ' ' . var_export($fileIdentifier, true) . ' => '
- . $this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile) . ",\n";
- }
- if (!$filesCode) {
- return false;
- }
- return <<<EOF
- <?php
- // autoload_files.php @generated by Composer
- \$vendorDir = $vendorPathCode;
- \$baseDir = $appBaseDirCode;
- return array(
- $filesCode);
- EOF;
- }
- protected function getPathCode(Filesystem $filesystem, $basePath, $vendorPath, $path)
- {
- if (!$filesystem->isAbsolutePath($path)) {
- $path = $basePath . '/' . $path;
- }
- $path = $filesystem->normalizePath($path);
- $baseDir = '';
- if (strpos($path.'/', $vendorPath.'/') === 0) {
- $path = substr($path, strlen($vendorPath));
- $baseDir = '$vendorDir';
- if ($path !== false) {
- $baseDir .= " . ";
- }
- } else {
- $path = $filesystem->normalizePath($filesystem->findShortestPath($basePath, $path, true));
- if (!$filesystem->isAbsolutePath($path)) {
- $baseDir = '$baseDir . ';
- $path = '/' . $path;
- }
- }
- if (preg_match('/\.phar$/', $path)) {
- $baseDir = "'phar://' . " . $baseDir;
- }
- return $baseDir . (($path !== false) ? var_export($path, true) : "");
- }
- protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix)
- {
- return <<<AUTOLOAD
- <?php
- // autoload.php @generated by Composer
- require_once $vendorPathToTargetDirCode . '/autoload_real.php';
- return ComposerAutoloaderInit$suffix::getLoader();
- AUTOLOAD;
- }
- protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $useIncludeFiles, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader)
- {
- $file = <<<HEADER
- <?php
- // autoload_real.php @generated by Composer
- class ComposerAutoloaderInit$suffix
- {
- private static \$loader;
- public static function loadClassLoader(\$class)
- {
- if ('Composer\\Autoload\\ClassLoader' === \$class) {
- require __DIR__ . '/ClassLoader.php';
- }
- }
- public static function getLoader()
- {
- if (null !== self::\$loader) {
- return self::\$loader;
- }
- spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'), true, $prependAutoloader);
- self::\$loader = \$loader = new \\Composer\\Autoload\\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'));
- HEADER;
- if ($useIncludePath) {
- $file .= <<<'INCLUDE_PATH'
- $includePaths = require __DIR__ . '/include_paths.php';
- array_push($includePaths, get_include_path());
- set_include_path(join(PATH_SEPARATOR, $includePaths));
- INCLUDE_PATH;
- }
- if (!$this->classMapAuthoritative) {
- $file .= <<<'PSR04'
- $map = require __DIR__ . '/autoload_namespaces.php';
- foreach ($map as $namespace => $path) {
- $loader->set($namespace, $path);
- }
- $map = require __DIR__ . '/autoload_psr4.php';
- foreach ($map as $namespace => $path) {
- $loader->setPsr4($namespace, $path);
- }
- PSR04;
- }
- if ($useClassMap) {
- $file .= <<<'CLASSMAP'
- $classMap = require __DIR__ . '/autoload_classmap.php';
- if ($classMap) {
- $loader->addClassMap($classMap);
- }
- CLASSMAP;
- }
- if ($this->classMapAuthoritative) {
- $file .= <<<'CLASSMAPAUTHORITATIVE'
- $loader->setClassMapAuthoritative(true);
- CLASSMAPAUTHORITATIVE;
- }
- if ($useGlobalIncludePath) {
- $file .= <<<'INCLUDEPATH'
- $loader->setUseIncludePath(true);
- INCLUDEPATH;
- }
- if ($targetDirLoader) {
- $file .= <<<REGISTER_TARGET_DIR_AUTOLOAD
- spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true, true);
- REGISTER_TARGET_DIR_AUTOLOAD;
- }
- $file .= <<<REGISTER_LOADER
- \$loader->register($prependAutoloader);
- REGISTER_LOADER;
- if ($useIncludeFiles) {
- $file .= <<<INCLUDE_FILES
- \$includeFiles = require __DIR__ . '/autoload_files.php';
- foreach (\$includeFiles as \$fileIdentifier => \$file) {
- composerRequire$suffix(\$fileIdentifier, \$file);
- }
- INCLUDE_FILES;
- }
- $file .= <<<METHOD_FOOTER
- return \$loader;
- }
- METHOD_FOOTER;
- $file .= $targetDirLoader;
- if ($useIncludeFiles) {
- return $file . <<<FOOTER
- }
- function composerRequire$suffix(\$fileIdentifier, \$file)
- {
- if (empty(\$GLOBALS['__composer_autoload_files'][\$fileIdentifier])) {
- require \$file;
- \$GLOBALS['__composer_autoload_files'][\$fileIdentifier] = true;
- }
- }
- FOOTER;
- }
- return $file . <<<FOOTER
- }
- FOOTER;
- }
- protected function parseAutoloadsType(array $packageMap, $type, PackageInterface $mainPackage)
- {
- $autoloads = array();
- foreach ($packageMap as $item) {
- list($package, $installPath) = $item;
- $autoload = $package->getAutoload();
- if ($this->devMode && $package === $mainPackage) {
- $autoload = array_merge_recursive($autoload, $package->getDevAutoload());
- }
- if (!isset($autoload[$type]) || !is_array($autoload[$type])) {
- continue;
- }
- if (null !== $package->getTargetDir() && $package !== $mainPackage) {
- $installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
- }
- foreach ($autoload[$type] as $namespace => $paths) {
- foreach ((array) $paths as $path) {
- if (($type === 'files' || $type === 'classmap' || $type === 'exclude-from-classmap') && $package->getTargetDir() && !is_readable($installPath.'/'.$path)) {
- if ($package === $mainPackage) {
- $targetDir = str_replace('\\<dirsep\\>', '[\\\\/]', preg_quote(str_replace(array('/', '\\'), '<dirsep>', $package->getTargetDir())));
- $path = ltrim(preg_replace('{^'.$targetDir.'}', '', ltrim($path, '\\/')), '\\/');
- } else {
- $path = $package->getTargetDir() . '/' . $path;
- }
- }
- if ($type === 'exclude-from-classmap') {
- $path = preg_quote(trim(strtr($path, '\\', '/'), '/'));
- $path = str_replace('\\*\\*', '.+?', $path);
- $path = str_replace('\\*', '[^/]+?', $path);
- $updir = null;
- $path = preg_replace_callback(
- '{^((?:(?:\\\\\\.){1,2}+/)+)}',
- function ($matches) use (&$updir) {
- if (isset($matches[1])) {
- $updir = str_replace('\\.', '.', $matches[1]);
- }
- return '';
- },
- $path
- );
- if (empty($installPath)) {
- $installPath = strtr(getcwd(), '\\', '/');
- }
- $resolvedPath = realpath($installPath . '/' . $updir);
- $autoloads[] = preg_quote(strtr($resolvedPath, '\\', '/')) . '/' . $path;
- continue;
- }
- $relativePath = empty($installPath) ? (empty($path) ? '.' : $path) : $installPath.'/'.$path;
- if ($type === 'files') {
- $autoloads[$this->getFileIdentifier($package, $path)] = $relativePath;
- continue;
- } elseif ($type === 'classmap') {
- $autoloads[] = $relativePath;
- continue;
- }
- $autoloads[$namespace][] = $relativePath;
- }
- }
- }
- return $autoloads;
- }
- protected function getFileIdentifier(PackageInterface $package, $path)
- {
- return md5($package->getName() . ':' . $path);
- }
- protected function sortPackageMap(array $packageMap)
- {
- $packages = array();
- $paths = array();
- $usageList = array();
- foreach ($packageMap as $item) {
- list($package, $path) = $item;
- $name = $package->getName();
- $packages[$name] = $package;
- $paths[$name] = $path;
- foreach (array_merge($package->getRequires(), $package->getDevRequires()) as $link) {
- $target = $link->getTarget();
- $usageList[$target][] = $name;
- }
- }
- $computing = array();
- $computed = array();
- $computeImportance = function ($name) use (&$computeImportance, &$computing, &$computed, $usageList) {
- if (isset($computed[$name])) {
- return $computed[$name];
- }
- if (isset($computing[$name])) {
- return 0;
- }
- $computing[$name] = true;
- $weight = 0;
- if (isset($usageList[$name])) {
- foreach ($usageList[$name] as $user) {
- $weight -= 1 - $computeImportance($user);
- }
- }
- unset($computing[$name]);
- $computed[$name] = $weight;
- return $weight;
- };
- $weightList = array();
- foreach ($packages as $name => $package) {
- $weight = $computeImportance($name);
- $weightList[$name] = $weight;
- }
- $stable_sort = function (&$array) {
- static $transform, $restore;
- $i = 0;
- if (!$transform) {
- $transform = function (&$v, $k) use (&$i) {
- $v = array($v, ++$i, $k, $v);
- };
- $restore = function (&$v, $k) {
- $v = $v[3];
- };
- }
- array_walk($array, $transform);
- asort($array);
- array_walk($array, $restore);
- };
- $stable_sort($weightList);
- $sortedPackageMap = array();
- foreach (array_keys($weightList) as $name) {
- $sortedPackageMap[] = array($packages[$name], $paths[$name]);
- }
- return $sortedPackageMap;
- }
- protected function safeCopy($source, $target)
- {
- $source = fopen($source, 'r');
- $target = fopen($target, 'w+');
- stream_copy_to_stream($source, $target);
- fclose($source);
- fclose($target);
- }
- }
- <?php
- namespace Composer\Autoload;
- use Composer\Util\Silencer;
- use Symfony\Component\Finder\Finder;
- use Composer\IO\IOInterface;
- class ClassMapGenerator
- {
- public static function dump($dirs, $file)
- {
- $maps = array();
- foreach ($dirs as $dir) {
- $maps = array_merge($maps, static::createMap($dir));
- }
- file_put_contents($file, sprintf('<?php return %s;', var_export($maps, true)));
- }
- public static function createMap($path, $blacklist = null, IOInterface $io = null, $namespace = null)
- {
- if (is_string($path)) {
- if (is_file($path)) {
- $path = array(new \SplFileInfo($path));
- } elseif (is_dir($path)) {
- $path = Finder::create()->files()->followLinks()->name('/\.(php|inc|hh)$/')->in($path);
- } else {
- throw new \RuntimeException(
- 'Could not scan for classes inside "'.$path.
- '" which does not appear to be a file nor a folder'
- );
- }
- }
- $map = array();
- foreach ($path as $file) {
- $filePath = $file->getRealPath();
- if (!in_array(pathinfo($filePath, PATHINFO_EXTENSION), array('php', 'inc', 'hh'))) {
- continue;
- }
- if ($blacklist && preg_match($blacklist, strtr($filePath, '\\', '/'))) {
- continue;
- }
- $classes = self::findClasses($filePath);
- foreach ($classes as $class) {
- if (null !== $namespace && 0 !== strpos($class, $namespace)) {
- continue;
- }
- if (!isset($map[$class])) {
- $map[$class] = $filePath;
- } elseif ($io && $map[$class] !== $filePath && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($map[$class].' '.$filePath, '\\', '/'))) {
- $io->writeError(
- '<warning>Warning: Ambiguous class resolution, "'.$class.'"'.
- ' was found in both "'.$map[$class].'" and "'.$filePath.'", the first will be used.</warning>'
- );
- }
- }
- }
- return $map;
- }
- private static function findClasses($path)
- {
- $extraTypes = PHP_VERSION_ID < 50400 ? '' : '|trait';
- if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>=')) {
- $extraTypes .= '|enum';
- }
-
- $contents = @php_strip_whitespace($path);
- if (!$contents) {
- if (!file_exists($path)) {
- $message = 'File at "%s" does not exist, check your classmap definitions';
- } elseif (!is_readable($path)) {
- $message = 'File at "%s" is not readable, check its permissions';
- } elseif ('' === trim(file_get_contents($path))) {
- return array();
- } else {
- $message = 'File at "%s" could not be parsed as PHP, it may be binary or corrupted';
- }
- $error = error_get_last();
- if (isset($error['message'])) {
- $message .= PHP_EOL . 'The following message may be helpful:' . PHP_EOL . $error['message'];
- }
- throw new \RuntimeException(sprintf($message, $path));
- }
- if (!preg_match('{\b(?:class|interface'.$extraTypes.')\s}i', $contents)) {
- return array();
- }
- $contents = preg_replace('{<<<\s*(\'?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)\\2(?=\r\n|\n|\r|;)}s', 'null', $contents);
- $contents = preg_replace('{"[^"\\\\]*+(\\\\.[^"\\\\]*+)*+"|\'[^\'\\\\]*+(\\\\.[^\'\\\\]*+)*+\'}s', 'null', $contents);
- if (substr($contents, 0, 2) !== '<?') {
- $contents = preg_replace('{^.+?<\?}s', '<?', $contents, 1, $replacements);
- if ($replacements === 0) {
- return array();
- }
- }
- $contents = preg_replace('{\?>.+<\?}s', '?><?', $contents);
- $pos = strrpos($contents, '?>');
- if (false !== $pos && false === strpos(substr($contents, $pos), '<?')) {
- $contents = substr($contents, 0, $pos);
- }
- preg_match_all('{
- (?:
- \b(?<![\$:>])(?P<type>class|interface'.$extraTypes.') \s++ (?P<name>[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+)
- | \b(?<![\$:>])(?P<ns>namespace) (?P<nsname>\s++[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\s*+\\\\\s*+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+)? \s*+ [\{;]
- )
- }ix', $contents, $matches);
- $classes = array();
- $namespace = '';
- for ($i = 0, $len = count($matches['type']); $i < $len; $i++) {
- if (!empty($matches['ns'][$i])) {
- $namespace = str_replace(array(' ', "\t", "\r", "\n"), '', $matches['nsname'][$i]) . '\\';
- } else {
- $name = $matches['name'][$i];
- if ($name[0] === ':') {
- $name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1);
- } elseif ($matches['type'][$i] === 'enum') {
-
-
-
- $name = rtrim($name, ':');
- }
- $classes[] = ltrim($namespace . $name, '\\');
- }
- }
- return $classes;
- }
- }
- <?php
- namespace Composer;
- use Composer\IO\IOInterface;
- use Composer\Util\Filesystem;
- use Composer\Util\Silencer;
- use Symfony\Component\Finder\Finder;
- class Cache
- {
- private static $cacheCollected = false;
- private $io;
- private $root;
- private $enabled = true;
- private $whitelist;
- private $filesystem;
- public function __construct(IOInterface $io, $cacheDir, $whitelist = 'a-z0-9.', Filesystem $filesystem = null)
- {
- $this->io = $io;
- $this->root = rtrim($cacheDir, '/\\') . '/';
- $this->whitelist = $whitelist;
- $this->filesystem = $filesystem ?: new Filesystem();
- if (
- (!is_dir($this->root) && !Silencer::call('mkdir', $this->root, 0777, true))
- || !is_writable($this->root)
- ) {
- $this->io->writeError('<warning>Cannot create cache directory ' . $this->root . ', or directory is not writable. Proceeding without cache</warning>');
- $this->enabled = false;
- }
- }
- public function isEnabled()
- {
- return $this->enabled;
- }
- public function getRoot()
- {
- return $this->root;
- }
- public function read($file)
- {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
- if ($this->enabled && file_exists($this->root . $file)) {
- $this->io->writeError('Reading '.$this->root . $file.' from cache', true, IOInterface::DEBUG);
- return file_get_contents($this->root . $file);
- }
- return false;
- }
- public function write($file, $contents)
- {
- if ($this->enabled) {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
- $this->io->writeError('Writing '.$this->root . $file.' into cache', true, IOInterface::DEBUG);
- try {
- return file_put_contents($this->root . $file, $contents);
- } catch (\ErrorException $e) {
- $this->io->writeError('<warning>Failed to write into cache: '.$e->getMessage().'</warning>', true, IOInterface::DEBUG);
- if (preg_match('{^file_put_contents\(\): Only ([0-9]+) of ([0-9]+) bytes written}', $e->getMessage(), $m)) {
- unlink($this->root . $file);
- $message = sprintf(
- '<warning>Writing %1$s into cache failed after %2$u of %3$u bytes written, only %4$u bytes of free space available</warning>',
- $this->root . $file,
- $m[1],
- $m[2],
- @disk_free_space($this->root . dirname($file))
- );
- $this->io->writeError($message);
- return false;
- }
- throw $e;
- }
- }
- return false;
- }
- public function copyFrom($file, $source)
- {
- if ($this->enabled) {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
- $this->filesystem->ensureDirectoryExists(dirname($this->root . $file));
- if (!file_exists($source)) {
- $this->io->writeError('<error>'.$source.' does not exist, can not write into cache</error>');
- } elseif ($this->io->isDebug()) {
- $this->io->writeError('Writing '.$this->root . $file.' into cache from '.$source);
- }
- return copy($source, $this->root . $file);
- }
- return false;
- }
- public function copyTo($file, $target)
- {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
- if ($this->enabled && file_exists($this->root . $file)) {
- try {
- touch($this->root . $file, filemtime($this->root . $file), time());
- } catch (\ErrorException $e) {
-
- Silencer::call('touch', $this->root . $file);
- }
- $this->io->writeError('Reading '.$this->root . $file.' from cache', true, IOInterface::DEBUG);
- return copy($this->root . $file, $target);
- }
- return false;
- }
- public function gcIsNecessary()
- {
- return (!self::$cacheCollected && !mt_rand(0, 50));
- }
- public function remove($file)
- {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
- if ($this->enabled && file_exists($this->root . $file)) {
- return $this->filesystem->unlink($this->root . $file);
- }
- return false;
- }
- public function gc($ttl, $maxSize)
- {
- if ($this->enabled) {
- $expire = new \DateTime();
- $expire->modify('-'.$ttl.' seconds');
- $finder = $this->getFinder()->date('until '.$expire->format('Y-m-d H:i:s'));
- foreach ($finder as $file) {
- $this->filesystem->unlink($file->getPathname());
- }
- $totalSize = $this->filesystem->size($this->root);
- if ($totalSize > $maxSize) {
- $iterator = $this->getFinder()->sortByAccessedTime()->getIterator();
- while ($totalSize > $maxSize && $iterator->valid()) {
- $filepath = $iterator->current()->getPathname();
- $totalSize -= $this->filesystem->size($filepath);
- $this->filesystem->unlink($filepath);
- $iterator->next();
- }
- }
- self::$cacheCollected = true;
- return true;
- }
- return false;
- }
- public function sha1($file)
- {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
- if ($this->enabled && file_exists($this->root . $file)) {
- return sha1_file($this->root . $file);
- }
- return false;
- }
- public function sha256($file)
- {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
- if ($this->enabled && file_exists($this->root . $file)) {
- return hash_file('sha256', $this->root . $file);
- }
- return false;
- }
- protected function getFinder()
- {
- return Finder::create()->in($this->root)->files();
- }
- }
- <?php
- namespace Composer\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class AboutCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('about')
- ->setDescription('Short information about Composer')
- ->setHelp(<<<EOT
- <info>php composer.phar about</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $this->getIO()->write(<<<EOT
- <info>Composer - Package Management for PHP</info>
- <comment>Composer is a dependency manager tracking local dependencies of your projects and libraries.
- See https://getcomposer.org/ for more information.</comment>
- EOT
- );
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Factory;
- use Composer\IO\IOInterface;
- use Composer\Config;
- use Composer\Repository\CompositeRepository;
- use Composer\Script\ScriptEvents;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Composer\Util\Filesystem;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- class ArchiveCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('archive')
- ->setDescription('Create an archive of this composer package')
- ->setDefinition(array(
- new InputArgument('package', InputArgument::OPTIONAL, 'The package to archive instead of the current project'),
- new InputArgument('version', InputArgument::OPTIONAL, 'A version constraint to find the package to archive'),
- new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the resulting archive: tar or zip'),
- new InputOption('dir', null, InputOption::VALUE_REQUIRED, 'Write the archive to this directory'),
- new InputOption('file', null, InputOption::VALUE_REQUIRED, 'Write the archive with the given file name.'
- .' Note that the format will be appended.'),
- ))
- ->setHelp(<<<EOT
- The <info>archive</info> command creates an archive of the specified format
- containing the files and directories of the Composer project or the specified
- package in the specified version and writes it to the specified directory.
- <info>php composer.phar archive [--format=zip] [--dir=/foo] [package [version]]</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $config = Factory::createConfig();
- $composer = $this->getComposer(false);
- if ($composer) {
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'archive', $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $composer->getEventDispatcher()->dispatchScript(ScriptEvents::PRE_ARCHIVE_CMD);
- }
- if (null === $input->getOption('format')) {
- $input->setOption('format', $config->get('archive-format'));
- }
- if (null === $input->getOption('dir')) {
- $input->setOption('dir', $config->get('archive-dir'));
- }
- $returnCode = $this->archive(
- $this->getIO(),
- $config,
- $input->getArgument('package'),
- $input->getArgument('version'),
- $input->getOption('format'),
- $input->getOption('dir'),
- $input->getOption('file')
- );
- if (0 === $returnCode && $composer) {
- $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_ARCHIVE_CMD);
- }
- return $returnCode;
- }
- protected function archive(IOInterface $io, Config $config, $packageName = null, $version = null, $format = 'tar', $dest = '.', $fileName = null)
- {
- $factory = new Factory;
- $downloadManager = $factory->createDownloadManager($io, $config);
- $archiveManager = $factory->createArchiveManager($config, $downloadManager);
- if ($packageName) {
- $package = $this->selectPackage($io, $packageName, $version);
- if (!$package) {
- return 1;
- }
- } else {
- $package = $this->getComposer()->getPackage();
- }
- $io->writeError('<info>Creating the archive into "'.$dest.'".</info>');
- $packagePath = $archiveManager->archive($package, $format, $dest, $fileName);
- $fs = new Filesystem;
- $shortPath = $fs->findShortestPath(getcwd(), $packagePath, true);
- $io->writeError('Created: ', false);
- $io->write(strlen($shortPath) < strlen($packagePath) ? $shortPath : $packagePath);
- return 0;
- }
- protected function selectPackage(IOInterface $io, $packageName, $version = null)
- {
- $io->writeError('<info>Searching for the specified package.</info>');
- if ($composer = $this->getComposer(false)) {
- $localRepo = $composer->getRepositoryManager()->getLocalRepository();
- $repo = new CompositeRepository(array_merge(array($localRepo), $composer->getRepositoryManager()->getRepositories()));
- } else {
- $defaultRepos = Factory::createDefaultRepositories($this->getIO());
- $io->writeError('No composer.json found in the current directory, searching packages from ' . implode(', ', array_keys($defaultRepos)));
- $repo = new CompositeRepository($defaultRepos);
- }
- $packages = $repo->findPackages($packageName, $version);
- if (count($packages) > 1) {
- $package = reset($packages);
- $io->writeError('<info>Found multiple matches, selected '.$package->getPrettyString().'.</info>');
- $io->writeError('Alternatives were '.implode(', ', array_map(function ($p) { return $p->getPrettyString(); }, $packages)).'.');
- $io->writeError('<comment>Please use a more specific constraint to pick a different package.</comment>');
- } elseif ($packages) {
- $package = reset($packages);
- $io->writeError('<info>Found an exact match '.$package->getPrettyString().'.</info>');
- } else {
- $io->writeError('<error>Could not find a package matching '.$packageName.'.</error>');
- return false;
- }
- return $package;
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Composer;
- use Composer\Console\Application;
- use Composer\IO\IOInterface;
- use Composer\IO\NullIO;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Command\Command;
- abstract class BaseCommand extends Command
- {
- private $composer;
- private $io;
- public function getComposer($required = true, $disablePlugins = false)
- {
- if (null === $this->composer) {
- $application = $this->getApplication();
- if ($application instanceof Application) {
- $this->composer = $application->getComposer($required, $disablePlugins);
- } elseif ($required) {
- throw new \RuntimeException(
- 'Could not create a Composer\Composer instance, you must inject '.
- 'one if this command is not used with a Composer\Console\Application instance'
- );
- }
- }
- return $this->composer;
- }
- public function setComposer(Composer $composer)
- {
- $this->composer = $composer;
- }
- public function resetComposer()
- {
- $this->composer = null;
- $this->getApplication()->resetComposer();
- }
- public function getIO()
- {
- if (null === $this->io) {
- $application = $this->getApplication();
- if ($application instanceof Application) {
- $this->io = $application->getIO();
- } else {
- $this->io = new NullIO();
- }
- }
- return $this->io;
- }
- public function setIO(IOInterface $io)
- {
- $this->io = $io;
- }
- protected function initialize(InputInterface $input, OutputInterface $output)
- {
- if (true === $input->hasParameterOption(array('--no-ansi')) && $input->hasOption('no-progress')) {
- $input->setOption('no-progress', true);
- }
- parent::initialize($input, $output);
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\DependencyResolver\Pool;
- use Composer\Package\Link;
- use Composer\Package\PackageInterface;
- use Composer\Repository\ArrayRepository;
- use Composer\Repository\CompositeRepository;
- use Composer\Repository\PlatformRepository;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Composer\Package\Version\VersionParser;
- use Symfony\Component\Console\Helper\Table;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- class BaseDependencyCommand extends BaseCommand
- {
- const ARGUMENT_PACKAGE = 'package';
- const ARGUMENT_CONSTRAINT = 'constraint';
- const OPTION_RECURSIVE = 'recursive';
- const OPTION_TREE = 'tree';
- protected function configure()
- {
- $this->setDefinition(array(
- new InputArgument(self::ARGUMENT_PACKAGE, InputArgument::REQUIRED, 'Package to inspect'),
- new InputArgument(self::ARGUMENT_CONSTRAINT, InputArgument::OPTIONAL, 'Optional version constraint', '*'),
- new InputOption(self::OPTION_RECURSIVE, 'r', InputOption::VALUE_NONE, 'Recursively resolves up to the root package'),
- new InputOption(self::OPTION_TREE, 't', InputOption::VALUE_NONE, 'Prints the results as a nested tree'),
- ));
- }
- protected function doExecute(InputInterface $input, OutputInterface $output, $inverted = false)
- {
- $composer = $this->getComposer();
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, $this->getName(), $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $platformOverrides = $composer->getConfig()->get('platform') ?: array();
- $repository = new CompositeRepository(array(
- new ArrayRepository(array($composer->getPackage())),
- $composer->getRepositoryManager()->getLocalRepository(),
- new PlatformRepository(array(), $platformOverrides),
- ));
- $pool = new Pool();
- $pool->addRepository($repository);
- list($needle, $textConstraint) = array_pad(
- explode(':', $input->getArgument(self::ARGUMENT_PACKAGE)),
- 2,
- $input->getArgument(self::ARGUMENT_CONSTRAINT)
- );
- $packages = $pool->whatProvides($needle);
- if (empty($packages)) {
- throw new \InvalidArgumentException(sprintf('Could not find package "%s" in your project', $needle));
- }
- $needles = array($needle);
- if ($inverted) {
- foreach ($packages as $package) {
- $needles = array_merge($needles, array_map(function (Link $link) {
- return $link->getTarget();
- }, $package->getReplaces()));
- }
- }
- if ('*' !== $textConstraint) {
- $versionParser = new VersionParser();
- $constraint = $versionParser->parseConstraints($textConstraint);
- } else {
- $constraint = null;
- }
- $renderTree = $input->getOption(self::OPTION_TREE);
- $recursive = $renderTree || $input->getOption(self::OPTION_RECURSIVE);
- $results = $repository->getDependents($needles, $constraint, $inverted, $recursive);
- if (empty($results)) {
- $extra = (null !== $constraint) ? sprintf(' in versions %smatching %s', $inverted ? 'not ' : '', $textConstraint) : '';
- $this->getIO()->writeError(sprintf('<info>There is no installed package depending on "%s"%s</info>',
- $needle, $extra));
- } elseif ($renderTree) {
- $root = $packages[0];
- $this->getIO()->write(sprintf('<info>%s</info> %s %s', $root->getPrettyName(), $root->getPrettyVersion(), $root->getDescription()));
- $this->printTree($results);
- } else {
- $this->printTable($output, $results);
- }
- return 0;
- }
- protected function printTable(OutputInterface $output, $results)
- {
- $table = array();
- $doubles = array();
- do {
- $queue = array();
- $rows = array();
- foreach($results as $result) {
- list($package, $link, $children) = $result;
- $unique = (string)$link;
- if (isset($doubles[$unique])) {
- continue;
- }
- $doubles[$unique] = true;
- $version = (strpos($package->getPrettyVersion(), 'No version set') === 0) ? '-' : $package->getPrettyVersion();
- $rows[] = array($package->getPrettyName(), $version, $link->getDescription(), sprintf('%s (%s)', $link->getTarget(), $link->getPrettyConstraint()));
- $queue = array_merge($queue, $children);
- }
- $results = $queue;
- $table = array_merge($rows, $table);
- } while(!empty($results));
- $renderer = new Table($output);
- $renderer->setStyle('compact');
- $renderer->getStyle()->setVerticalBorderChar('');
- $renderer->getStyle()->setCellRowContentFormat('%s ');
- $renderer->setRows($table)->render();
- }
- protected function printTree($results, $prefix = '')
- {
- $count = count($results);
- $idx = 0;
- foreach($results as $key => $result) {
- list($package, $link, $children) = $result;
- $isLast = (++$idx == $count);
- $versionText = (strpos($package->getPrettyVersion(), 'No version set') === 0) ? '' : $package->getPrettyVersion();
- $packageText = rtrim(sprintf('%s %s', $package->getPrettyName(), $versionText));
- $linkText = implode(' ', array($link->getDescription(), $link->getTarget(), $link->getPrettyConstraint()));
- $this->writeTreeLine(sprintf("%s%s%s (%s)", $prefix, $isLast ? '└──' : '├──', $packageText, $linkText));
- $this->printTree($children, $prefix . ($isLast ? ' ' : '│ '));
- }
- }
- private function writeTreeLine($line)
- {
- $io = $this->getIO();
- if (!$io->isDecorated()) {
- $line = str_replace(array('└', '├', '──', '│'), array('`-', '|-', '-', '|'), $line);
- }
- $io->write($line);
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Cache;
- use Composer\Factory;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class ClearCacheCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('clear-cache')
- ->setAliases(array('clearcache'))
- ->setDescription('Clears composer\'s internal package cache.')
- ->setHelp(<<<EOT
- The <info>clear-cache</info> deletes all cached packages from composer's
- cache directory.
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $config = Factory::createConfig();
- $io = $this->getIO();
- $cachePaths = array(
- 'cache-dir' => $config->get('cache-dir'),
- 'cache-files-dir' => $config->get('cache-files-dir'),
- 'cache-repo-dir' => $config->get('cache-repo-dir'),
- 'cache-vcs-dir' => $config->get('cache-vcs-dir'),
- );
- foreach ($cachePaths as $key => $cachePath) {
- $cachePath = realpath($cachePath);
- if (!$cachePath) {
- $io->writeError("<info>Cache directory does not exist ($key): $cachePath</info>");
- continue;
- }
- $cache = new Cache($io, $cachePath);
- if (!$cache->isEnabled()) {
- $io->writeError("<info>Cache is not enabled ($key): $cachePath</info>");
- continue;
- }
- $io->writeError("<info>Clearing cache ($key): $cachePath</info>");
- $cache->gc(0, 0);
- }
- $io->writeError('<info>All caches cleared.</info>');
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Util\Platform;
- use Composer\Util\Silencer;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- use Composer\Config;
- use Composer\Config\JsonConfigSource;
- use Composer\Factory;
- use Composer\Json\JsonFile;
- class ConfigCommand extends BaseCommand
- {
- protected $config;
- protected $configFile;
- protected $configSource;
- protected $authConfigFile;
- protected $authConfigSource;
- protected function configure()
- {
- $this
- ->setName('config')
- ->setDescription('Set config options')
- ->setDefinition(array(
- new InputOption('global', 'g', InputOption::VALUE_NONE, 'Apply command to the global config file'),
- new InputOption('editor', 'e', InputOption::VALUE_NONE, 'Open editor'),
- new InputOption('auth', 'a', InputOption::VALUE_NONE, 'Affect auth config file (only used for --editor)'),
- new InputOption('unset', null, InputOption::VALUE_NONE, 'Unset the given setting-key'),
- new InputOption('list', 'l', InputOption::VALUE_NONE, 'List configuration settings'),
- new InputOption('file', 'f', InputOption::VALUE_REQUIRED, 'If you want to choose a different composer.json or config.json'),
- new InputOption('absolute', null, InputOption::VALUE_NONE, 'Returns absolute paths when fetching *-dir config values instead of relative'),
- new InputArgument('setting-key', null, 'Setting key'),
- new InputArgument('setting-value', InputArgument::IS_ARRAY, 'Setting value'),
- ))
- ->setHelp(<<<EOT
- This command allows you to edit some basic composer settings in either the
- local composer.json file or the global config.json file.
- To set a config setting:
- <comment>%command.full_name% bin-dir bin/</comment>
- To read a config setting:
- <comment>%command.full_name% bin-dir</comment>
- Outputs: <info>bin</info>
- To edit the global config.json file:
- <comment>%command.full_name% --global</comment>
- To add a repository:
- <comment>%command.full_name% repositories.foo vcs https://bar.com</comment>
- To remove a repository (repo is a short alias for repositories):
- <comment>%command.full_name% --unset repo.foo</comment>
- To disable packagist:
- <comment>%command.full_name% repo.packagist false</comment>
- You can alter repositories in the global config.json file by passing in the
- <info>--global</info> option.
- To edit the file in an external editor:
- <comment>%command.full_name% --editor</comment>
- To choose your editor you can set the "EDITOR" env variable.
- To get a list of configuration values in the file:
- <comment>%command.full_name% --list</comment>
- You can always pass more than one option. As an example, if you want to edit the
- global config.json file.
- <comment>%command.full_name% --editor --global</comment>
- EOT
- )
- ;
- }
- protected function initialize(InputInterface $input, OutputInterface $output)
- {
- parent::initialize($input, $output);
- if ($input->getOption('global') && null !== $input->getOption('file')) {
- throw new \RuntimeException('--file and --global can not be combined');
- }
- $io = $this->getIO();
- $this->config = Factory::createConfig($io);
-
- $configFile = $input->getOption('global')
- ? ($this->config->get('home') . '/config.json')
- : ($input->getOption('file') ?: trim(getenv('COMPOSER')) ?: 'composer.json');
- if ($configFile === 'composer.json' && !file_exists($configFile) && realpath(getcwd()) === realpath($this->config->get('home'))) {
- file_put_contents($configFile, "{\n}\n");
- }
- $this->configFile = new JsonFile($configFile, null, $io);
- $this->configSource = new JsonConfigSource($this->configFile);
- $authConfigFile = $input->getOption('global')
- ? ($this->config->get('home') . '/auth.json')
- : dirname(realpath($configFile)) . '/auth.json';
- $this->authConfigFile = new JsonFile($authConfigFile, null, $io);
- $this->authConfigSource = new JsonConfigSource($this->authConfigFile, true);
- if ($input->getOption('global') && !$this->configFile->exists()) {
- touch($this->configFile->getPath());
- $this->configFile->write(array('config' => new \ArrayObject));
- Silencer::call('chmod', $this->configFile->getPath(), 0600);
- }
- if ($input->getOption('global') && !$this->authConfigFile->exists()) {
- touch($this->authConfigFile->getPath());
- $this->authConfigFile->write(array('http-basic' => new \ArrayObject, 'github-oauth' => new \ArrayObject, 'gitlab-oauth' => new \ArrayObject));
- Silencer::call('chmod', $this->authConfigFile->getPath(), 0600);
- }
- if (!$this->configFile->exists()) {
- throw new \RuntimeException(sprintf('File "%s" cannot be found in the current directory', $configFile));
- }
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- if ($input->getOption('editor')) {
- $editor = escapeshellcmd(getenv('EDITOR'));
- if (!$editor) {
- if (Platform::isWindows()) {
- $editor = 'notepad';
- } else {
- foreach (array('editor', 'vim', 'vi', 'nano', 'pico', 'ed') as $candidate) {
- if (exec('which '.$candidate)) {
- $editor = $candidate;
- break;
- }
- }
- }
- }
- $file = $input->getOption('auth') ? $this->authConfigFile->getPath() : $this->configFile->getPath();
- system($editor . ' ' . $file . (Platform::isWindows() ? '' : ' > `tty`'));
- return 0;
- }
- if (!$input->getOption('global')) {
- $this->config->merge($this->configFile->read());
- $this->config->merge(array('config' => $this->authConfigFile->exists() ? $this->authConfigFile->read() : array()));
- }
- if ($input->getOption('list')) {
- $this->listConfiguration($this->config->all(), $this->config->raw(), $output);
- return 0;
- }
- $settingKey = $input->getArgument('setting-key');
- if (!$settingKey) {
- return 0;
- }
- if (array() !== $input->getArgument('setting-value') && $input->getOption('unset')) {
- throw new \RuntimeException('You can not combine a setting value with --unset');
- }
- if (array() === $input->getArgument('setting-value') && !$input->getOption('unset')) {
- $data = $this->config->all();
- if (preg_match('/^repos?(?:itories)?(?:\.(.+))?/', $settingKey, $matches)) {
- if (empty($matches[1])) {
- $value = isset($data['repositories']) ? $data['repositories'] : array();
- } else {
- if (!isset($data['repositories'][$matches[1]])) {
- throw new \InvalidArgumentException('There is no '.$matches[1].' repository defined');
- }
- $value = $data['repositories'][$matches[1]];
- }
- } elseif (strpos($settingKey, '.')) {
- $bits = explode('.', $settingKey);
- $data = $data['config'];
- $match = false;
- foreach ($bits as $bit) {
- $key = isset($key) ? $key.'.'.$bit : $bit;
- $match = false;
- if (isset($data[$key])) {
- $match = true;
- $data = $data[$key];
- unset($key);
- }
- }
- if (!$match) {
- throw new \RuntimeException($settingKey.' is not defined.');
- }
- $value = $data;
- } elseif (isset($data['config'][$settingKey])) {
- $value = $this->config->get($settingKey, $input->getOption('absolute') ? 0 : Config::RELATIVE_PATHS);
- } else {
- throw new \RuntimeException($settingKey.' is not defined');
- }
- if (is_array($value)) {
- $value = json_encode($value);
- }
- $this->getIO()->write($value);
- return 0;
- }
- $values = $input->getArgument('setting-value');
- $booleanValidator = function ($val) { return in_array($val, array('true', 'false', '1', '0'), true); };
- $booleanNormalizer = function ($val) { return $val !== 'false' && (bool) $val; };
- $uniqueConfigValues = array(
- 'process-timeout' => array('is_numeric', 'intval'),
- 'use-include-path' => array($booleanValidator, $booleanNormalizer),
- 'preferred-install' => array(
- function ($val) { return in_array($val, array('auto', 'source', 'dist'), true); },
- function ($val) { return $val; },
- ),
- 'store-auths' => array(
- function ($val) { return in_array($val, array('true', 'false', 'prompt'), true); },
- function ($val) {
- if ('prompt' === $val) {
- return 'prompt';
- }
- return $val !== 'false' && (bool) $val;
- },
- ),
- 'notify-on-install' => array($booleanValidator, $booleanNormalizer),
- 'vendor-dir' => array('is_string', function ($val) { return $val; }),
- 'bin-dir' => array('is_string', function ($val) { return $val; }),
- 'archive-dir' => array('is_string', function ($val) { return $val; }),
- 'archive-format' => array('is_string', function ($val) { return $val; }),
- 'data-dir' => array('is_string', function ($val) { return $val; }),
- 'cache-dir' => array('is_string', function ($val) { return $val; }),
- 'cache-files-dir' => array('is_string', function ($val) { return $val; }),
- 'cache-repo-dir' => array('is_string', function ($val) { return $val; }),
- 'cache-vcs-dir' => array('is_string', function ($val) { return $val; }),
- 'cache-ttl' => array('is_numeric', 'intval'),
- 'cache-files-ttl' => array('is_numeric', 'intval'),
- 'cache-files-maxsize' => array(
- function ($val) { return preg_match('/^\s*([0-9.]+)\s*(?:([kmg])(?:i?b)?)?\s*$/i', $val) > 0; },
- function ($val) { return $val; },
- ),
- 'bin-compat' => array(
- function ($val) { return in_array($val, array('auto', 'full')); },
- function ($val) { return $val; },
- ),
- 'discard-changes' => array(
- function ($val) { return in_array($val, array('stash', 'true', 'false', '1', '0'), true); },
- function ($val) {
- if ('stash' === $val) {
- return 'stash';
- }
- return $val !== 'false' && (bool) $val;
- },
- ),
- 'autoloader-suffix' => array('is_string', function ($val) { return $val === 'null' ? null : $val; }),
- 'sort-packages' => array($booleanValidator, $booleanNormalizer),
- 'optimize-autoloader' => array($booleanValidator, $booleanNormalizer),
- 'classmap-authoritative' => array($booleanValidator, $booleanNormalizer),
- 'prepend-autoloader' => array($booleanValidator, $booleanNormalizer),
- 'disable-tls' => array($booleanValidator, $booleanNormalizer),
- 'cafile' => array(
- function ($val) { return file_exists($val) && is_readable($val); },
- function ($val) { return $val === 'null' ? null : $val; },
- ),
- 'capath' => array(
- function ($val) { return is_dir($val) && is_readable($val); },
- function ($val) { return $val === 'null' ? null : $val; },
- ),
- 'github-expose-hostname' => array($booleanValidator, $booleanNormalizer),
- );
- $multiConfigValues = array(
- 'github-protocols' => array(
- function ($vals) {
- if (!is_array($vals)) {
- return 'array expected';
- }
- foreach ($vals as $val) {
- if (!in_array($val, array('git', 'https', 'ssh'))) {
- return 'valid protocols include: git, https, ssh';
- }
- }
- return true;
- },
- function ($vals) {
- return $vals;
- },
- ),
- 'github-domains' => array(
- function ($vals) {
- if (!is_array($vals)) {
- return 'array expected';
- }
- return true;
- },
- function ($vals) {
- return $vals;
- },
- ),
- 'gitlab-domains' => array(
- function ($vals) {
- if (!is_array($vals)) {
- return 'array expected';
- }
- return true;
- },
- function ($vals) {
- return $vals;
- },
- ),
- );
- foreach ($uniqueConfigValues as $name => $callbacks) {
- if ($settingKey === $name) {
- if ($input->getOption('unset')) {
- return $this->configSource->removeConfigSetting($settingKey);
- }
- list($validator, $normalizer) = $callbacks;
- if (1 !== count($values)) {
- throw new \RuntimeException('You can only pass one value. Example: php composer.phar config process-timeout 300');
- }
- if (true !== $validation = $validator($values[0])) {
- throw new \RuntimeException(sprintf(
- '"%s" is an invalid value'.($validation ? ' ('.$validation.')' : ''),
- $values[0]
- ));
- }
- return $this->configSource->addConfigSetting($settingKey, $normalizer($values[0]));
- }
- }
- foreach ($multiConfigValues as $name => $callbacks) {
- if ($settingKey === $name) {
- if ($input->getOption('unset')) {
- return $this->configSource->removeConfigSetting($settingKey);
- }
- list($validator, $normalizer) = $callbacks;
- if (true !== $validation = $validator($values)) {
- throw new \RuntimeException(sprintf(
- '%s is an invalid value'.($validation ? ' ('.$validation.')' : ''),
- json_encode($values)
- ));
- }
- return $this->configSource->addConfigSetting($settingKey, $normalizer($values));
- }
- }
- if (preg_match('/^repos?(?:itories)?\.(.+)/', $settingKey, $matches)) {
- if ($input->getOption('unset')) {
- return $this->configSource->removeRepository($matches[1]);
- }
- if (2 === count($values)) {
- return $this->configSource->addRepository($matches[1], array(
- 'type' => $values[0],
- 'url' => $values[1],
- ));
- }
- if (1 === count($values)) {
- $value = strtolower($values[0]);
- if (true === $booleanValidator($value)) {
- if (false === $booleanNormalizer($value)) {
- return $this->configSource->addRepository($matches[1], false);
- }
- } else {
- $value = json_decode($values[0], true);
- if (JSON_ERROR_NONE !== json_last_error()) {
- throw new \InvalidArgumentException(sprintf('%s is not valid JSON.', $values[0]));
- }
- return $this->configSource->addRepository($matches[1], $value);
- }
- }
- throw new \RuntimeException('You must pass the type and a url. Example: php composer.phar config repositories.foo vcs https://bar.com');
- }
- if (preg_match('/^platform\.(.+)/', $settingKey, $matches)) {
- if ($input->getOption('unset')) {
- return $this->configSource->removeConfigSetting($settingKey);
- }
- return $this->configSource->addConfigSetting($settingKey, $values[0]);
- }
- if (preg_match('/^(github-oauth|gitlab-oauth|http-basic)\.(.+)/', $settingKey, $matches)) {
- if ($input->getOption('unset')) {
- $this->authConfigSource->removeConfigSetting($matches[1].'.'.$matches[2]);
- $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
- return;
- }
- if ($matches[1] === 'github-oauth' || $matches[1] === 'gitlab-oauth') {
- if (1 !== count($values)) {
- throw new \RuntimeException('Too many arguments, expected only one token');
- }
- $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
- $this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], $values[0]);
- } elseif ($matches[1] === 'http-basic') {
- if (2 !== count($values)) {
- throw new \RuntimeException('Expected two arguments (username, password), got '.count($values));
- }
- $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
- $this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('username' => $values[0], 'password' => $values[1]));
- }
- return;
- }
- throw new \InvalidArgumentException('Setting '.$settingKey.' does not exist or is not supported by this command');
- }
- protected function listConfiguration(array $contents, array $rawContents, OutputInterface $output, $k = null)
- {
- $origK = $k;
- $io = $this->getIO();
- foreach ($contents as $key => $value) {
- if ($k === null && !in_array($key, array('config', 'repositories'))) {
- continue;
- }
- $rawVal = isset($rawContents[$key]) ? $rawContents[$key] : null;
- if (is_array($value) && (!is_numeric(key($value)) || ($key === 'repositories' && null === $k))) {
- $k .= preg_replace('{^config\.}', '', $key . '.');
- $this->listConfiguration($value, $rawVal, $output, $k);
- $k = $origK;
- continue;
- }
- if (is_array($value)) {
- $value = array_map(function ($val) {
- return is_array($val) ? json_encode($val) : $val;
- }, $value);
- $value = '['.implode(', ', $value).']';
- }
- if (is_bool($value)) {
- $value = var_export($value, true);
- }
- if (is_string($rawVal) && $rawVal != $value) {
- $io->write('[<comment>' . $k . $key . '</comment>] <info>' . $rawVal . ' (' . $value . ')</info>');
- } else {
- $io->write('[<comment>' . $k . $key . '</comment>] <info>' . $value . '</info>');
- }
- }
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Config;
- use Composer\Factory;
- use Composer\Installer;
- use Composer\Installer\ProjectInstaller;
- use Composer\Installer\InstallationManager;
- use Composer\IO\IOInterface;
- use Composer\Package\BasePackage;
- use Composer\DependencyResolver\Pool;
- use Composer\DependencyResolver\Operation\InstallOperation;
- use Composer\Package\Version\VersionSelector;
- use Composer\Repository\ComposerRepository;
- use Composer\Repository\CompositeRepository;
- use Composer\Repository\FilesystemRepository;
- use Composer\Repository\InstalledFilesystemRepository;
- use Composer\Script\ScriptEvents;
- use Composer\Util\Silencer;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Finder\Finder;
- use Composer\Json\JsonFile;
- use Composer\Config\JsonConfigSource;
- use Composer\Util\Filesystem;
- use Composer\Package\Version\VersionParser;
- class CreateProjectCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('create-project')
- ->setDescription('Create new project from a package into given directory.')
- ->setDefinition(array(
- new InputArgument('package', InputArgument::OPTIONAL, 'Package name to be installed'),
- new InputArgument('directory', InputArgument::OPTIONAL, 'Directory where the files should be created'),
- new InputArgument('version', InputArgument::OPTIONAL, 'Version, will default to latest'),
- new InputOption('stability', 's', InputOption::VALUE_REQUIRED, 'Minimum-stability allowed (unless a version is specified).'),
- new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
- new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'),
- new InputOption('repository-url', null, InputOption::VALUE_REQUIRED, 'Pick a different repository url to look for the package.'),
- new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables installation of require-dev packages (enabled by default, only present for BC).'),
- new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'),
- new InputOption('no-plugins', null, InputOption::VALUE_NONE, 'Whether to disable plugins.'),
- new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'DEPRECATED: Use no-plugins instead.'),
- new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Whether to prevent execution of all defined scripts in the root package.'),
- new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
- new InputOption('keep-vcs', null, InputOption::VALUE_NONE, 'Whether to prevent deletion vcs folder.'),
- new InputOption('no-install', null, InputOption::VALUE_NONE, 'Whether to skip installation of the package dependencies.'),
- new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'),
- ))
- ->setHelp(<<<EOT
- The <info>create-project</info> command creates a new project from a given
- package into a new directory. If executed without params and in a directory
- with a composer.json file it installs the packages for the current project.
- You can use this command to bootstrap new projects or setup a clean
- version-controlled installation for developers of your project.
- <info>php composer.phar create-project vendor/project target-directory [version]</info>
- You can also specify the version with the package name using = or : as separator.
- <info>php composer.phar create-project vendor/project:version target-directory</info>
- To install unstable packages, either specify the version you want, or use the
- --stability=dev (where dev can be one of RC, beta, alpha or dev).
- To setup a developer workable version you should create the project using the source
- controlled code by appending the <info>'--prefer-source'</info> flag.
- To install a package from another repository than the default one you
- can pass the <info>'--repository-url=https://myrepository.org'</info> flag.
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $config = Factory::createConfig();
- $io = $this->getIO();
- $this->updatePreferredOptions($config, $input, $preferSource, $preferDist, true);
- if ($input->getOption('dev')) {
- $io->writeError('<warning>You are using the deprecated option "dev". Dev packages are installed by default now.</warning>');
- }
- if ($input->getOption('no-custom-installers')) {
- $io->writeError('<warning>You are using the deprecated option "no-custom-installers". Use "no-plugins" instead.</warning>');
- $input->setOption('no-plugins', true);
- }
- return $this->installProject(
- $io,
- $config,
- $input,
- $input->getArgument('package'),
- $input->getArgument('directory'),
- $input->getArgument('version'),
- $input->getOption('stability'),
- $preferSource,
- $preferDist,
- !$input->getOption('no-dev'),
- $input->getOption('repository-url'),
- $input->getOption('no-plugins'),
- $input->getOption('no-scripts'),
- $input->getOption('keep-vcs'),
- $input->getOption('no-progress'),
- $input->getOption('no-install'),
- $input->getOption('ignore-platform-reqs')
- );
- }
- public function installProject(IOInterface $io, Config $config, InputInterface $input, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repositoryUrl = null, $disablePlugins = false, $noScripts = false, $keepVcs = false, $noProgress = false, $noInstall = false, $ignorePlatformReqs = false)
- {
- $oldCwd = getcwd();
- $io->loadConfiguration($config);
- if ($packageName !== null) {
- $installedFromVcs = $this->installRootPackage($io, $config, $packageName, $directory, $packageVersion, $stability, $preferSource, $preferDist, $installDevPackages, $repositoryUrl, $disablePlugins, $noScripts, $keepVcs, $noProgress);
- } else {
- $installedFromVcs = false;
- }
- $composer = Factory::create($io, null, $disablePlugins);
- $composer->getDownloadManager()->setOutputProgress(!$noProgress);
- $fs = new Filesystem();
- if ($noScripts === false) {
- $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_ROOT_PACKAGE_INSTALL, $installDevPackages);
- }
- $rootPackageConfig = $composer->getConfig();
- $this->updatePreferredOptions($rootPackageConfig, $input, $preferSource, $preferDist);
- if ($noInstall === false) {
- $installer = Installer::create($io, $composer);
- $installer->setPreferSource($preferSource)
- ->setPreferDist($preferDist)
- ->setDevMode($installDevPackages)
- ->setRunScripts(!$noScripts)
- ->setIgnorePlatformRequirements($ignorePlatformReqs);
- if ($disablePlugins) {
- $installer->disablePlugins();
- }
- $status = $installer->run();
- if (0 !== $status) {
- return $status;
- }
- }
- $hasVcs = $installedFromVcs;
- if (!$keepVcs && $installedFromVcs
- && (
- !$io->isInteractive()
- || $io->askConfirmation('<info>Do you want to remove the existing VCS (.git, .svn..) history?</info> [<comment>Y,n</comment>]? ', true)
- )
- ) {
- $finder = new Finder();
- $finder->depth(0)->directories()->in(getcwd())->ignoreVCS(false)->ignoreDotFiles(false);
- foreach (array('.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg') as $vcsName) {
- $finder->name($vcsName);
- }
- try {
- $dirs = iterator_to_array($finder);
- unset($finder);
- foreach ($dirs as $dir) {
- if (!$fs->removeDirectory($dir)) {
- throw new \RuntimeException('Could not remove '.$dir);
- }
- }
- } catch (\Exception $e) {
- $io->writeError('<error>An error occurred while removing the VCS metadata: '.$e->getMessage().'</error>');
- }
- $hasVcs = false;
- }
- if (!$hasVcs) {
- $package = $composer->getPackage();
- $configSource = new JsonConfigSource(new JsonFile('composer.json'));
- foreach (BasePackage::$supportedLinkTypes as $type => $meta) {
- foreach ($package->{'get'.$meta['method']}() as $link) {
- if ($link->getPrettyConstraint() === 'self.version') {
- $configSource->addLink($type, $link->getTarget(), $package->getPrettyVersion());
- }
- }
- }
- }
- if ($noScripts === false) {
- $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_CREATE_PROJECT_CMD, $installDevPackages);
- }
- chdir($oldCwd);
- $vendorComposerDir = $composer->getConfig()->get('vendor-dir').'/composer';
- if (is_dir($vendorComposerDir) && $fs->isDirEmpty($vendorComposerDir)) {
- Silencer::call('rmdir', $vendorComposerDir);
- $vendorDir = $composer->getConfig()->get('vendor-dir');
- if (is_dir($vendorDir) && $fs->isDirEmpty($vendorDir)) {
- Silencer::call('rmdir', $vendorDir);
- }
- }
- return 0;
- }
- protected function installRootPackage(IOInterface $io, Config $config, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repositoryUrl = null, $disablePlugins = false, $noScripts = false, $keepVcs = false, $noProgress = false)
- {
- if (null === $repositoryUrl) {
- $sourceRepo = new CompositeRepository(Factory::createDefaultRepositories($io, $config));
- } elseif ("json" === pathinfo($repositoryUrl, PATHINFO_EXTENSION) && file_exists($repositoryUrl)) {
- $json = new JsonFile($repositoryUrl, Factory::createRemoteFilesystem($io, $config));
- $data = $json->read();
- if (!empty($data['packages']) || !empty($data['includes']) || !empty($data['provider-includes'])) {
- $sourceRepo = new ComposerRepository(array('url' => 'file://' . strtr(realpath($repositoryUrl), '\\', '/')), $io, $config);
- } else {
- $sourceRepo = new FilesystemRepository($json);
- }
- } elseif (0 === strpos($repositoryUrl, 'http')) {
- $sourceRepo = new ComposerRepository(array('url' => $repositoryUrl), $io, $config);
- } else {
- throw new \InvalidArgumentException("Invalid repository url given. Has to be a .json file or an http url.");
- }
- $parser = new VersionParser();
- $requirements = $parser->parseNameVersionPairs(array($packageName));
- $name = strtolower($requirements[0]['name']);
- if (!$packageVersion && isset($requirements[0]['version'])) {
- $packageVersion = $requirements[0]['version'];
- }
- if (null === $stability) {
- if (preg_match('{^[^,\s]*?@('.implode('|', array_keys(BasePackage::$stabilities)).')$}i', $packageVersion, $match)) {
- $stability = $match[1];
- } else {
- $stability = VersionParser::parseStability($packageVersion);
- }
- }
- $stability = VersionParser::normalizeStability($stability);
- if (!isset(BasePackage::$stabilities[$stability])) {
- throw new \InvalidArgumentException('Invalid stability provided ('.$stability.'), must be one of: '.implode(', ', array_keys(BasePackage::$stabilities)));
- }
- $pool = new Pool($stability);
- $pool->addRepository($sourceRepo);
- $phpVersion = PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION;
- $versionSelector = new VersionSelector($pool);
- $package = $versionSelector->findBestCandidate($name, $packageVersion, $phpVersion, $stability);
- if (!$package) {
- throw new \InvalidArgumentException("Could not find package $name" . ($packageVersion ? " with version $packageVersion." : " with stability $stability."));
- }
- if (null === $directory) {
- $parts = explode("/", $name, 2);
- $directory = getcwd() . DIRECTORY_SEPARATOR . array_pop($parts);
- }
- if (function_exists('pcntl_signal')) {
- declare(ticks=100);
- pcntl_signal(SIGINT, function () use ($directory) {
- $fs = new Filesystem();
- $fs->removeDirectory($directory);
- exit(130);
- });
- }
- $io->writeError('<info>Installing ' . $package->getName() . ' (' . $package->getFullPrettyVersion(false) . ')</info>');
- if ($disablePlugins) {
- $io->writeError('<info>Plugins have been disabled.</info>');
- }
- if (0 === strpos($package->getPrettyVersion(), 'dev-') && in_array($package->getSourceType(), array('git', 'hg'))) {
- $package->setSourceReference(substr($package->getPrettyVersion(), 4));
- }
- $dm = $this->createDownloadManager($io, $config);
- $dm->setPreferSource($preferSource)
- ->setPreferDist($preferDist)
- ->setOutputProgress(!$noProgress);
- $projectInstaller = new ProjectInstaller($directory, $dm);
- $im = $this->createInstallationManager();
- $im->addInstaller($projectInstaller);
- $im->install(new InstalledFilesystemRepository(new JsonFile('php://memory')), new InstallOperation($package));
- $im->notifyInstalls($io);
- $installedFromVcs = 'source' === $package->getInstallationSource();
- $io->writeError('<info>Created project in ' . $directory . '</info>');
- chdir($directory);
- $_SERVER['COMPOSER_ROOT_VERSION'] = $package->getPrettyVersion();
- putenv('COMPOSER_ROOT_VERSION='.$_SERVER['COMPOSER_ROOT_VERSION']);
- return $installedFromVcs;
- }
- protected function createDownloadManager(IOInterface $io, Config $config)
- {
- $factory = new Factory();
- return $factory->createDownloadManager($io, $config);
- }
- protected function createInstallationManager()
- {
- return new InstallationManager();
- }
- protected function updatePreferredOptions(Config $config, InputInterface $input, &$preferSource, &$preferDist, $keepVcsRequiresPreferSource = false)
- {
- $preferSource = false;
- $preferDist = false;
- switch ($config->get('preferred-install')) {
- case 'source':
- $preferSource = true;
- break;
- case 'dist':
- $preferDist = true;
- break;
- case 'auto':
- default:
- break;
- }
- if ($input->getOption('prefer-source') || $input->getOption('prefer-dist') || ($keepVcsRequiresPreferSource && $input->getOption('keep-vcs'))) {
- $preferSource = $input->getOption('prefer-source') || ($keepVcsRequiresPreferSource && $input->getOption('keep-vcs'));
- $preferDist = $input->getOption('prefer-dist');
- }
- }
- }
- <?php
- namespace Composer\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class DependsCommand extends BaseDependencyCommand
- {
- protected function configure()
- {
- parent::configure();
- $this
- ->setName('depends')
- ->setAliases(array('why'))
- ->setDescription('Shows which packages cause the given package to be installed')
- ->setHelp(<<<EOT
- Displays detailed information about where a package is referenced.
- <info>php composer.phar depends composer/composer</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- return parent::doExecute($input, $output, false);
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Composer;
- use Composer\Factory;
- use Composer\Config;
- use Composer\Downloader\TransportException;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Composer\Util\ConfigValidator;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\RemoteFilesystem;
- use Composer\Util\StreamContextFactory;
- use Composer\Util\Keys;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class DiagnoseCommand extends BaseCommand
- {
- protected $rfs;
- protected $process;
- protected $failures = 0;
- protected function configure()
- {
- $this
- ->setName('diagnose')
- ->setDescription('Diagnoses the system to identify common errors.')
- ->setHelp(<<<EOT
- The <info>diagnose</info> command checks common errors to help debugging problems.
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $composer = $this->getComposer(false);
- $io = $this->getIO();
- if ($composer) {
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'diagnose', $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $io->write('Checking composer.json: ', false);
- $this->outputResult($this->checkComposerSchema());
- }
- if ($composer) {
- $config = $composer->getConfig();
- } else {
- $config = Factory::createConfig();
- }
- $this->rfs = Factory::createRemoteFilesystem($io, $config);
- $this->process = new ProcessExecutor($io);
- $io->write('Checking platform settings: ', false);
- $this->outputResult($this->checkPlatform());
- $io->write('Checking git settings: ', false);
- $this->outputResult($this->checkGit());
- $io->write('Checking http connectivity to packagist: ', false);
- $this->outputResult($this->checkHttp('http', $config));
- $io->write('Checking https connectivity to packagist: ', false);
- $this->outputResult($this->checkHttp('https', $config));
- $opts = stream_context_get_options(StreamContextFactory::getContext('http://example.org'));
- if (!empty($opts['http']['proxy'])) {
- $io->write('Checking HTTP proxy: ', false);
- $this->outputResult($this->checkHttpProxy());
- $io->write('Checking HTTP proxy support for request_fulluri: ', false);
- $this->outputResult($this->checkHttpProxyFullUriRequestParam());
- $io->write('Checking HTTPS proxy support for request_fulluri: ', false);
- $this->outputResult($this->checkHttpsProxyFullUriRequestParam());
- }
- if ($oauth = $config->get('github-oauth')) {
- foreach ($oauth as $domain => $token) {
- $io->write('Checking '.$domain.' oauth access: ', false);
- $this->outputResult($this->checkGithubOauth($domain, $token));
- }
- } else {
- $io->write('Checking github.com rate limit: ', false);
- try {
- $rate = $this->getGithubRateLimit('github.com');
- $this->outputResult(true);
- if (10 > $rate['remaining']) {
- $io->write('<warning>WARNING</warning>');
- $io->write(sprintf(
- '<comment>Github has a rate limit on their API. '
- . 'You currently have <options=bold>%u</options=bold> '
- . 'out of <options=bold>%u</options=bold> requests left.' . PHP_EOL
- . 'See https://developer.github.com/v3/#rate-limiting and also' . PHP_EOL
- . ' https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens</comment>',
- $rate['remaining'],
- $rate['limit']
- ));
- }
- } catch (\Exception $e) {
- if ($e instanceof TransportException && $e->getCode() === 401) {
- $this->outputResult('<comment>The oauth token for github.com seems invalid, run "composer config --global --unset github-oauth.github.com" to remove it</comment>');
- } else {
- $this->outputResult($e);
- }
- }
- }
- $io->write('Checking disk free space: ', false);
- $this->outputResult($this->checkDiskSpace($config));
- $io->write('Checking pubkeys: ', false);
- $this->outputResult($this->checkPubKeys($config));
- $io->write('Checking composer version: ', false);
- $this->outputResult($this->checkVersion());
- return $this->failures;
- }
- private function checkComposerSchema()
- {
- $validator = new ConfigValidator($this->getIO());
- list($errors, , $warnings) = $validator->validate(Factory::getComposerFile());
- if ($errors || $warnings) {
- $messages = array(
- 'error' => $errors,
- 'warning' => $warnings,
- );
- $output = '';
- foreach ($messages as $style => $msgs) {
- foreach ($msgs as $msg) {
- $output .= '<' . $style . '>' . $msg . '</' . $style . '>' . PHP_EOL;
- }
- }
- return rtrim($output);
- }
- return true;
- }
- private function checkGit()
- {
- $this->process->execute('git config color.ui', $output);
- if (strtolower(trim($output)) === 'always') {
- return '<comment>Your git color.ui setting is set to always, this is known to create issues. Use "git config --global color.ui true" to set it correctly.</comment>';
- }
- return true;
- }
- private function checkHttp($proto, Config $config)
- {
- $disableTls = false;
- $result = array();
- if ($proto === 'https' && $config->get('disable-tls') === true) {
- $disableTls = true;
- $result[] = '<warning>Composer is configured to disable SSL/TLS protection. This will leave remote HTTPS requests vulnerable to Man-In-The-Middle attacks.</warning>';
- }
- if ($proto === 'https' && !extension_loaded('openssl') && !$disableTls) {
- $result[] = '<error>Composer is configured to use SSL/TLS protection but the openssl extension is not available.</error>';
- }
- try {
- $this->rfs->getContents('packagist.org', $proto . '://packagist.org/packages.json', false);
- } catch (TransportException $e) {
- if (false !== strpos($e->getMessage(), 'cafile')) {
- $result[] = '<error>[' . get_class($e) . '] ' . $e->getMessage() . '</error>';
- $result[] = '<error>Unable to locate a valid CA certificate file. You must set a valid \'cafile\' option.</error>';
- $result[] = '<error>You can alternatively disable this error, at your own risk, by enabling the \'disable-tls\' option.</error>';
- } else {
- array_unshift($result, '[' . get_class($e) . '] ' . $e->getMessage());
- }
- }
- if (count($result) > 0) {
- return $result;
- }
- return true;
- }
- private function checkHttpProxy()
- {
- $protocol = extension_loaded('openssl') ? 'https' : 'http';
- try {
- $json = json_decode($this->rfs->getContents('packagist.org', $protocol . '://packagist.org/packages.json', false), true);
- $hash = reset($json['provider-includes']);
- $hash = $hash['sha256'];
- $path = str_replace('%hash%', $hash, key($json['provider-includes']));
- $provider = $this->rfs->getContents('packagist.org', $protocol . '://packagist.org/'.$path, false);
- if (hash('sha256', $provider) !== $hash) {
- return 'It seems that your proxy is modifying http traffic on the fly';
- }
- } catch (\Exception $e) {
- return $e;
- }
- return true;
- }
- private function checkHttpProxyFullUriRequestParam()
- {
- $url = 'http://packagist.org/packages.json';
- try {
- $this->rfs->getContents('packagist.org', $url, false);
- } catch (TransportException $e) {
- try {
- $this->rfs->getContents('packagist.org', $url, false, array('http' => array('request_fulluri' => false)));
- } catch (TransportException $e) {
- return 'Unable to assess the situation, maybe packagist.org is down ('.$e->getMessage().')';
- }
- return 'It seems there is a problem with your proxy server, try setting the "HTTP_PROXY_REQUEST_FULLURI" and "HTTPS_PROXY_REQUEST_FULLURI" environment variables to "false"';
- }
- return true;
- }
- private function checkHttpsProxyFullUriRequestParam()
- {
- if (!extension_loaded('openssl')) {
- return 'You need the openssl extension installed for this check';
- }
- $url = 'https://api.github.com/repos/Seldaek/jsonlint/zipball/1.0.0';
- try {
- $this->rfs->getContents('github.com', $url, false);
- } catch (TransportException $e) {
- try {
- $this->rfs->getContents('github.com', $url, false, array('http' => array('request_fulluri' => false)));
- } catch (TransportException $e) {
- return 'Unable to assess the situation, maybe github is down ('.$e->getMessage().')';
- }
- return 'It seems there is a problem with your proxy server, try setting the "HTTPS_PROXY_REQUEST_FULLURI" environment variable to "false"';
- }
- return true;
- }
- private function checkGithubOauth($domain, $token)
- {
- $this->getIO()->setAuthentication($domain, $token, 'x-oauth-basic');
- try {
- $url = $domain === 'github.com' ? 'https://api.'.$domain.'/' : 'https://'.$domain.'/api/v3/';
- return $this->rfs->getContents($domain, $url, false, array(
- 'retry-auth-failure' => false,
- )) ? true : 'Unexpected error';
- } catch (\Exception $e) {
- if ($e instanceof TransportException && $e->getCode() === 401) {
- return '<comment>The oauth token for '.$domain.' seems invalid, run "composer config --global --unset github-oauth.'.$domain.'" to remove it</comment>';
- }
- return $e;
- }
- }
- private function getGithubRateLimit($domain, $token = null)
- {
- if ($token) {
- $this->getIO()->setAuthentication($domain, $token, 'x-oauth-basic');
- }
- $url = $domain === 'github.com' ? 'https://api.'.$domain.'/rate_limit' : 'https://'.$domain.'/api/rate_limit';
- $json = $this->rfs->getContents($domain, $url, false, array('retry-auth-failure' => false));
- $data = json_decode($json, true);
- return $data['resources']['core'];
- }
- private function checkDiskSpace($config)
- {
- $minSpaceFree = 1024 * 1024;
- if ((($df = @disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
- || (($df = @disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
- ) {
- return '<error>The disk hosting '.$dir.' is full</error>';
- }
- return true;
- }
- private function checkPubKeys($config)
- {
- $home = $config->get('home');
- $errors = array();
- $io = $this->getIO();
- if (file_exists($home.'/keys.tags.pub') && file_exists($home.'/keys.dev.pub')) {
- $io->write('');
- }
- if (file_exists($home.'/keys.tags.pub')) {
- $io->write('Tags Public Key Fingerprint: ' . Keys::fingerprint($home.'/keys.tags.pub'));
- } else {
- $errors[] = '<error>Missing pubkey for tags verification</error>';
- }
- if (file_exists($home.'/keys.dev.pub')) {
- $io->write('Dev Public Key Fingerprint: ' . Keys::fingerprint($home.'/keys.dev.pub'));
- } else {
- $errors[] = '<error>Missing pubkey for dev verification</error>';
- }
- if ($errors) {
- $errors[] = '<error>Run composer self-update --update-keys to set them up</error>';
- }
- return $errors ?: true;
- }
- private function checkVersion()
- {
- $protocol = extension_loaded('openssl') ? 'https' : 'http';
- $latest = trim($this->rfs->getContents('getcomposer.org', $protocol . '://getcomposer.org/version', false));
- if (Composer::VERSION !== $latest && Composer::VERSION !== '@package_version@') {
- return '<comment>You are not running the latest version, run `composer self-update` to update</comment>';
- }
- return true;
- }
- private function outputResult($result)
- {
- $io = $this->getIO();
- if (true === $result) {
- $io->write('<info>OK</info>');
- } else {
- $this->failures++;
- $io->write('<error>FAIL</error>');
- if ($result instanceof \Exception) {
- $io->write('['.get_class($result).'] '.$result->getMessage());
- } elseif ($result) {
- if (is_array($result)) {
- foreach ($result as $message) {
- $io->write($message);
- }
- } else {
- $io->write($result);
- }
- }
- }
- }
- private function checkPlatform()
- {
- $output = '';
- $out = function ($msg, $style) use (&$output) {
- $output .= '<'.$style.'>'.$msg.'</'.$style.'>'.PHP_EOL;
- };
- $errors = array();
- $warnings = array();
- $iniPath = php_ini_loaded_file();
- $displayIniMessage = false;
- if ($iniPath) {
- $iniMessage = PHP_EOL.PHP_EOL.'The php.ini used by your command-line PHP is: ' . $iniPath;
- } else {
- $iniMessage = PHP_EOL.PHP_EOL.'A php.ini file does not exist. You will have to create one.';
- }
- $iniMessage .= PHP_EOL.'If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.';
- if (!function_exists('json_decode')) {
- $errors['json'] = true;
- }
- if (!extension_loaded('Phar')) {
- $errors['phar'] = true;
- }
- if (!extension_loaded('filter')) {
- $errors['filter'] = true;
- }
- if (!extension_loaded('hash')) {
- $errors['hash'] = true;
- }
- if (!extension_loaded('iconv') && !extension_loaded('mbstring')) {
- $errors['iconv_mbstring'] = true;
- }
- if (!ini_get('allow_url_fopen')) {
- $errors['allow_url_fopen'] = true;
- }
- if (extension_loaded('ionCube Loader') && ioncube_loader_iversion() < 40009) {
- $errors['ioncube'] = ioncube_loader_version();
- }
- if (PHP_VERSION_ID < 50302) {
- $errors['php'] = PHP_VERSION;
- }
- if (!isset($errors['php']) && PHP_VERSION_ID < 50304) {
- $warnings['php'] = PHP_VERSION;
- }
- if (!extension_loaded('openssl')) {
- $errors['openssl'] = true;
- }
- if (extension_loaded('openssl') && OPENSSL_VERSION_NUMBER < 0x1000100f) {
- $warnings['openssl_version'] = true;
- }
- if (!defined('HHVM_VERSION') && !extension_loaded('apcu') && ini_get('apc.enable_cli')) {
- $warnings['apc_cli'] = true;
- }
- ob_start();
- phpinfo(INFO_GENERAL);
- $phpinfo = ob_get_clean();
- if (preg_match('{Configure Command(?: *</td><td class="v">| *=> *)(.*?)(?:</td>|$)}m', $phpinfo, $match)) {
- $configure = $match[1];
- if (false !== strpos($configure, '--enable-sigchild')) {
- $warnings['sigchild'] = true;
- }
- if (false !== strpos($configure, '--with-curlwrappers')) {
- $warnings['curlwrappers'] = true;
- }
- }
- if (ini_get('xdebug.profiler_enabled')) {
- $warnings['xdebug_profile'] = true;
- } elseif (extension_loaded('xdebug')) {
- $warnings['xdebug_loaded'] = true;
- }
- if (!empty($errors)) {
- foreach ($errors as $error => $current) {
- switch ($error) {
- case 'json':
- $text = PHP_EOL."The json extension is missing.".PHP_EOL;
- $text .= "Install it or recompile php without --disable-json";
- break;
- case 'phar':
- $text = PHP_EOL."The phar extension is missing.".PHP_EOL;
- $text .= "Install it or recompile php without --disable-phar";
- break;
- case 'filter':
- $text = PHP_EOL."The filter extension is missing.".PHP_EOL;
- $text .= "Install it or recompile php without --disable-filter";
- break;
- case 'hash':
- $text = PHP_EOL."The hash extension is missing.".PHP_EOL;
- $text .= "Install it or recompile php without --disable-hash";
- break;
- case 'iconv_mbstring':
- $text = PHP_EOL."The iconv OR mbstring extension is required and both are missing.".PHP_EOL;
- $text .= "Install either of them or recompile php without --disable-iconv";
- break;
- case 'unicode':
- $text = PHP_EOL."The detect_unicode setting must be disabled.".PHP_EOL;
- $text .= "Add the following to the end of your `php.ini`:".PHP_EOL;
- $text .= " detect_unicode = Off";
- $displayIniMessage = true;
- break;
- case 'suhosin':
- $text = PHP_EOL."The suhosin.executor.include.whitelist setting is incorrect.".PHP_EOL;
- $text .= "Add the following to the end of your `php.ini` or suhosin.ini (Example path [for Debian]: /etc/php5/cli/conf.d/suhosin.ini):".PHP_EOL;
- $text .= " suhosin.executor.include.whitelist = phar ".$current;
- $displayIniMessage = true;
- break;
- case 'php':
- $text = PHP_EOL."Your PHP ({$current}) is too old, you must upgrade to PHP 5.3.2 or higher.";
- break;
- case 'allow_url_fopen':
- $text = PHP_EOL."The allow_url_fopen setting is incorrect.".PHP_EOL;
- $text .= "Add the following to the end of your `php.ini`:".PHP_EOL;
- $text .= " allow_url_fopen = On";
- $displayIniMessage = true;
- break;
- case 'ioncube':
- $text = PHP_EOL."Your ionCube Loader extension ($current) is incompatible with Phar files.".PHP_EOL;
- $text .= "Upgrade to ionCube 4.0.9 or higher or remove this line (path may be different) from your `php.ini` to disable it:".PHP_EOL;
- $text .= " zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so";
- $displayIniMessage = true;
- break;
- case 'openssl':
- $text = PHP_EOL."The openssl extension is missing, which means that secure HTTPS transfers are impossible.".PHP_EOL;
- $text .= "If possible you should enable it or recompile php with --with-openssl";
- break;
- }
- $out($text, 'error');
- }
- $output .= PHP_EOL;
- }
- if (!empty($warnings)) {
- foreach ($warnings as $warning => $current) {
- switch ($warning) {
- case 'apc_cli':
- $text = "The apc.enable_cli setting is incorrect.".PHP_EOL;
- $text .= "Add the following to the end of your `php.ini`:".PHP_EOL;
- $text .= " apc.enable_cli = Off";
- $displayIniMessage = true;
- break;
- case 'sigchild':
- $text = "PHP was compiled with --enable-sigchild which can cause issues on some platforms.".PHP_EOL;
- $text .= "Recompile it without this flag if possible, see also:".PHP_EOL;
- $text .= " https://bugs.php.net/bug.php?id=22999";
- break;
- case 'curlwrappers':
- $text = "PHP was compiled with --with-curlwrappers which will cause issues with HTTP authentication and GitHub.".PHP_EOL;
- $text .= " Recompile it without this flag if possible";
- break;
- case 'php':
- $text = "Your PHP ({$current}) is quite old, upgrading to PHP 5.3.4 or higher is recommended.".PHP_EOL;
- $text .= " Composer works with 5.3.2+ for most people, but there might be edge case issues.";
- break;
- case 'openssl_version':
- $opensslVersion = strstr(trim(strstr(OPENSSL_VERSION_TEXT, ' ')), ' ', true);
- $opensslVersion = $opensslVersion ?: OPENSSL_VERSION_TEXT;
- $text = "The OpenSSL library ({$opensslVersion}) used by PHP does not support TLSv1.2 or TLSv1.1.".PHP_EOL;
- $text .= "If possible you should upgrade OpenSSL to version 1.0.1 or above.";
- break;
- case 'xdebug_loaded':
- $text = "The xdebug extension is loaded, this can slow down Composer a little.".PHP_EOL;
- $text .= " Disabling it when using Composer is recommended.";
- break;
- case 'xdebug_profile':
- $text = "The xdebug.profiler_enabled setting is enabled, this can slow down Composer a lot.".PHP_EOL;
- $text .= "Add the following to the end of your `php.ini` to disable it:".PHP_EOL;
- $text .= " xdebug.profiler_enabled = 0";
- $displayIniMessage = true;
- break;
- }
- $out($text, 'comment');
- }
- }
- if ($displayIniMessage) {
- $out($iniMessage, 'comment');
- }
- return !$warnings && !$errors ? true : $output;
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- class DumpAutoloadCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('dump-autoload')
- ->setAliases(array('dumpautoload'))
- ->setDescription('Dumps the autoloader')
- ->setDefinition(array(
- new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
- new InputOption('optimize', 'o', InputOption::VALUE_NONE, 'Optimizes PSR0 and PSR4 packages to be loaded with classmaps too, good for production.'),
- new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize`.'),
- new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables autoload-dev rules.'),
- ))
- ->setHelp(<<<EOT
- <info>php composer.phar dump-autoload</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $composer = $this->getComposer();
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'dump-autoload', $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $installationManager = $composer->getInstallationManager();
- $localRepo = $composer->getRepositoryManager()->getLocalRepository();
- $package = $composer->getPackage();
- $config = $composer->getConfig();
- $optimize = $input->getOption('optimize') || $config->get('optimize-autoloader');
- $authoritative = $input->getOption('classmap-authoritative') || $config->get('classmap-authoritative');
- if ($optimize || $authoritative) {
- $this->getIO()->writeError('<info>Generating optimized autoload files</info>');
- } else {
- $this->getIO()->writeError('<info>Generating autoload files</info>');
- }
- $generator = $composer->getAutoloadGenerator();
- $generator->setDevMode(!$input->getOption('no-dev'));
- $generator->setClassMapAuthoritative($authoritative);
- $generator->setRunScripts(!$input->getOption('no-scripts'));
- $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize);
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Factory;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\StringInput;
- use Symfony\Component\Console\Output\OutputInterface;
- class GlobalCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('global')
- ->setDescription('Allows running commands in the global composer dir ($COMPOSER_HOME).')
- ->setDefinition(array(
- new InputArgument('command-name', InputArgument::REQUIRED, ''),
- new InputArgument('args', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, ''),
- ))
- ->setHelp(<<<EOT
- Use this command as a wrapper to run other Composer commands
- within the global context of COMPOSER_HOME.
- You can use this to install CLI utilities globally, all you need
- is to add the COMPOSER_HOME/vendor/bin dir to your PATH env var.
- COMPOSER_HOME is c:\Users\<user>\AppData\Roaming\Composer on Windows
- and /home/<user>/.composer on unix systems.
- Note: This path may vary depending on customizations to bin-dir in
- composer.json or the environmental variable COMPOSER_BIN_DIR.
- EOT
- )
- ;
- }
- public function run(InputInterface $input, OutputInterface $output)
- {
- $tokens = preg_split('{\s+}', $input->__toString());
- $args = array();
- foreach ($tokens as $token) {
- if ($token && $token[0] !== '-') {
- $args[] = $token;
- if (count($args) >= 2) {
- break;
- }
- }
- }
- if (count($args) < 2) {
- return parent::run($input, $output);
- }
- $config = Factory::createConfig();
- chdir($config->get('home'));
- $this->getIO()->writeError('<info>Changed current directory to '.$config->get('home').'</info>');
- $input = new StringInput(preg_replace('{\bg(?:l(?:o(?:b(?:a(?:l)?)?)?)?)?\b}', '', $input->__toString(), 1));
- return $this->getApplication()->run($input, $output);
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Factory;
- use Composer\Package\CompletePackageInterface;
- use Composer\Repository\RepositoryInterface;
- use Composer\Repository\ArrayRepository;
- use Composer\Util\Platform;
- use Composer\Util\ProcessExecutor;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class HomeCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('browse')
- ->setAliases(array('home'))
- ->setDescription('Opens the package\'s repository URL or homepage in your browser.')
- ->setDefinition(array(
- new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'Package(s) to browse to.'),
- new InputOption('homepage', 'H', InputOption::VALUE_NONE, 'Open the homepage instead of the repository URL.'),
- new InputOption('show', 's', InputOption::VALUE_NONE, 'Only show the homepage or repository URL.'),
- ))
- ->setHelp(<<<EOT
- The home command opens or shows a package's repository URL or
- homepage in your default browser.
- To open the homepage by default, use -H or --homepage.
- To show instead of open the repository or homepage URL, use -s or --show.
- EOT
- );
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $repos = $this->initializeRepos();
- $io = $this->getIO();
- $return = 0;
- foreach ($input->getArgument('packages') as $packageName) {
- $handled = false;
- $packageExists = false;
- foreach ($repos as $repo) {
- foreach ($repo->findPackages($packageName) as $package) {
- $packageExists = true;
- if ($this->handlePackage($package, $input->getOption('homepage'), $input->getOption('show'))) {
- $handled = true;
- break 2;
- }
- }
- }
- if (!$packageExists) {
- $return = 1;
- $io->writeError('<warning>Package '.$packageName.' not found</warning>');
- }
- if (!$handled) {
- $return = 1;
- $io->writeError('<warning>'.($input->getOption('homepage') ? 'Invalid or missing homepage' : 'Invalid or missing repository URL').' for '.$packageName.'</warning>');
- }
- }
- return $return;
- }
- private function handlePackage(CompletePackageInterface $package, $showHomepage, $showOnly)
- {
- $support = $package->getSupport();
- $url = isset($support['source']) ? $support['source'] : $package->getSourceUrl();
- if (!$url || $showHomepage) {
- $url = $package->getHomepage();
- }
- if (!$url || !filter_var($url, FILTER_VALIDATE_URL)) {
- return false;
- }
- if ($showOnly) {
- $this->getIO()->write(sprintf('<info>%s</info>', $url));
- } else {
- $this->openBrowser($url);
- }
- return true;
- }
- private function openBrowser($url)
- {
- $url = ProcessExecutor::escape($url);
- if (Platform::isWindows()) {
- return passthru('start "web" explorer "' . $url . '"');
- }
- passthru('which xdg-open', $linux);
- passthru('which open', $osx);
- if (0 === $linux) {
- passthru('xdg-open ' . $url);
- } elseif (0 === $osx) {
- passthru('open ' . $url);
- } else {
- $this->getIO()->writeError('no suitable browser opening command found, open yourself: ' . $url);
- }
- }
- private function initializeRepos()
- {
- $composer = $this->getComposer(false);
- if ($composer) {
- return array_merge(
- array(new ArrayRepository(array($composer->getPackage()))),
- array($composer->getRepositoryManager()->getLocalRepository()),
- $composer->getRepositoryManager()->getRepositories()
- );
- }
- $defaultRepos = Factory::createDefaultRepositories($this->getIO());
- return $defaultRepos;
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\DependencyResolver\Pool;
- use Composer\Json\JsonFile;
- use Composer\Factory;
- use Composer\Package\BasePackage;
- use Composer\Package\Version\VersionParser;
- use Composer\Package\Version\VersionSelector;
- use Composer\Repository\CompositeRepository;
- use Composer\Repository\PlatformRepository;
- use Composer\Util\ProcessExecutor;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Process\Process;
- use Symfony\Component\Process\ExecutableFinder;
- class InitCommand extends BaseCommand
- {
- protected $repos;
- private $gitConfig;
- private $pool;
- protected function configure()
- {
- $this
- ->setName('init')
- ->setDescription('Creates a basic composer.json file in current directory.')
- ->setDefinition(array(
- new InputOption('name', null, InputOption::VALUE_REQUIRED, 'Name of the package'),
- new InputOption('description', null, InputOption::VALUE_REQUIRED, 'Description of package'),
- new InputOption('author', null, InputOption::VALUE_REQUIRED, 'Author name of package'),
- new InputOption('type', null, InputOption::VALUE_OPTIONAL, 'Type of package'),
- new InputOption('homepage', null, InputOption::VALUE_REQUIRED, 'Homepage of package'),
- new InputOption('require', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Package to require with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0"'),
- new InputOption('require-dev', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Package to require for development with a version constraint, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0"'),
- new InputOption('stability', 's', InputOption::VALUE_REQUIRED, 'Minimum stability (empty or one of: '.implode(', ', array_keys(BasePackage::$stabilities)).')'),
- new InputOption('license', 'l', InputOption::VALUE_REQUIRED, 'License of package'),
- ))
- ->setHelp(<<<EOT
- The <info>init</info> command creates a basic composer.json file
- in the current directory.
- <info>php composer.phar init</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $whitelist = array('name', 'description', 'author', 'type', 'homepage', 'require', 'require-dev', 'stability', 'license');
- $options = array_filter(array_intersect_key($input->getOptions(), array_flip($whitelist)));
- if (isset($options['author'])) {
- $options['authors'] = $this->formatAuthors($options['author']);
- unset($options['author']);
- }
- if (isset($options['stability'])) {
- $options['minimum-stability'] = $options['stability'];
- unset($options['stability']);
- }
- $options['require'] = isset($options['require']) ? $this->formatRequirements($options['require']) : new \stdClass;
- if (array() === $options['require']) {
- $options['require'] = new \stdClass;
- }
- if (isset($options['require-dev'])) {
- $options['require-dev'] = $this->formatRequirements($options['require-dev']);
- if (array() === $options['require-dev']) {
- $options['require-dev'] = new \stdClass;
- }
- }
- $file = new JsonFile('composer.json');
- $json = $file->encode($options);
- $io = $this->getIO();
- if ($input->isInteractive()) {
- $io->writeError(array('', $json, ''));
- if (!$io->askConfirmation('Do you confirm generation [<comment>yes</comment>]? ', true)) {
- $io->writeError('<error>Command aborted</error>');
- return 1;
- }
- }
- $file->write($options);
- if ($input->isInteractive() && is_dir('.git')) {
- $ignoreFile = realpath('.gitignore');
- if (false === $ignoreFile) {
- $ignoreFile = realpath('.') . '/.gitignore';
- }
- if (!$this->hasVendorIgnore($ignoreFile)) {
- $question = 'Would you like the <info>vendor</info> directory added to your <info>.gitignore</info> [<comment>yes</comment>]? ';
- if ($io->askConfirmation($question, true)) {
- $this->addVendorIgnore($ignoreFile);
- }
- }
- }
- }
- protected function interact(InputInterface $input, OutputInterface $output)
- {
- $git = $this->getGitConfig();
- $io = $this->getIO();
- $formatter = $this->getHelperSet()->get('formatter');
- $io->writeError(array(
- '',
- $formatter->formatBlock('Welcome to the Composer config generator', 'bg=blue;fg=white', true),
- '',
- ));
- $io->writeError(array(
- '',
- 'This command will guide you through creating your composer.json config.',
- '',
- ));
- $cwd = realpath(".");
- if (!$name = $input->getOption('name')) {
- $name = basename($cwd);
- $name = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $name);
- $name = strtolower($name);
- if (isset($git['github.user'])) {
- $name = $git['github.user'] . '/' . $name;
- } elseif (!empty($_SERVER['USERNAME'])) {
- $name = $_SERVER['USERNAME'] . '/' . $name;
- } elseif (get_current_user()) {
- $name = get_current_user() . '/' . $name;
- } else {
- $name = $name . '/' . $name;
- }
- } else {
- if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $name)) {
- throw new \InvalidArgumentException(
- 'The package name '.$name.' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+'
- );
- }
- }
- $name = $io->askAndValidate(
- 'Package name (<vendor>/<name>) [<comment>'.$name.'</comment>]: ',
- function ($value) use ($name) {
- if (null === $value) {
- return $name;
- }
- if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $value)) {
- throw new \InvalidArgumentException(
- 'The package name '.$value.' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+'
- );
- }
- return $value;
- },
- null,
- $name
- );
- $input->setOption('name', $name);
- $description = $input->getOption('description') ?: false;
- $description = $io->ask(
- 'Description [<comment>'.$description.'</comment>]: ',
- $description
- );
- $input->setOption('description', $description);
- if (null === $author = $input->getOption('author')) {
- if (isset($git['user.name']) && isset($git['user.email'])) {
- $author = sprintf('%s <%s>', $git['user.name'], $git['user.email']);
- }
- }
- $self = $this;
- $author = $io->askAndValidate(
- 'Author [<comment>'.$author.'</comment>]: ',
- function ($value) use ($self, $author) {
- $value = $value ?: $author;
- $author = $self->parseAuthorString($value);
- return sprintf('%s <%s>', $author['name'], $author['email']);
- },
- null,
- $author
- );
- $input->setOption('author', $author);
- $minimumStability = $input->getOption('stability') ?: null;
- $minimumStability = $io->askAndValidate(
- 'Minimum Stability [<comment>'.$minimumStability.'</comment>]: ',
- function ($value) use ($self, $minimumStability) {
- if (null === $value) {
- return $minimumStability;
- }
- if (!isset(BasePackage::$stabilities[$value])) {
- throw new \InvalidArgumentException(
- 'Invalid minimum stability "'.$value.'". Must be empty or one of: '.
- implode(', ', array_keys(BasePackage::$stabilities))
- );
- }
- return $value;
- },
- null,
- $minimumStability
- );
- $input->setOption('stability', $minimumStability);
- $type = $input->getOption('type') ?: false;
- $type = $io->ask(
- 'Package Type [<comment>'.$type.'</comment>]: ',
- $type
- );
- $input->setOption('type', $type);
- $license = $input->getOption('license') ?: false;
- $license = $io->ask(
- 'License [<comment>'.$license.'</comment>]: ',
- $license
- );
- $input->setOption('license', $license);
- $io->writeError(array('', 'Define your dependencies.', ''));
- $question = 'Would you like to define your dependencies (require) interactively [<comment>yes</comment>]? ';
- $requirements = array();
- if ($io->askConfirmation($question, true)) {
- $requirements = $this->determineRequirements($input, $output, $input->getOption('require'));
- }
- $input->setOption('require', $requirements);
- $question = 'Would you like to define your dev dependencies (require-dev) interactively [<comment>yes</comment>]? ';
- $devRequirements = array();
- if ($io->askConfirmation($question, true)) {
- $devRequirements = $this->determineRequirements($input, $output, $input->getOption('require-dev'));
- }
- $input->setOption('require-dev', $devRequirements);
- }
- public function parseAuthorString($author)
- {
- if (preg_match('/^(?P<name>[- \.,\p{L}\p{N}\'’]+) <(?P<email>.+?)>$/u', $author, $match)) {
- if ($this->isValidEmail($match['email'])) {
- return array(
- 'name' => trim($match['name']),
- 'email' => $match['email'],
- );
- }
- }
- throw new \InvalidArgumentException(
- 'Invalid author string. Must be in the format: '.
- 'John Smith <john@example.com>'
- );
- }
- protected function findPackages($name)
- {
- return $this->getRepos()->search($name);
- }
- protected function getRepos()
- {
- if (!$this->repos) {
- $this->repos = new CompositeRepository(array_merge(
- array(new PlatformRepository),
- Factory::createDefaultRepositories($this->getIO())
- ));
- }
- return $this->repos;
- }
- protected function determineRequirements(InputInterface $input, OutputInterface $output, $requires = array(), $phpVersion = null)
- {
- if ($requires) {
- $requires = $this->normalizeRequirements($requires);
- $result = array();
- $io = $this->getIO();
- foreach ($requires as $requirement) {
- if (!isset($requirement['version'])) {
- $version = $this->findBestVersionForPackage($input, $requirement['name'], $phpVersion);
- $requirement['version'] = $version;
- $io->writeError(sprintf(
- 'Using version <info>%s</info> for <info>%s</info>',
- $requirement['version'],
- $requirement['name']
- ));
- }
- $result[] = $requirement['name'] . ' ' . $requirement['version'];
- }
- return $result;
- }
- $versionParser = new VersionParser();
- $io = $this->getIO();
- while (null !== $package = $io->ask('Search for a package: ')) {
- $matches = $this->findPackages($package);
- if (count($matches)) {
- $exactMatch = null;
- $choices = array();
- foreach ($matches as $position => $foundPackage) {
- $choices[] = sprintf(' <info>%5s</info> %s', "[$position]", $foundPackage['name']);
- if ($foundPackage['name'] === $package) {
- $exactMatch = true;
- break;
- }
- }
- if (!$exactMatch) {
- $io->writeError(array(
- '',
- sprintf('Found <info>%s</info> packages matching <info>%s</info>', count($matches), $package),
- '',
- ));
- $io->writeError($choices);
- $io->writeError('');
- $validator = function ($selection) use ($matches, $versionParser) {
- if ('' === $selection) {
- return false;
- }
- if (is_numeric($selection) && isset($matches[(int) $selection])) {
- $package = $matches[(int) $selection];
- return $package['name'];
- }
- if (preg_match('{^\s*(?P<name>[\S/]+)(?:\s+(?P<version>\S+))?\s*$}', $selection, $packageMatches)) {
- if (isset($packageMatches['version'])) {
- $versionParser->parseConstraints($packageMatches['version']);
- return $packageMatches['name'].' '.$packageMatches['version'];
- }
- return $packageMatches['name'];
- }
- throw new \Exception('Not a valid selection');
- };
- $package = $io->askAndValidate(
- 'Enter package # to add, or the complete package name if it is not listed: ',
- $validator,
- 3,
- false
- );
- }
- if (false !== $package && false === strpos($package, ' ')) {
- $validator = function ($input) {
- $input = trim($input);
- return $input ?: false;
- };
- $constraint = $io->askAndValidate(
- 'Enter the version constraint to require (or leave blank to use the latest version): ',
- $validator,
- 3,
- false
- );
- if (false === $constraint) {
- $constraint = $this->findBestVersionForPackage($input, $package, $phpVersion);
- $io->writeError(sprintf(
- 'Using version <info>%s</info> for <info>%s</info>',
- $constraint,
- $package
- ));
- }
- $package .= ' '.$constraint;
- }
- if (false !== $package) {
- $requires[] = $package;
- }
- }
- }
- return $requires;
- }
- protected function formatAuthors($author)
- {
- return array($this->parseAuthorString($author));
- }
- protected function formatRequirements(array $requirements)
- {
- $requires = array();
- $requirements = $this->normalizeRequirements($requirements);
- foreach ($requirements as $requirement) {
- $requires[$requirement['name']] = $requirement['version'];
- }
- return $requires;
- }
- protected function getGitConfig()
- {
- if (null !== $this->gitConfig) {
- return $this->gitConfig;
- }
- $finder = new ExecutableFinder();
- $gitBin = $finder->find('git');
- $cmd = new Process(sprintf('%s config -l', ProcessExecutor::escape($gitBin)));
- $cmd->run();
- if ($cmd->isSuccessful()) {
- $this->gitConfig = array();
- preg_match_all('{^([^=]+)=(.*)$}m', $cmd->getOutput(), $matches, PREG_SET_ORDER);
- foreach ($matches as $match) {
- $this->gitConfig[$match[1]] = $match[2];
- }
- return $this->gitConfig;
- }
- return $this->gitConfig = array();
- }
- protected function hasVendorIgnore($ignoreFile, $vendor = 'vendor')
- {
- if (!file_exists($ignoreFile)) {
- return false;
- }
- $pattern = sprintf('{^/?%s(/\*?)?$}', preg_quote($vendor));
- $lines = file($ignoreFile, FILE_IGNORE_NEW_LINES);
- foreach ($lines as $line) {
- if (preg_match($pattern, $line)) {
- return true;
- }
- }
- return false;
- }
- protected function normalizeRequirements(array $requirements)
- {
- $parser = new VersionParser();
- return $parser->parseNameVersionPairs($requirements);
- }
- protected function addVendorIgnore($ignoreFile, $vendor = '/vendor/')
- {
- $contents = "";
- if (file_exists($ignoreFile)) {
- $contents = file_get_contents($ignoreFile);
- if ("\n" !== substr($contents, 0, -1)) {
- $contents .= "\n";
- }
- }
- file_put_contents($ignoreFile, $contents . $vendor. "\n");
- }
- protected function isValidEmail($email)
- {
- if (!function_exists('filter_var')) {
- return true;
- }
- if (PHP_VERSION_ID < 50303) {
- return true;
- }
- return false !== filter_var($email, FILTER_VALIDATE_EMAIL);
- }
- private function getPool(InputInterface $input)
- {
- if (!$this->pool) {
- $this->pool = new Pool($this->getMinimumStability($input));
- $this->pool->addRepository($this->getRepos());
- }
- return $this->pool;
- }
- private function getMinimumStability(InputInterface $input)
- {
- if ($input->hasOption('stability')) {
- return $input->getOption('stability') ?: 'stable';
- }
- $file = Factory::getComposerFile();
- if (is_file($file) && is_readable($file) && is_array($composer = json_decode(file_get_contents($file), true))) {
- if (!empty($composer['minimum-stability'])) {
- return $composer['minimum-stability'];
- }
- }
- return 'stable';
- }
- private function findBestVersionForPackage(InputInterface $input, $name, $phpVersion)
- {
- $versionSelector = new VersionSelector($this->getPool($input));
- $package = $versionSelector->findBestCandidate($name, null, $phpVersion);
- if (!$package) {
- throw new \InvalidArgumentException(sprintf(
- 'Could not find package %s at any version for your minimum-stability (%s). Check the package spelling or your minimum-stability',
- $name,
- $this->getMinimumStability($input)
- ));
- }
- return $versionSelector->findRecommendedRequireVersion($package);
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Installer;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Output\OutputInterface;
- class InstallCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('install')
- ->setDescription('Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.')
- ->setDefinition(array(
- new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
- new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'),
- new InputOption('dry-run', null, InputOption::VALUE_NONE, 'Outputs the operations but will not execute anything (implicitly enables --verbose).'),
- new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables installation of require-dev packages (enabled by default, only present for BC).'),
- new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'),
- new InputOption('no-plugins', null, InputOption::VALUE_NONE, 'Disables all plugins.'),
- new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'DEPRECATED: Use no-plugins instead.'),
- new InputOption('no-autoloader', null, InputOption::VALUE_NONE, 'Skips autoloader generation'),
- new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
- new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
- new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'),
- new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump'),
- new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'),
- new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'),
- new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Should not be provided, use composer require instead to add a given package to composer.json.'),
- ))
- ->setHelp(<<<EOT
- The <info>install</info> command reads the composer.lock file from
- the current directory, processes it, and downloads and installs all the
- libraries and dependencies outlined in that file. If the file does not
- exist it will look for composer.json and do the same.
- <info>php composer.phar install</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $io = $this->getIO();
- if ($args = $input->getArgument('packages')) {
- $io->writeError('<error>Invalid argument '.implode(' ', $args).'. Use "composer require '.implode(' ', $args).'" instead to add packages to your composer.json.</error>');
- return 1;
- }
- if ($input->getOption('no-custom-installers')) {
- $io->writeError('<warning>You are using the deprecated option "no-custom-installers". Use "no-plugins" instead.</warning>');
- $input->setOption('no-plugins', true);
- }
- if ($input->getOption('dev')) {
- $io->writeError('<warning>You are using the deprecated option "dev". Dev packages are installed by default now.</warning>');
- }
- $composer = $this->getComposer(true, $input->getOption('no-plugins'));
- $composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'install', $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $install = Installer::create($io, $composer);
- $preferSource = false;
- $preferDist = false;
- $config = $composer->getConfig();
- switch ($config->get('preferred-install')) {
- case 'source':
- $preferSource = true;
- break;
- case 'dist':
- $preferDist = true;
- break;
- case 'auto':
- default:
- break;
- }
- if ($input->getOption('prefer-source') || $input->getOption('prefer-dist')) {
- $preferSource = $input->getOption('prefer-source');
- $preferDist = $input->getOption('prefer-dist');
- }
- $optimize = $input->getOption('optimize-autoloader') || $config->get('optimize-autoloader');
- $authoritative = $input->getOption('classmap-authoritative') || $config->get('classmap-authoritative');
- $install
- ->setDryRun($input->getOption('dry-run'))
- ->setVerbose($input->getOption('verbose'))
- ->setPreferSource($preferSource)
- ->setPreferDist($preferDist)
- ->setDevMode(!$input->getOption('no-dev'))
- ->setDumpAutoloader(!$input->getOption('no-autoloader'))
- ->setRunScripts(!$input->getOption('no-scripts'))
- ->setOptimizeAutoloader($optimize)
- ->setClassMapAuthoritative($authoritative)
- ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
- ;
- if ($input->getOption('no-plugins')) {
- $install->disablePlugins();
- }
- return $install->run();
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Json\JsonFile;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Composer\Package\PackageInterface;
- use Composer\Repository\RepositoryInterface;
- use Symfony\Component\Console\Helper\Table;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- class LicensesCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('licenses')
- ->setDescription('Show information about licenses of dependencies')
- ->setDefinition(array(
- new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text or json', 'text'),
- new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables search in require-dev packages.'),
- ))
- ->setHelp(<<<EOT
- The license command displays detailed information about the licenses of
- the installed dependencies.
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $composer = $this->getComposer();
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'licenses', $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $root = $composer->getPackage();
- $repo = $composer->getRepositoryManager()->getLocalRepository();
- if ($input->getOption('no-dev')) {
- $packages = $this->filterRequiredPackages($repo, $root);
- } else {
- $packages = $this->appendPackages($repo->getPackages(), array());
- }
- ksort($packages);
- $io = $this->getIO();
- switch ($format = $input->getOption('format')) {
- case 'text':
- $io->write('Name: <comment>'.$root->getPrettyName().'</comment>');
- $io->write('Version: <comment>'.$root->getFullPrettyVersion().'</comment>');
- $io->write('Licenses: <comment>'.(implode(', ', $root->getLicense()) ?: 'none').'</comment>');
- $io->write('Dependencies:');
- $io->write('');
- $table = new Table($output);
- $table->setStyle('compact');
- $table->getStyle()->setVerticalBorderChar('');
- $table->getStyle()->setCellRowContentFormat('%s ');
- $table->setHeaders(array('Name', 'Version', 'License'));
- foreach ($packages as $package) {
- $table->addRow(array(
- $package->getPrettyName(),
- $package->getFullPrettyVersion(),
- implode(', ', $package->getLicense()) ?: 'none',
- ));
- }
- $table->render();
- break;
- case 'json':
- $dependencies = array();
- foreach ($packages as $package) {
- $dependencies[$package->getPrettyName()] = array(
- 'version' => $package->getFullPrettyVersion(),
- 'license' => $package->getLicense(),
- );
- }
- $io->write(JsonFile::encode(array(
- 'name' => $root->getPrettyName(),
- 'version' => $root->getFullPrettyVersion(),
- 'license' => $root->getLicense(),
- 'dependencies' => $dependencies,
- )));
- break;
- default:
- throw new \RuntimeException(sprintf('Unsupported format "%s". See help for supported formats.', $format));
- }
- }
- private function filterRequiredPackages(RepositoryInterface $repo, PackageInterface $package, $bucket = array())
- {
- $requires = array_keys($package->getRequires());
- $packageListNames = array_keys($bucket);
- $packages = array_filter(
- $repo->getPackages(),
- function ($package) use ($requires, $packageListNames) {
- return in_array($package->getName(), $requires) && !in_array($package->getName(), $packageListNames);
- }
- );
- $bucket = $this->appendPackages($packages, $bucket);
- foreach ($packages as $package) {
- $bucket = $this->filterRequiredPackages($repo, $package, $bucket);
- }
- return $bucket;
- }
- public function appendPackages(array $packages, array $bucket)
- {
- foreach ($packages as $package) {
- $bucket[$package->getName()] = $package;
- }
- return $bucket;
- }
- }
- <?php
- namespace Composer\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class ProhibitsCommand extends BaseDependencyCommand
- {
- protected function configure()
- {
- parent::configure();
- $this
- ->setName('prohibits')
- ->setAliases(array('why-not'))
- ->setDescription('Shows which packages prevent the given package from being installed')
- ->setHelp(<<<EOT
- Displays detailed information about why a package cannot be installed.
- <info>php composer.phar prohibits composer/composer</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- return parent::doExecute($input, $output, true);
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Config\JsonConfigSource;
- use Composer\Installer;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Composer\Json\JsonFile;
- use Composer\Factory;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Output\OutputInterface;
- class RemoveCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('remove')
- ->setDescription('Removes a package from the require or require-dev')
- ->setDefinition(array(
- new InputArgument('packages', InputArgument::IS_ARRAY, 'Packages that should be removed.'),
- new InputOption('dev', null, InputOption::VALUE_NONE, 'Removes a package from the require-dev section.'),
- new InputOption('no-plugins', null, InputOption::VALUE_NONE, 'Disables all plugins.'),
- new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
- new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies.'),
- new InputOption('update-no-dev', null, InputOption::VALUE_NONE, 'Run the dependency update with the --no-dev option.'),
- new InputOption('update-with-dependencies', null, InputOption::VALUE_NONE, 'Allows inherited dependencies to be updated with explicit dependencies.'),
- new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'),
- new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump'),
- new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'),
- ))
- ->setHelp(<<<EOT
- The <info>remove</info> command removes a package from the current
- list of installed packages
- <info>php composer.phar remove</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $packages = $input->getArgument('packages');
- $file = Factory::getComposerFile();
- $jsonFile = new JsonFile($file);
- $composer = $jsonFile->read();
- $composerBackup = file_get_contents($jsonFile->getPath());
- $json = new JsonConfigSource($jsonFile);
- $type = $input->getOption('dev') ? 'require-dev' : 'require';
- $altType = !$input->getOption('dev') ? 'require-dev' : 'require';
- $io = $this->getIO();
- foreach ($packages as $package) {
- if (isset($composer[$type][$package])) {
- $json->removeLink($type, $package);
- } elseif (isset($composer[$altType][$package])) {
- $io->writeError('<warning>'.$package.' could not be found in '.$type.' but it is present in '.$altType.'</warning>');
- if ($io->isInteractive()) {
- if ($io->askConfirmation('Do you want to remove it from '.$altType.' [<comment>yes</comment>]? ', true)) {
- $json->removeLink($altType, $package);
- }
- }
- } else {
- $io->writeError('<warning>'.$package.' is not required in your composer.json and has not been removed</warning>');
- }
- }
- if ($input->getOption('no-update')) {
- return 0;
- }
- $composer = $this->getComposer(true, $input->getOption('no-plugins'));
- $composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'remove', $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $install = Installer::create($io, $composer);
- $updateDevMode = !$input->getOption('update-no-dev');
- $optimize = $input->getOption('optimize-autoloader') || $composer->getConfig()->get('optimize-autoloader');
- $authoritative = $input->getOption('classmap-authoritative') || $composer->getConfig()->get('classmap-authoritative');
- $install
- ->setVerbose($input->getOption('verbose'))
- ->setDevMode($updateDevMode)
- ->setOptimizeAutoloader($optimize)
- ->setClassMapAuthoritative($authoritative)
- ->setUpdate(true)
- ->setUpdateWhitelist($packages)
- ->setWhitelistDependencies($input->getOption('update-with-dependencies'))
- ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
- ;
- $status = $install->run();
- if ($status !== 0) {
- $io->writeError("\n".'<error>Removal failed, reverting '.$file.' to its original content.</error>');
- file_put_contents($jsonFile->getPath(), $composerBackup);
- }
- return $status;
- }
- }
- <?php
- namespace Composer\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- use Composer\Factory;
- use Composer\Installer;
- use Composer\Json\JsonFile;
- use Composer\Json\JsonManipulator;
- use Composer\Package\Version\VersionParser;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Composer\Repository\CompositeRepository;
- use Composer\Repository\PlatformRepository;
- class RequireCommand extends InitCommand
- {
- protected function configure()
- {
- $this
- ->setName('require')
- ->setDescription('Adds required packages to your composer.json and installs them')
- ->setDefinition(array(
- new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Required package name optionally including a version constraint, e.g. foo/bar or foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0"'),
- new InputOption('dev', null, InputOption::VALUE_NONE, 'Add requirement to require-dev.'),
- new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
- new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'),
- new InputOption('no-plugins', null, InputOption::VALUE_NONE, 'Disables all plugins.'),
- new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
- new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies.'),
- new InputOption('update-no-dev', null, InputOption::VALUE_NONE, 'Run the dependency update with the --no-dev option.'),
- new InputOption('update-with-dependencies', null, InputOption::VALUE_NONE, 'Allows inherited dependencies to be updated with explicit dependencies.'),
- new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'),
- new InputOption('sort-packages', null, InputOption::VALUE_NONE, 'Sorts packages when adding/updating a new dependency'),
- new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump'),
- new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'),
- ))
- ->setHelp(<<<EOT
- The require command adds required packages to your composer.json and installs them.
- If you do not specify a version constraint, composer will choose a suitable one based on the available package versions.
- If you do not want to install the new dependencies immediately you can call it with --no-update
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $file = Factory::getComposerFile();
- $io = $this->getIO();
- $newlyCreated = !file_exists($file);
- if (!file_exists($file) && !file_put_contents($file, "{\n}\n")) {
- $io->writeError('<error>'.$file.' could not be created.</error>');
- return 1;
- }
- if (!is_readable($file)) {
- $io->writeError('<error>'.$file.' is not readable.</error>');
- return 1;
- }
- if (!is_writable($file)) {
- $io->writeError('<error>'.$file.' is not writable.</error>');
- return 1;
- }
- if (filesize($file) === 0) {
- file_put_contents($file, "{\n}\n");
- }
- $json = new JsonFile($file);
- $composerDefinition = $json->read();
- $composerBackup = file_get_contents($json->getPath());
- $composer = $this->getComposer(true, $input->getOption('no-plugins'));
- $repos = $composer->getRepositoryManager()->getRepositories();
- $platformOverrides = $composer->getConfig()->get('platform') ?: array();
- $this->repos = new CompositeRepository(array_merge(
- array(new PlatformRepository(array(), $platformOverrides)),
- $repos
- ));
- $phpVersion = $this->repos->findPackage('php', '*')->getVersion();
- $requirements = $this->determineRequirements($input, $output, $input->getArgument('packages'), $phpVersion);
- $requireKey = $input->getOption('dev') ? 'require-dev' : 'require';
- $removeKey = $input->getOption('dev') ? 'require' : 'require-dev';
- $baseRequirements = array_key_exists($requireKey, $composerDefinition) ? $composerDefinition[$requireKey] : array();
- $requirements = $this->formatRequirements($requirements);
- $versionParser = new VersionParser();
- foreach ($requirements as $constraint) {
- $versionParser->parseConstraints($constraint);
- }
- $sortPackages = $input->getOption('sort-packages') || $composer->getConfig()->get('sort-packages');
- if (!$this->updateFileCleanly($json, $baseRequirements, $requirements, $requireKey, $removeKey, $sortPackages)) {
- foreach ($requirements as $package => $version) {
- $baseRequirements[$package] = $version;
- if (isset($composerDefinition[$removeKey][$package])) {
- unset($composerDefinition[$removeKey][$package]);
- }
- }
- $composerDefinition[$requireKey] = $baseRequirements;
- $json->write($composerDefinition);
- }
- $io->writeError('<info>'.$file.' has been '.($newlyCreated ? 'created' : 'updated').'</info>');
- if ($input->getOption('no-update')) {
- return 0;
- }
- $updateDevMode = !$input->getOption('update-no-dev');
- $optimize = $input->getOption('optimize-autoloader') || $composer->getConfig()->get('optimize-autoloader');
- $authoritative = $input->getOption('classmap-authoritative') || $composer->getConfig()->get('classmap-authoritative');
- $this->resetComposer();
- $composer = $this->getComposer(true, $input->getOption('no-plugins'));
- $composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'require', $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $install = Installer::create($io, $composer);
- $install
- ->setVerbose($input->getOption('verbose'))
- ->setPreferSource($input->getOption('prefer-source'))
- ->setPreferDist($input->getOption('prefer-dist'))
- ->setDevMode($updateDevMode)
- ->setOptimizeAutoloader($optimize)
- ->setClassMapAuthoritative($authoritative)
- ->setUpdate(true)
- ->setUpdateWhitelist(array_keys($requirements))
- ->setWhitelistDependencies($input->getOption('update-with-dependencies'))
- ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
- ;
- $status = $install->run();
- if ($status !== 0) {
- if ($newlyCreated) {
- $io->writeError("\n".'<error>Installation failed, deleting '.$file.'.</error>');
- unlink($json->getPath());
- } else {
- $io->writeError("\n".'<error>Installation failed, reverting '.$file.' to its original content.</error>');
- file_put_contents($json->getPath(), $composerBackup);
- }
- }
- return $status;
- }
- private function updateFileCleanly($json, array $base, array $new, $requireKey, $removeKey, $sortPackages)
- {
- $contents = file_get_contents($json->getPath());
- $manipulator = new JsonManipulator($contents);
- foreach ($new as $package => $constraint) {
- if (!$manipulator->addLink($requireKey, $package, $constraint, $sortPackages)) {
- return false;
- }
- if (!$manipulator->removeSubNode($removeKey, $package)) {
- return false;
- }
- }
- file_put_contents($json->getPath(), $manipulator->getContents());
- return true;
- }
- protected function interact(InputInterface $input, OutputInterface $output)
- {
- return;
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Script\CommandEvent;
- use Composer\Script\ScriptEvents;
- use Composer\Util\ProcessExecutor;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Output\OutputInterface;
- class RunScriptCommand extends BaseCommand
- {
- protected $scriptEvents = array(
- ScriptEvents::PRE_INSTALL_CMD,
- ScriptEvents::POST_INSTALL_CMD,
- ScriptEvents::PRE_UPDATE_CMD,
- ScriptEvents::POST_UPDATE_CMD,
- ScriptEvents::PRE_STATUS_CMD,
- ScriptEvents::POST_STATUS_CMD,
- ScriptEvents::POST_ROOT_PACKAGE_INSTALL,
- ScriptEvents::POST_CREATE_PROJECT_CMD,
- ScriptEvents::PRE_ARCHIVE_CMD,
- ScriptEvents::POST_ARCHIVE_CMD,
- ScriptEvents::PRE_AUTOLOAD_DUMP,
- ScriptEvents::POST_AUTOLOAD_DUMP,
- );
- protected function configure()
- {
- $this
- ->setName('run-script')
- ->setDescription('Run the scripts defined in composer.json.')
- ->setDefinition(array(
- new InputArgument('script', InputArgument::OPTIONAL, 'Script name to run.'),
- new InputArgument('args', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, ''),
- new InputOption('timeout', null, InputOption::VALUE_REQUIRED, 'Sets script timeout in seconds, or 0 for never.'),
- new InputOption('dev', null, InputOption::VALUE_NONE, 'Sets the dev mode.'),
- new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables the dev mode.'),
- new InputOption('list', 'l', InputOption::VALUE_NONE, 'List scripts.'),
- ))
- ->setHelp(<<<EOT
- The <info>run-script</info> command runs scripts defined in composer.json:
- <info>php composer.phar run-script post-update-cmd</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- if ($input->getOption('list')) {
- return $this->listScripts();
- } elseif (!$input->getArgument('script')) {
- throw new \RunTimeException('Missing required argument "script"');
- }
- $script = $input->getArgument('script');
- if (!in_array($script, $this->scriptEvents)) {
- if (defined('Composer\Script\ScriptEvents::'.str_replace('-', '_', strtoupper($script)))) {
- throw new \InvalidArgumentException(sprintf('Script "%s" cannot be run with this command', $script));
- }
- }
- $composer = $this->getComposer();
- $hasListeners = $composer->getEventDispatcher()->hasEventListeners(new CommandEvent($script, $composer, $this->getIO()));
- if (!$hasListeners) {
- throw new \InvalidArgumentException(sprintf('Script "%s" is not defined in this package', $script));
- }
- $args = $input->getArgument('args');
- if (!is_null($timeout = $input->getOption('timeout'))) {
- if (!ctype_digit($timeout)) {
- throw new \RuntimeException('Timeout value must be numeric and positive if defined, or 0 for forever');
- }
- ProcessExecutor::setTimeout((int)$timeout);
- }
- return $composer->getEventDispatcher()->dispatchScript($script, $input->getOption('dev') || !$input->getOption('no-dev'), $args);
- }
- protected function listScripts()
- {
- $scripts = $this->getComposer()->getPackage()->getScripts();
- if (!count($scripts)) {
- return 0;
- }
- $io = $this->getIO();
- $io->writeError('<info>scripts:</info>');
- foreach ($scripts as $name => $script) {
- $io->write(' ' . $name);
- }
- return 0;
- }
- }
- <?php
- namespace Composer\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Output\OutputInterface;
- class ScriptAliasCommand extends BaseCommand
- {
- private $script;
- public function __construct($script)
- {
- $this->script = $script;
- parent::__construct();
- }
- protected function configure()
- {
- $this
- ->setName($this->script)
- ->setDescription('Run the '.$this->script.' script as defined in composer.json.')
- ->setDefinition(array(
- new InputOption('dev', null, InputOption::VALUE_NONE, 'Sets the dev mode.'),
- new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables the dev mode.'),
- new InputArgument('args', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, ''),
- ))
- ->setHelp(<<<EOT
- The <info>run-script</info> command runs scripts defined in composer.json:
- <info>php composer.phar run-script post-update-cmd</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $composer = $this->getComposer();
- $args = $input->getArguments();
- return $composer->getEventDispatcher()->dispatchScript($this->script, $input->getOption('dev') || !$input->getOption('no-dev'), $args['args']);
- }
- }
- <?php
- namespace Composer\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- use Composer\Repository\CompositeRepository;
- use Composer\Repository\PlatformRepository;
- use Composer\Repository\RepositoryInterface;
- use Composer\Factory;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- class SearchCommand extends BaseCommand
- {
- protected $matches;
- protected $lowMatches = array();
- protected $tokens;
- protected $output;
- protected $onlyName;
- protected function configure()
- {
- $this
- ->setName('search')
- ->setDescription('Search for packages')
- ->setDefinition(array(
- new InputOption('only-name', 'N', InputOption::VALUE_NONE, 'Search only in name'),
- new InputArgument('tokens', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'tokens to search for'),
- ))
- ->setHelp(<<<EOT
- The search command searches for packages by its name
- <info>php composer.phar search symfony composer</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $platformRepo = new PlatformRepository;
- $io = $this->getIO();
- if ($composer = $this->getComposer(false)) {
- $localRepo = $composer->getRepositoryManager()->getLocalRepository();
- $installedRepo = new CompositeRepository(array($localRepo, $platformRepo));
- $repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories()));
- } else {
- $defaultRepos = Factory::createDefaultRepositories($io);
- $io->writeError('No composer.json found in the current directory, showing packages from ' . implode(', ', array_keys($defaultRepos)));
- $installedRepo = $platformRepo;
- $repos = new CompositeRepository(array_merge(array($installedRepo), $defaultRepos));
- }
- if ($composer) {
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'search', $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- }
- $onlyName = $input->getOption('only-name');
- $flags = $onlyName ? RepositoryInterface::SEARCH_NAME : RepositoryInterface::SEARCH_FULLTEXT;
- $results = $repos->search(implode(' ', $input->getArgument('tokens')), $flags);
- foreach ($results as $result) {
- $io->write($result['name'] . (isset($result['description']) ? ' '. $result['description'] : ''));
- }
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Composer;
- use Composer\Factory;
- use Composer\Config;
- use Composer\Util\Filesystem;
- use Composer\Util\Keys;
- use Composer\IO\IOInterface;
- use Composer\Downloader\FilesystemException;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Finder\Finder;
- class SelfUpdateCommand extends BaseCommand
- {
- const HOMEPAGE = 'getcomposer.org';
- const OLD_INSTALL_EXT = '-old.phar';
- protected function configure()
- {
- $this
- ->setName('self-update')
- ->setAliases(array('selfupdate'))
- ->setDescription('Updates composer.phar to the latest version.')
- ->setDefinition(array(
- new InputOption('rollback', 'r', InputOption::VALUE_NONE, 'Revert to an older installation of composer'),
- new InputOption('clean-backups', null, InputOption::VALUE_NONE, 'Delete old backups during an update. This makes the current version of composer the only backup available after the update'),
- new InputArgument('version', InputArgument::OPTIONAL, 'The version to update to'),
- new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
- new InputOption('update-keys', null, InputOption::VALUE_NONE, 'Prompt user for a key update'),
- ))
- ->setHelp(<<<EOT
- The <info>self-update</info> command checks getcomposer.org for newer
- versions of composer and if found, installs the latest.
- <info>php composer.phar self-update</info>
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $config = Factory::createConfig();
- if ($config->get('disable-tls') === true) {
- $baseUrl = 'http://' . self::HOMEPAGE;
- } else {
- $baseUrl = 'https://' . self::HOMEPAGE;
- }
- $io = $this->getIO();
- $remoteFilesystem = Factory::createRemoteFilesystem($io, $config);
- $cacheDir = $config->get('cache-dir');
- $rollbackDir = $config->get('data-dir');
- $home = $config->get('home');
- $localFilename = realpath($_SERVER['argv'][0]) ?: $_SERVER['argv'][0];
- if ($input->getOption('update-keys')) {
- return $this->fetchKeys($io, $config);
- }
- $tmpDir = is_writable(dirname($localFilename)) ? dirname($localFilename) : $cacheDir;
- if (!is_writable($tmpDir)) {
- throw new FilesystemException('Composer update failed: the "'.$tmpDir.'" directory used to download the temp file could not be written');
- }
- if ($input->getOption('rollback')) {
- return $this->rollback($output, $rollbackDir, $localFilename);
- }
- $latestVersion = trim($remoteFilesystem->getContents(self::HOMEPAGE, $baseUrl. '/version', false));
- $updateVersion = $input->getArgument('version') ?: $latestVersion;
- if (preg_match('{^[0-9a-f]{40}$}', $updateVersion) && $updateVersion !== $latestVersion) {
- $io->writeError('<error>You can not update to a specific SHA-1 as those phars are not available for download</error>');
- return 1;
- }
- if (Composer::VERSION === $updateVersion) {
- $io->writeError('<info>You are already using composer version '.$updateVersion.'.</info>');
- return 0;
- }
- $tempFilename = $tmpDir . '/' . basename($localFilename, '.phar').'-temp.phar';
- $backupFile = sprintf(
- '%s/%s-%s%s',
- $rollbackDir,
- strtr(Composer::RELEASE_DATE, ' :', '_-'),
- preg_replace('{^([0-9a-f]{7})[0-9a-f]{33}$}', '$1', Composer::VERSION),
- self::OLD_INSTALL_EXT
- );
- $updatingToTag = !preg_match('{^[0-9a-f]{40}$}', $updateVersion);
- $io->write(sprintf("Updating to version <info>%s</info>.", $updateVersion));
- $remoteFilename = $baseUrl . ($updatingToTag ? "/download/{$updateVersion}/composer.phar" : '/composer.phar');
- $signature = $remoteFilesystem->getContents(self::HOMEPAGE, $remoteFilename.'.sig', false);
- $remoteFilesystem->copy(self::HOMEPAGE, $remoteFilename, $tempFilename, !$input->getOption('no-progress'));
- if (!file_exists($tempFilename) || !$signature) {
- $io->writeError('<error>The download of the new composer version failed for an unexpected reason</error>');
- return 1;
- }
- if (!extension_loaded('openssl') && $config->get('disable-tls')) {
- $io->writeError('<warning>Skipping phar signature verification as you have disabled OpenSSL via config.disable-tls</warning>');
- } else {
- if (!extension_loaded('openssl')) {
- throw new \RuntimeException('The openssl extension is required for phar signatures to be verified but it is not available. '
- . 'If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the \'disable-tls\' option to true.');
- }
- $sigFile = 'file://'.$home.'/' . ($updatingToTag ? 'keys.tags.pub' : 'keys.dev.pub');
- if (!file_exists($sigFile)) {
- file_put_contents($home.'/keys.dev.pub', <<<DEVPUBKEY
- -----BEGIN PUBLIC KEY-----
- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnBDHjZS6e0ZMoK3xTD7f
- FNCzlXjX/Aie2dit8QXA03pSrOTbaMnxON3hUL47Lz3g1SC6YJEMVHr0zYq4elWi
- i3ecFEgzLcj+pZM5X6qWu2Ozz4vWx3JYo1/a/HYdOuW9e3lwS8VtS0AVJA+U8X0A
- hZnBmGpltHhO8hPKHgkJtkTUxCheTcbqn4wGHl8Z2SediDcPTLwqezWKUfrYzu1f
- o/j3WFwFs6GtK4wdYtiXr+yspBZHO3y1udf8eFFGcb2V3EaLOrtfur6XQVizjOuk
- 8lw5zzse1Qp/klHqbDRsjSzJ6iL6F4aynBc6Euqt/8ccNAIz0rLjLhOraeyj4eNn
- 8iokwMKiXpcrQLTKH+RH1JCuOVxQ436bJwbSsp1VwiqftPQieN+tzqy+EiHJJmGf
- TBAbWcncicCk9q2md+AmhNbvHO4PWbbz9TzC7HJb460jyWeuMEvw3gNIpEo2jYa9
- pMV6cVqnSa+wOc0D7pC9a6bne0bvLcm3S+w6I5iDB3lZsb3A9UtRiSP7aGSo7D72
- 8tC8+cIgZcI7k9vjvOqH+d7sdOU2yPCnRY6wFh62/g8bDnUpr56nZN1G89GwM4d4
- r/TU7BQQIzsZgAiqOGXvVklIgAMiV0iucgf3rNBLjjeNEwNSTTG9F0CtQ+7JLwaE
- wSEuAuRm+pRqi8BRnQ/GKUcCAwEAAQ==
- -----END PUBLIC KEY-----
- DEVPUBKEY
- );
- file_put_contents($home.'/keys.tags.pub', <<<TAGSPUBKEY
- -----BEGIN PUBLIC KEY-----
- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0Vi/2K6apCVj76nCnCl2
- MQUPdK+A9eqkYBacXo2wQBYmyVlXm2/n/ZsX6pCLYPQTHyr5jXbkQzBw8SKqPdlh
- vA7NpbMeNCz7wP/AobvUXM8xQuXKbMDTY2uZ4O7sM+PfGbptKPBGLe8Z8d2sUnTO
- bXtX6Lrj13wkRto7st/w/Yp33RHe9SlqkiiS4MsH1jBkcIkEHsRaveZzedUaxY0M
- mba0uPhGUInpPzEHwrYqBBEtWvP97t2vtfx8I5qv28kh0Y6t+jnjL1Urid2iuQZf
- noCMFIOu4vksK5HxJxxrN0GOmGmwVQjOOtxkwikNiotZGPR4KsVj8NnBrLX7oGuM
- nQvGciiu+KoC2r3HDBrpDeBVdOWxDzT5R4iI0KoLzFh2pKqwbY+obNPS2bj+2dgJ
- rV3V5Jjry42QOCBN3c88wU1PKftOLj2ECpewY6vnE478IipiEu7EAdK8Zwj2LmTr
- RKQUSa9k7ggBkYZWAeO/2Ag0ey3g2bg7eqk+sHEq5ynIXd5lhv6tC5PBdHlWipDK
- tl2IxiEnejnOmAzGVivE1YGduYBjN+mjxDVy8KGBrjnz1JPgAvgdwJ2dYw4Rsc/e
- TzCFWGk/HM6a4f0IzBWbJ5ot0PIi4amk07IotBXDWwqDiQTwyuGCym5EqWQ2BD95
- RGv89BPD+2DLnJysngsvVaUCAwEAAQ==
- -----END PUBLIC KEY-----
- TAGSPUBKEY
- );
- }
- $pubkeyid = openssl_pkey_get_public($sigFile);
- $algo = defined('OPENSSL_ALGO_SHA384') ? OPENSSL_ALGO_SHA384 : 'SHA384';
- if (!in_array('SHA384', openssl_get_md_methods())) {
- throw new \RuntimeException('SHA384 is not supported by your openssl extension, could not verify the phar file integrity');
- }
- $signature = json_decode($signature, true);
- $signature = base64_decode($signature['sha384']);
- $verified = 1 === openssl_verify(file_get_contents($tempFilename), $signature, $pubkeyid, $algo);
- openssl_free_key($pubkeyid);
- if (!$verified) {
- throw new \RuntimeException('The phar signature did not match the file you downloaded, this means your public keys are outdated or that the phar file is corrupt/has been modified');
- }
- }
- if ($input->getOption('clean-backups')) {
- $finder = $this->getOldInstallationFinder($rollbackDir);
- $fs = new Filesystem;
- foreach ($finder as $file) {
- $file = (string) $file;
- $io->writeError('<info>Removing: '.$file.'</info>');
- $fs->remove($file);
- }
- }
- if ($err = $this->setLocalPhar($localFilename, $tempFilename, $backupFile)) {
- $io->writeError('<error>The file is corrupted ('.$err->getMessage().').</error>');
- $io->writeError('<error>Please re-run the self-update command to try again.</error>');
- return 1;
- }
- if (file_exists($backupFile)) {
- $io->writeError('Use <info>composer self-update --rollback</info> to return to version '.Composer::VERSION);
- } else {
- $io->writeError('<warning>A backup of the current version could not be written to '.$backupFile.', no rollback possible</warning>');
- }
- }
- protected function fetchKeys(IOInterface $io, Config $config)
- {
- if (!$io->isInteractive()) {
- throw new \RuntimeException('Public keys can not be fetched in non-interactive mode, please run Composer interactively');
- }
- $io->write('Open <info>https://composer.github.io/pubkeys.html</info> to find the latest keys');
- $validator = function ($value) {
- if (!preg_match('{^-----BEGIN PUBLIC KEY-----$}', trim($value))) {
- throw new \UnexpectedValueException('Invalid input');
- }
- return trim($value)."\n";
- };
- $devKey = '';
- while (!preg_match('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $devKey, $match)) {
- $devKey = $io->askAndValidate('Enter Dev / Snapshot Public Key (including lines with -----): ', $validator);
- while ($line = $io->ask('')) {
- $devKey .= trim($line)."\n";
- if (trim($line) === '-----END PUBLIC KEY-----') {
- break;
- }
- }
- }
- file_put_contents($keyPath = $config->get('home').'/keys.dev.pub', $match[0]);
- $io->write('Stored key with fingerprint: ' . Keys::fingerprint($keyPath));
- $tagsKey = '';
- while (!preg_match('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $tagsKey, $match)) {
- $tagsKey = $io->askAndValidate('Enter Tags Public Key (including lines with -----): ', $validator);
- while ($line = $io->ask('')) {
- $tagsKey .= trim($line)."\n";
- if (trim($line) === '-----END PUBLIC KEY-----') {
- break;
- }
- }
- }
- file_put_contents($keyPath = $config->get('home').'/keys.tags.pub', $match[0]);
- $io->write('Stored key with fingerprint: ' . Keys::fingerprint($keyPath));
- $io->write('Public keys stored in '.$config->get('home'));
- }
- protected function rollback(OutputInterface $output, $rollbackDir, $localFilename)
- {
- $rollbackVersion = $this->getLastBackupVersion($rollbackDir);
- if (!$rollbackVersion) {
- throw new \UnexpectedValueException('Composer rollback failed: no installation to roll back to in "'.$rollbackDir.'"');
- }
- $old = $rollbackDir . '/' . $rollbackVersion . self::OLD_INSTALL_EXT;
- if (!is_file($old)) {
- throw new FilesystemException('Composer rollback failed: "'.$old.'" could not be found');
- }
- if (!is_readable($old)) {
- throw new FilesystemException('Composer rollback failed: "'.$old.'" could not be read');
- }
- $oldFile = $rollbackDir . "/{$rollbackVersion}" . self::OLD_INSTALL_EXT;
- $io = $this->getIO();
- $io->writeError(sprintf("Rolling back to version <info>%s</info>.", $rollbackVersion));
- if ($err = $this->setLocalPhar($localFilename, $oldFile)) {
- $io->writeError('<error>The backup file was corrupted ('.$err->getMessage().') and has been removed.</error>');
- return 1;
- }
- return 0;
- }
- protected function setLocalPhar($localFilename, $newFilename, $backupTarget = null)
- {
- try {
- @chmod($newFilename, fileperms($localFilename));
- if (!ini_get('phar.readonly')) {
- $phar = new \Phar($newFilename);
- unset($phar);
- }
- if ($backupTarget && file_exists($localFilename)) {
- @copy($localFilename, $backupTarget);
- }
- rename($newFilename, $localFilename);
- } catch (\Exception $e) {
- if ($backupTarget) {
- @unlink($newFilename);
- }
- if (!$e instanceof \UnexpectedValueException && !$e instanceof \PharException) {
- throw $e;
- }
- return $e;
- }
- }
- protected function getLastBackupVersion($rollbackDir)
- {
- $finder = $this->getOldInstallationFinder($rollbackDir);
- $finder->sortByName();
- $files = iterator_to_array($finder);
- if (count($files)) {
- return basename(end($files), self::OLD_INSTALL_EXT);
- }
- return false;
- }
- protected function getOldInstallationFinder($rollbackDir)
- {
- $finder = Finder::create()
- ->depth(0)
- ->files()
- ->name('*' . self::OLD_INSTALL_EXT)
- ->in($rollbackDir);
- return $finder;
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\DependencyResolver\Pool;
- use Composer\DependencyResolver\DefaultPolicy;
- use Composer\Factory;
- use Composer\Package\CompletePackageInterface;
- use Composer\Package\Version\VersionParser;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Composer\Package\PackageInterface;
- use Composer\Util\Platform;
- use Symfony\Component\Console\Formatter\OutputFormatterStyle;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- use Composer\Repository\ArrayRepository;
- use Composer\Repository\CompositeRepository;
- use Composer\Repository\ComposerRepository;
- use Composer\Repository\PlatformRepository;
- use Composer\Repository\RepositoryInterface;
- use Composer\Spdx\SpdxLicenses;
- class ShowCommand extends BaseCommand
- {
- protected $versionParser;
- protected $colors;
- protected function configure()
- {
- $this
- ->setName('show')
- ->setAliases(array('info'))
- ->setDescription('Show information about packages')
- ->setDefinition(array(
- new InputArgument('package', InputArgument::OPTIONAL, 'Package to inspect'),
- new InputArgument('version', InputArgument::OPTIONAL, 'Version or version constraint to inspect'),
- new InputOption('installed', 'i', InputOption::VALUE_NONE, 'List installed packages only'),
- new InputOption('platform', 'p', InputOption::VALUE_NONE, 'List platform packages only'),
- new InputOption('available', 'a', InputOption::VALUE_NONE, 'List available packages only'),
- new InputOption('self', 's', InputOption::VALUE_NONE, 'Show the root package information'),
- new InputOption('name-only', 'N', InputOption::VALUE_NONE, 'List package names only'),
- new InputOption('path', 'P', InputOption::VALUE_NONE, 'Show package paths'),
- new InputOption('tree', 't', InputOption::VALUE_NONE, 'List the dependencies as a tree'),
- ))
- ->setHelp(<<<EOT
- The show command displays detailed information about a package, or
- lists all packages available.
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $this->versionParser = new VersionParser;
- if ($input->getOption('tree')) {
- $this->initStyles($output);
- }
- $composer = $this->getComposer(false);
- $io = $this->getIO();
- if ($input->getOption('tree') && !$input->getOption('installed')) {
- $io->writeError('The --tree (-t) option is only usable in combination with --installed (-i) or by passing a single package name to show, assuming -i');
- $input->setOption('installed', true);
- }
- $platformOverrides = array();
- if ($composer) {
- $platformOverrides = $composer->getConfig()->get('platform') ?: array();
- }
- $platformRepo = new PlatformRepository(array(), $platformOverrides);
- if ($input->getOption('self')) {
- $package = $this->getComposer()->getPackage();
- $repos = $installedRepo = new ArrayRepository(array($package));
- } elseif ($input->getOption('platform')) {
- $repos = $installedRepo = $platformRepo;
- } elseif ($input->getOption('installed')) {
- $repos = $installedRepo = $this->getComposer()->getRepositoryManager()->getLocalRepository();
- } elseif ($input->getOption('available')) {
- $installedRepo = $platformRepo;
- if ($composer) {
- $repos = new CompositeRepository($composer->getRepositoryManager()->getRepositories());
- } else {
- $defaultRepos = Factory::createDefaultRepositories($io);
- $repos = new CompositeRepository($defaultRepos);
- $io->writeError('No composer.json found in the current directory, showing available packages from ' . implode(', ', array_keys($defaultRepos)));
- }
- } elseif ($composer) {
- $localRepo = $composer->getRepositoryManager()->getLocalRepository();
- $installedRepo = new CompositeRepository(array($localRepo, $platformRepo));
- $repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories()));
- } else {
- $defaultRepos = Factory::createDefaultRepositories($io);
- $io->writeError('No composer.json found in the current directory, showing available packages from ' . implode(', ', array_keys($defaultRepos)));
- $installedRepo = $platformRepo;
- $repos = new CompositeRepository(array_merge(array($installedRepo), $defaultRepos));
- }
- if ($composer) {
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'show', $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- }
- if ($input->getArgument('package') || !empty($package)) {
- $versions = array();
- if (empty($package)) {
- list($package, $versions) = $this->getPackage($installedRepo, $repos, $input->getArgument('package'), $input->getArgument('version'));
- if (!$package) {
- throw new \InvalidArgumentException('Package '.$input->getArgument('package').' not found');
- }
- } else {
- $versions = array($package->getPrettyVersion() => $package->getVersion());
- }
- if ($input->getOption('tree')) {
- $this->displayPackageTree($package, $installedRepo, $repos);
- } else {
- $this->printMeta($package, $versions, $installedRepo, $repos);
- $this->printLinks($package, 'requires');
- $this->printLinks($package, 'devRequires', 'requires (dev)');
- if ($package->getSuggests()) {
- $io->write("\n<info>suggests</info>");
- foreach ($package->getSuggests() as $suggested => $reason) {
- $io->write($suggested . ' <comment>' . $reason . '</comment>');
- }
- }
- $this->printLinks($package, 'provides');
- $this->printLinks($package, 'conflicts');
- $this->printLinks($package, 'replaces');
- }
- return;
- }
- if ($input->getOption('tree')) {
- $rootPackage = $this->getComposer()->getPackage();
- $rootRequires = array_map(
- 'strtolower',
- array_keys(array_merge($rootPackage->getRequires(), $rootPackage->getDevRequires()))
- );
- foreach ($installedRepo->getPackages() as $package) {
- if (in_array($package->getName(), $rootRequires, true)) {
- $this->displayPackageTree($package, $installedRepo, $repos);
- }
- }
- return 0;
- }
- if ($repos instanceof CompositeRepository) {
- $repos = $repos->getRepositories();
- } elseif (!is_array($repos)) {
- $repos = array($repos);
- }
- $packages = array();
- foreach ($repos as $repo) {
- if ($repo === $platformRepo) {
- $type = '<info>platform</info>:';
- } elseif (
- $repo === $installedRepo
- || ($installedRepo instanceof CompositeRepository && in_array($repo, $installedRepo->getRepositories(), true))
- ) {
- $type = '<info>installed</info>:';
- } else {
- $type = '<comment>available</comment>:';
- }
- if ($repo instanceof ComposerRepository && $repo->hasProviders()) {
- foreach ($repo->getProviderNames() as $name) {
- $packages[$type][$name] = $name;
- }
- } else {
- foreach ($repo->getPackages() as $package) {
- if (!isset($packages[$type][$package->getName()])
- || !is_object($packages[$type][$package->getName()])
- || version_compare($packages[$type][$package->getName()]->getVersion(), $package->getVersion(), '<')
- ) {
- $packages[$type][$package->getName()] = $package;
- }
- }
- }
- }
- $showAllTypes = !$input->getOption('platform') && !$input->getOption('installed') && !$input->getOption('available');
- $indent = $showAllTypes ? ' ' : '';
- foreach (array('<info>platform</info>:' => true, '<comment>available</comment>:' => false, '<info>installed</info>:' => true) as $type => $showVersion) {
- if (isset($packages[$type])) {
- if ($showAllTypes) {
- $io->write($type);
- }
- ksort($packages[$type]);
- $nameLength = $versionLength = 0;
- foreach ($packages[$type] as $package) {
- if (is_object($package)) {
- $nameLength = max($nameLength, strlen($package->getPrettyName()));
- $versionLength = max($versionLength, strlen($package->getFullPrettyVersion()));
- } else {
- $nameLength = max($nameLength, $package);
- }
- }
- list($width) = $this->getApplication()->getTerminalDimensions();
- if (null === $width) {
-
- $width = PHP_INT_MAX;
- }
- if (Platform::isWindows()) {
- $width--;
- }
- if ($input->getOption('path') && null === $composer) {
- $io->writeError('No composer.json found in the current directory, disabling "path" option');
- $input->setOption('path', false);
- }
- $writePath = !$input->getOption('name-only') && $input->getOption('path');
- $writeVersion = !$input->getOption('name-only') && !$input->getOption('path') && $showVersion && ($nameLength + $versionLength + 3 <= $width);
- $writeDescription = !$input->getOption('name-only') && !$input->getOption('path') && ($nameLength + ($showVersion ? $versionLength : 0) + 24 <= $width);
- foreach ($packages[$type] as $package) {
- if (is_object($package)) {
- $io->write($indent . str_pad($package->getPrettyName(), $nameLength, ' '), false);
- if ($writeVersion) {
- $io->write(' ' . str_pad($package->getFullPrettyVersion(), $versionLength, ' '), false);
- }
- if ($writeDescription) {
- $description = strtok($package->getDescription(), "\r\n");
- $remaining = $width - $nameLength - $versionLength - 4;
- if (strlen($description) > $remaining) {
- $description = substr($description, 0, $remaining - 3) . '...';
- }
- $io->write(' ' . $description, false);
- }
- if ($writePath) {
- $path = strtok(realpath($composer->getInstallationManager()->getInstallPath($package)), "\r\n");
- $io->write(' ' . $path, false);
- }
- } else {
- $io->write($indent . $package, false);
- }
- $io->write('');
- }
- if ($showAllTypes) {
- $io->write('');
- }
- }
- }
- }
- protected function getPackage(RepositoryInterface $installedRepo, RepositoryInterface $repos, $name, $version = null)
- {
- $name = strtolower($name);
- $constraint = null;
- if ($version) {
- $constraint = $this->versionParser->parseConstraints($version);
- }
- $policy = new DefaultPolicy();
- $pool = new Pool('dev');
- $pool->addRepository($repos);
- $matchedPackage = null;
- $versions = array();
- $matches = $pool->whatProvides($name, $constraint);
- foreach ($matches as $index => $package) {
- if ($package->getName() !== $name) {
- unset($matches[$index]);
- continue;
- }
- if (null === $version && $installedRepo->hasPackage($package)) {
- $matchedPackage = $package;
- }
- $versions[$package->getPrettyVersion()] = $package->getVersion();
- $matches[$index] = $package->getId();
- }
- if (!$matchedPackage && $matches && $preferred = $policy->selectPreferredPackages($pool, array(), $matches)) {
- $matchedPackage = $pool->literalToPackage($preferred[0]);
- }
- return array($matchedPackage, $versions);
- }
- protected function printMeta(CompletePackageInterface $package, array $versions, RepositoryInterface $installedRepo)
- {
- $io = $this->getIO();
- $io->write('<info>name</info> : ' . $package->getPrettyName());
- $io->write('<info>descrip.</info> : ' . $package->getDescription());
- $io->write('<info>keywords</info> : ' . join(', ', $package->getKeywords() ?: array()));
- $this->printVersions($package, $versions, $installedRepo);
- $io->write('<info>type</info> : ' . $package->getType());
- $this->printLicenses($package);
- $io->write('<info>source</info> : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getSourceType(), $package->getSourceUrl(), $package->getSourceReference()));
- $io->write('<info>dist</info> : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getDistType(), $package->getDistUrl(), $package->getDistReference()));
- $io->write('<info>names</info> : ' . implode(', ', $package->getNames()));
- if ($package->isAbandoned()) {
- $replacement = ($package->getReplacementPackage() !== null)
- ? ' The author suggests using the ' . $package->getReplacementPackage(). ' package instead.'
- : null;
- $io->writeError(
- sprintf('<warning>Attention: This package is abandoned and no longer maintained.%s</warning>', $replacement)
- );
- }
- if ($package->getSupport()) {
- $io->write("\n<info>support</info>");
- foreach ($package->getSupport() as $type => $value) {
- $io->write('<comment>' . $type . '</comment> : '.$value);
- }
- }
- if ($package->getAutoload()) {
- $io->write("\n<info>autoload</info>");
- foreach ($package->getAutoload() as $type => $autoloads) {
- $io->write('<comment>' . $type . '</comment>');
- if ($type === 'psr-0') {
- foreach ($autoloads as $name => $path) {
- $io->write(($name ?: '*') . ' => ' . (is_array($path) ? implode(', ', $path) : ($path ?: '.')));
- }
- } elseif ($type === 'psr-4') {
- foreach ($autoloads as $name => $path) {
- $io->write(($name ?: '*') . ' => ' . (is_array($path) ? implode(', ', $path) : ($path ?: '.')));
- }
- } elseif ($type === 'classmap') {
- $io->write(implode(', ', $autoloads));
- }
- }
- if ($package->getIncludePaths()) {
- $io->write('<comment>include-path</comment>');
- $io->write(implode(', ', $package->getIncludePaths()));
- }
- }
- }
- protected function printVersions(CompletePackageInterface $package, array $versions, RepositoryInterface $installedRepo)
- {
- uasort($versions, 'version_compare');
- $versions = array_keys(array_reverse($versions));
- if ($installedRepo->hasPackage($package)) {
- $installedVersion = $package->getPrettyVersion();
- $key = array_search($installedVersion, $versions);
- if (false !== $key) {
- $versions[$key] = '<info>* ' . $installedVersion . '</info>';
- }
- }
- $versions = implode(', ', $versions);
- $this->getIO()->write('<info>versions</info> : ' . $versions);
- }
- protected function printLinks(CompletePackageInterface $package, $linkType, $title = null)
- {
- $title = $title ?: $linkType;
- $io = $this->getIO();
- if ($links = $package->{'get'.ucfirst($linkType)}()) {
- $io->write("\n<info>" . $title . "</info>");
- foreach ($links as $link) {
- $io->write($link->getTarget() . ' <comment>' . $link->getPrettyConstraint() . '</comment>');
- }
- }
- }
- protected function printLicenses(CompletePackageInterface $package)
- {
- $spdxLicenses = new SpdxLicenses();
- $licenses = $package->getLicense();
- $io = $this->getIO();
- foreach ($licenses as $licenseId) {
- $license = $spdxLicenses->getLicenseByIdentifier($licenseId);
- if (!$license) {
- $out = $licenseId;
- } else {
- if ($license[1] === true) {
- $out = sprintf('%s (%s) (OSI approved) %s', $license[0], $licenseId, $license[2]);
- } else {
- $out = sprintf('%s (%s) %s', $license[0], $licenseId, $license[2]);
- }
- }
- $io->write('<info>license</info> : ' . $out);
- }
- }
- protected function initStyles(OutputInterface $output)
- {
- $this->colors = array(
- 'green',
- 'yellow',
- 'cyan',
- 'magenta',
- 'blue',
- );
- foreach ($this->colors as $color) {
- $style = new OutputFormatterStyle($color);
- $output->getFormatter()->setStyle($color, $style);
- }
- }
- protected function displayPackageTree(PackageInterface $package, RepositoryInterface $installedRepo, RepositoryInterface $distantRepos)
- {
- $packagesInTree = array();
- $packagesInTree[] = $package;
- $io = $this->getIO();
- $io->write(sprintf('<info>%s</info>', $package->getPrettyName()), false);
- $io->write(' ' . $package->getPrettyVersion(), false);
- $io->write(' ' . strtok($package->getDescription(), "\r\n"));
- if (is_object($package)) {
- $requires = $package->getRequires();
- $treeBar = '├';
- $j = 0;
- $total = count($requires);
- foreach ($requires as $requireName => $require) {
- $j++;
- if ($j == 0) {
- $this->writeTreeLine($treeBar);
- }
- if ($j == $total) {
- $treeBar = 'â””';
- }
- $level = 1;
- $color = $this->colors[$level];
- $info = sprintf('%s──<%s>%s</%s> %s', $treeBar, $color, $requireName, $color, $require->getPrettyConstraint());
- $this->writeTreeLine($info);
- $treeBar = str_replace('â””', ' ', $treeBar);
- $packagesInTree[] = $requireName;
- $this->displayTree($requireName, $require, $installedRepo, $distantRepos, $packagesInTree, $treeBar, $level + 1);
- }
- }
- }
- protected function displayTree($name, $package, RepositoryInterface $installedRepo, RepositoryInterface $distantRepos, array $packagesInTree, $previousTreeBar = '├', $level = 1)
- {
- $previousTreeBar = str_replace('├', '│', $previousTreeBar);
- list($package, $versions) = $this->getPackage($installedRepo, $distantRepos, $name, $package->getPrettyConstraint() === 'self.version' ? $package->getConstraint() : $package->getPrettyConstraint());
- if (is_object($package)) {
- $requires = $package->getRequires();
- $treeBar = $previousTreeBar . ' ├';
- $i = 0;
- $total = count($requires);
- foreach ($requires as $requireName => $require) {
- $i++;
- if ($i == $total) {
- $treeBar = $previousTreeBar . ' â””';
- }
- $colorIdent = $level % count($this->colors);
- $color = $this->colors[$colorIdent];
- $info = sprintf('%s──<%s>%s</%s> %s', $treeBar, $color, $requireName, $color, $require->getPrettyConstraint());
- $this->writeTreeLine($info);
- $treeBar = str_replace('â””', ' ', $treeBar);
- if (!in_array($requireName, $packagesInTree)) {
- $packagesInTree[] = $requireName;
- $this->displayTree($requireName, $require, $installedRepo, $distantRepos, $packagesInTree, $treeBar, $level + 1);
- }
- }
- }
- }
- private function writeTreeLine($line)
- {
- $io = $this->getIO();
- if (!$io->isDecorated()) {
- $line = str_replace(array('└', '├', '──', '│'), array('`-', '|-', '-', '|'), $line);
- }
- $io->write($line);
- }
- }
- <?php
- namespace Composer\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- use Composer\Downloader\ChangeReportInterface;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Composer\Script\ScriptEvents;
- class StatusCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('status')
- ->setDescription('Show a list of locally modified packages')
- ->setDefinition(array(
- new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Show modified files for each directory that contains changes.'),
- ))
- ->setHelp(<<<EOT
- The status command displays a list of dependencies that have
- been modified locally.
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $composer = $this->getComposer();
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'status', $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $installedRepo = $composer->getRepositoryManager()->getLocalRepository();
- $dm = $composer->getDownloadManager();
- $im = $composer->getInstallationManager();
- $composer->getEventDispatcher()->dispatchScript(ScriptEvents::PRE_STATUS_CMD, true);
- $errors = array();
- $io = $this->getIO();
- foreach ($installedRepo->getPackages() as $package) {
- $downloader = $dm->getDownloaderForInstalledPackage($package);
- if ($downloader instanceof ChangeReportInterface) {
- $targetDir = $im->getInstallPath($package);
- if (is_link($targetDir)) {
- $errors[$targetDir] = $targetDir . ' is a symbolic link.';
- }
- if ($changes = $downloader->getLocalChanges($package, $targetDir)) {
- $errors[$targetDir] = $changes;
- }
- }
- }
- if (!$errors) {
- $io->writeError('<info>No local changes</info>');
- } else {
- $io->writeError('<error>You have changes in the following dependencies:</error>');
- }
- foreach ($errors as $path => $changes) {
- if ($input->getOption('verbose')) {
- $indentedChanges = implode("\n", array_map(function ($line) {
- return ' ' . ltrim($line);
- }, explode("\n", $changes)));
- $io->write('<info>'.$path.'</info>:');
- $io->write($indentedChanges);
- } else {
- $io->write($path);
- }
- }
- if ($errors && !$input->getOption('verbose')) {
- $io->writeError('Use --verbose (-v) to see modified files');
- }
- $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_STATUS_CMD, true);
- return $errors ? 1 : 0;
- }
- }
- <?php
- namespace Composer\Command;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- class SuggestsCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('suggests')
- ->setDescription('Show package suggestions')
- ->setDefinition(array(
- new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Exclude suggestions from require-dev packages'),
- new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Packages that you want to list suggestions from.'),
- ))
- ->setHelp(<<<EOT
- The <info>%command.name%</info> command shows suggested packages.
- With <info>-v</info> you also see which package suggested it and why.
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $lock = $this->getComposer()->getLocker()->getLockData();
- if (empty($lock)) {
- throw new \RuntimeException('Lockfile seems to be empty?');
- }
- $packages = $lock['packages'];
- if (!$input->getOption('no-dev')) {
- $packages += $lock['packages-dev'];
- }
- $filter = $input->getArgument('packages');
- foreach ($packages as $package) {
- if (empty($package['suggest'])) {
- continue;
- }
- if (!empty($filter) && !in_array($package['name'], $filter)) {
- continue;
- }
- $this->printSuggestions($packages, $package['name'], $package['suggest']);
- }
- }
- protected function printSuggestions($installed, $source, $suggestions)
- {
- foreach ($suggestions as $suggestion => $reason) {
- foreach ($installed as $package) {
- if ($package['name'] === $suggestion) {
- continue 2;
- }
- }
- if (empty($reason)) {
- $reason = '*';
- }
- $this->printSuggestion($source, $suggestion, $reason);
- }
- }
- protected function printSuggestion($package, $suggestion, $reason)
- {
- $io = $this->getIO();
- if ($io->isVerbose()) {
- $io->write(sprintf('<comment>%s</comment> suggests <info>%s</info>: %s', $package, $suggestion, $reason));
- } else {
- $io->write(sprintf('<info>%s</info>', $suggestion));
- }
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Composer;
- use Composer\Installer;
- use Composer\IO\IOInterface;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Symfony\Component\Console\Helper\Table;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Question\Question;
- class UpdateCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('update')
- ->setDescription('Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file.')
- ->setDefinition(array(
- new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Packages that should be updated, if not provided all packages are.'),
- new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
- new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'),
- new InputOption('dry-run', null, InputOption::VALUE_NONE, 'Outputs the operations but will not execute anything (implicitly enables --verbose).'),
- new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables installation of require-dev packages (enabled by default, only present for BC).'),
- new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'),
- new InputOption('lock', null, InputOption::VALUE_NONE, 'Only updates the lock file hash to suppress warning about the lock file being out of date.'),
- new InputOption('no-plugins', null, InputOption::VALUE_NONE, 'Disables all plugins.'),
- new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'DEPRECATED: Use no-plugins instead.'),
- new InputOption('no-autoloader', null, InputOption::VALUE_NONE, 'Skips autoloader generation'),
- new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
- new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
- new InputOption('with-dependencies', null, InputOption::VALUE_NONE, 'Add also all dependencies of whitelisted packages to the whitelist.'),
- new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'),
- new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump.'),
- new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'),
- new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'),
- new InputOption('prefer-stable', null, InputOption::VALUE_NONE, 'Prefer stable versions of dependencies.'),
- new InputOption('prefer-lowest', null, InputOption::VALUE_NONE, 'Prefer lowest versions of dependencies.'),
- new InputOption('interactive', 'i', InputOption::VALUE_NONE, 'Interactive interface with autocompletion to select the packages to update.'),
- ))
- ->setHelp(<<<EOT
- The <info>update</info> command reads the composer.json file from the
- current directory, processes it, and updates, removes or installs all the
- dependencies.
- <info>php composer.phar update</info>
- To limit the update operation to a few packages, you can list the package(s)
- you want to update as such:
- <info>php composer.phar update vendor/package1 foo/mypackage [...]</info>
- You may also use an asterisk (*) pattern to limit the update operation to package(s)
- from a specific vendor:
- <info>php composer.phar update vendor/package1 foo/* [...]</info>
- To select packages names interactively with auto-completion use <info>-i</info>.
- EOT
- )
- ;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $io = $this->getIO();
- if ($input->getOption('no-custom-installers')) {
- $io->writeError('<warning>You are using the deprecated option "no-custom-installers". Use "no-plugins" instead.</warning>');
- $input->setOption('no-plugins', true);
- }
- if ($input->getOption('dev')) {
- $io->writeError('<warning>You are using the deprecated option "dev". Dev packages are installed by default now.</warning>');
- }
- $composer = $this->getComposer(true, $input->getOption('no-plugins'));
- $packages = $input->getArgument('packages');
- if ($input->getOption('interactive')) {
- $packages = $this->getPackagesInteractively($io, $input, $output, $composer, $packages);
- }
- $composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'update', $input, $output);
- $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $install = Installer::create($io, $composer);
- $preferSource = false;
- $preferDist = false;
- $config = $composer->getConfig();
- switch ($config->get('preferred-install')) {
- case 'source':
- $preferSource = true;
- break;
- case 'dist':
- $preferDist = true;
- break;
- case 'auto':
- default:
- break;
- }
- if ($input->getOption('prefer-source') || $input->getOption('prefer-dist')) {
- $preferSource = $input->getOption('prefer-source');
- $preferDist = $input->getOption('prefer-dist');
- }
- $optimize = $input->getOption('optimize-autoloader') || $config->get('optimize-autoloader');
- $authoritative = $input->getOption('classmap-authoritative') || $config->get('classmap-authoritative');
- $install
- ->setDryRun($input->getOption('dry-run'))
- ->setVerbose($input->getOption('verbose'))
- ->setPreferSource($preferSource)
- ->setPreferDist($preferDist)
- ->setDevMode(!$input->getOption('no-dev'))
- ->setDumpAutoloader(!$input->getOption('no-autoloader'))
- ->setRunScripts(!$input->getOption('no-scripts'))
- ->setOptimizeAutoloader($optimize)
- ->setClassMapAuthoritative($authoritative)
- ->setUpdate(true)
- ->setUpdateWhitelist($input->getOption('lock') ? array('lock') : $packages)
- ->setWhitelistDependencies($input->getOption('with-dependencies'))
- ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
- ->setPreferStable($input->getOption('prefer-stable'))
- ->setPreferLowest($input->getOption('prefer-lowest'))
- ;
- if ($input->getOption('no-plugins')) {
- $install->disablePlugins();
- }
- return $install->run();
- }
- private function getPackagesInteractively(IOInterface $io, InputInterface $input, OutputInterface $output, Composer $composer, array $packages)
- {
- if (!$input->isInteractive()) {
- throw new \InvalidArgumentException('--interactive cannot be used in non-interactive terminals.');
- }
- $requires = array_merge(
- $composer->getPackage()->getRequires(),
- $composer->getPackage()->getDevRequires()
- );
- $autocompleterValues = array();
- foreach ($requires as $require) {
- $autocompleterValues[strtolower($require->getTarget())] = $require->getTarget();
- }
- $installedPackages = $composer->getRepositoryManager()->getLocalRepository()->getPackages();
- foreach ($installedPackages as $package) {
- $autocompleterValues[$package->getName()] = $package->getPrettyName();
- }
- $helper = $this->getHelper('question');
- $question = new Question('<comment>Enter package name: </comment>', null);
- $io->writeError('<info>Press enter without value to end submission</info>');
- do {
- $autocompleterValues = array_diff($autocompleterValues, $packages);
- $question->setAutocompleterValues($autocompleterValues);
- $addedPackage = $helper->ask($input, $output, $question);
- if (!is_string($addedPackage) || empty($addedPackage)) {
- break;
- }
- $addedPackage = strtolower($addedPackage);
- if (!in_array($addedPackage, $packages)) {
- $packages[] = $addedPackage;
- }
- } while (true);
- $packages = array_filter($packages);
- if (!$packages) {
- throw new \InvalidArgumentException('You must enter minimum one package.');
- }
- $table = new Table($output);
- $table->setHeaders(array('Selected packages'));
- foreach ($packages as $package) {
- $table->addRow(array($package));
- }
- $table->render();
- if ($io->askConfirmation(sprintf(
- 'Would you like to continue and update the above package%s [<comment>yes</comment>]? ',
- 1 === count($packages) ? '' : 's'
- ), true)) {
- return $packages;
- }
- throw new \RuntimeException('Installation aborted.');
- }
- }
- <?php
- namespace Composer\Command;
- use Composer\Factory;
- use Composer\Package\Loader\ValidatingArrayLoader;
- use Composer\Plugin\CommandEvent;
- use Composer\Plugin\PluginEvents;
- use Composer\Script\ScriptEvents;
- use Composer\Util\ConfigValidator;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- class ValidateCommand extends BaseCommand
- {
- protected function configure()
- {
- $this
- ->setName('validate')
- ->setDescription('Validates a composer.json and composer.lock')
- ->setDefinition(array(
- new InputOption('no-check-all', null, InputOption::VALUE_NONE, 'Do not make a complete validation'),
- new InputOption('no-check-lock', null, InputOption::VALUE_NONE, 'Do not check if lock file is up to date'),
- new InputOption('no-check-publish', null, InputOption::VALUE_NONE, 'Do not check for publish errors'),
- new InputOption('with-dependencies', 'A', InputOption::VALUE_NONE, 'Also validate the composer.json of all installed dependencies'),
- new InputOption('strict', null, InputOption::VALUE_NONE, 'Return a non-zero exit code for warnings as well as errors'),
- new InputArgument('file', InputArgument::OPTIONAL, 'path to composer.json file', './composer.json'),
- ))
- ->setHelp(<<<EOT
- The validate command validates a given composer.json and composer.lock
- Exit codes in case of errors are:
- 1 validation warning(s), only when --strict is given
- 2 validation error(s)
- 3 file unreadable or missing
- EOT
- );
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $file = $input->getArgument('file');
- $io = $this->getIO();
- if (!file_exists($file)) {
- $io->writeError('<error>' . $file . ' not found.</error>');
- return 3;
- }
- if (!is_readable($file)) {
- $io->writeError('<error>' . $file . ' is not readable.</error>');
- return 3;
- }
- $validator = new ConfigValidator($io);
- $checkAll = $input->getOption('no-check-all') ? 0 : ValidatingArrayLoader::CHECK_ALL;
- $checkPublish = !$input->getOption('no-check-publish');
- $checkLock = !$input->getOption('no-check-lock');
- $isStrict = $input->getOption('strict');
- list($errors, $publishErrors, $warnings) = $validator->validate($file, $checkAll);
- $lockErrors = array();
- $composer = Factory::create($io, $file);
- $locker = $composer->getLocker();
- if ($locker->isLocked() && !$locker->isFresh()) {
- $lockErrors[] = 'The lock file is not up to date with the latest changes in composer.json, it is recommended that you run `composer update`.';
- }
- $this->outputResult($io, $file, $errors, $warnings, $checkPublish, $publishErrors, $checkLock, $lockErrors, true);
- $exitCode = $errors || ($publishErrors && $checkPublish) || ($lockErrors && $checkLock) ? 2 : ($isStrict && $warnings ? 1 : 0);
- if ($input->getOption('with-dependencies')) {
- $localRepo = $composer->getRepositoryManager()->getLocalRepository();
- foreach ($localRepo->getPackages() as $package) {
- $path = $composer->getInstallationManager()->getInstallPath($package);
- $file = $path . '/composer.json';
- if (is_dir($path) && file_exists($file)) {
- list($errors, $publishErrors, $warnings) = $validator->validate($file, $checkAll);
- $this->outputResult($io, $package->getPrettyName(), $errors, $warnings, $checkPublish, $publishErrors);
- $depCode = $errors || ($publishErrors && $checkPublish) ? 2 : ($isStrict && $warnings ? 1 : 0);
- $exitCode = max($depCode, $exitCode);
- }
- }
- }
- $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'validate', $input, $output);
- $eventCode = $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $exitCode = max($eventCode, $exitCode);
- return $exitCode;
- }
- private function outputResult($io, $name, &$errors, &$warnings, $checkPublish = false, $publishErrors = array(), $checkLock = false, $lockErrors = array(), $printSchemaUrl = false)
- {
- if (!$errors && !$publishErrors && !$warnings) {
- $io->write('<info>' . $name . ' is valid</info>');
- } elseif (!$errors && !$publishErrors) {
- $io->writeError('<info>' . $name . ' is valid, but with a few warnings</info>');
- if ($printSchemaUrl) {
- $io->writeError('<warning>See https://getcomposer.org/doc/04-schema.md for details on the schema</warning>');
- }
- } elseif (!$errors) {
- $io->writeError('<info>' . $name . ' is valid for simple usage with composer but has</info>');
- $io->writeError('<info>strict errors that make it unable to be published as a package:</info>');
- if ($printSchemaUrl) {
- $io->writeError('<warning>See https://getcomposer.org/doc/04-schema.md for details on the schema</warning>');
- }
- } else {
- $io->writeError('<error>' . $name . ' is invalid, the following errors/warnings were found:</error>');
- }
- if ($checkPublish) {
- $errors = array_merge($errors, $publishErrors);
- } else {
- $warnings = array_merge($warnings, $publishErrors);
- }
- if ($checkLock) {
- $errors = array_merge($errors, $lockErrors);
- } else {
- $warnings = array_merge($warnings, $lockErrors);
- }
- $messages = array(
- 'error' => $errors,
- 'warning' => $warnings,
- );
- foreach ($messages as $style => $msgs) {
- foreach ($msgs as $msg) {
- $io->writeError('<' . $style . '>' . $msg . '</' . $style . '>');
- }
- }
- }
- }
- <?php
- namespace Composer;
- use Composer\Package\RootPackageInterface;
- use Composer\Package\Locker;
- use Composer\Repository\RepositoryManager;
- use Composer\Installer\InstallationManager;
- use Composer\Plugin\PluginManager;
- use Composer\Downloader\DownloadManager;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Autoload\AutoloadGenerator;
- class Composer
- {
- const VERSION = 'dc2f201152f37c2563e328531a6af349ac287cce';
- const BRANCH_ALIAS_VERSION = '1.0-dev';
- const RELEASE_DATE = '2016-02-24 19:54:01';
- private $package;
- private $locker;
- private $repositoryManager;
- private $downloadManager;
- private $installationManager;
- private $pluginManager;
- private $config;
- private $eventDispatcher;
- private $autoloadGenerator;
- public function setPackage(RootPackageInterface $package)
- {
- $this->package = $package;
- }
- public function getPackage()
- {
- return $this->package;
- }
- public function setConfig(Config $config)
- {
- $this->config = $config;
- }
- public function getConfig()
- {
- return $this->config;
- }
- public function setLocker(Locker $locker)
- {
- $this->locker = $locker;
- }
- public function getLocker()
- {
- return $this->locker;
- }
- public function setRepositoryManager(RepositoryManager $manager)
- {
- $this->repositoryManager = $manager;
- }
- public function getRepositoryManager()
- {
- return $this->repositoryManager;
- }
- public function setDownloadManager(DownloadManager $manager)
- {
- $this->downloadManager = $manager;
- }
- public function getDownloadManager()
- {
- return $this->downloadManager;
- }
- public function setInstallationManager(InstallationManager $manager)
- {
- $this->installationManager = $manager;
- }
- public function getInstallationManager()
- {
- return $this->installationManager;
- }
- public function setPluginManager(PluginManager $manager)
- {
- $this->pluginManager = $manager;
- }
- public function getPluginManager()
- {
- return $this->pluginManager;
- }
- public function setEventDispatcher(EventDispatcher $eventDispatcher)
- {
- $this->eventDispatcher = $eventDispatcher;
- }
- public function getEventDispatcher()
- {
- return $this->eventDispatcher;
- }
- public function setAutoloadGenerator(AutoloadGenerator $autoloadGenerator)
- {
- $this->autoloadGenerator = $autoloadGenerator;
- }
- public function getAutoloadGenerator()
- {
- return $this->autoloadGenerator;
- }
- }
- <?php
- namespace Composer;
- use Composer\Config\ConfigSourceInterface;
- class Config
- {
- const RELATIVE_PATHS = 1;
- public static $defaultConfig = array(
- 'process-timeout' => 300,
- 'use-include-path' => false,
- 'preferred-install' => 'auto',
- 'notify-on-install' => true,
- 'github-protocols' => array('git', 'https', 'ssh'),
- 'vendor-dir' => 'vendor',
- 'bin-dir' => '{$vendor-dir}/bin',
- 'cache-dir' => '{$home}/cache',
- 'data-dir' => '{$home}',
- 'cache-files-dir' => '{$cache-dir}/files',
- 'cache-repo-dir' => '{$cache-dir}/repo',
- 'cache-vcs-dir' => '{$cache-dir}/vcs',
- 'cache-ttl' => 15552000,
- 'cache-files-ttl' => null,
- 'cache-files-maxsize' => '300MiB',
- 'bin-compat' => 'auto',
- 'discard-changes' => false,
- 'autoloader-suffix' => null,
- 'sort-packages' => false,
- 'optimize-autoloader' => false,
- 'classmap-authoritative' => false,
- 'prepend-autoloader' => true,
- 'github-domains' => array('github.com'),
- 'disable-tls' => false,
- 'cafile' => null,
- 'capath' => null,
- 'github-expose-hostname' => true,
- 'gitlab-domains' => array('gitlab.com'),
- 'store-auths' => 'prompt',
- 'platform' => array(),
- 'archive-format' => 'tar',
- 'archive-dir' => '.',
-
-
-
- );
- public static $defaultRepositories = array(
- 'packagist' => array(
- 'type' => 'composer',
- 'url' => 'https?://packagist.org',
- 'allow_ssl_downgrade' => true,
- ),
- );
- private $config;
- private $baseDir;
- private $repositories;
- private $configSource;
- private $authConfigSource;
- private $useEnvironment;
- public function __construct($useEnvironment = true, $baseDir = null)
- {
- $this->config = static::$defaultConfig;
- $this->repositories = static::$defaultRepositories;
- $this->useEnvironment = (bool) $useEnvironment;
- $this->baseDir = $baseDir;
- }
- public function setConfigSource(ConfigSourceInterface $source)
- {
- $this->configSource = $source;
- }
- public function getConfigSource()
- {
- return $this->configSource;
- }
- public function setAuthConfigSource(ConfigSourceInterface $source)
- {
- $this->authConfigSource = $source;
- }
- public function getAuthConfigSource()
- {
- return $this->authConfigSource;
- }
- public function merge($config)
- {
- if (!empty($config['config']) && is_array($config['config'])) {
- foreach ($config['config'] as $key => $val) {
- if (in_array($key, array('github-oauth', 'gitlab-oauth', 'http-basic')) && isset($this->config[$key])) {
- $this->config[$key] = array_merge($this->config[$key], $val);
- } else {
- $this->config[$key] = $val;
- }
- }
- }
- if (!empty($config['repositories']) && is_array($config['repositories'])) {
- $this->repositories = array_reverse($this->repositories, true);
- $newRepos = array_reverse($config['repositories'], true);
- foreach ($newRepos as $name => $repository) {
- if (false === $repository) {
- unset($this->repositories[$name]);
- continue;
- }
- if (is_array($repository) && 1 === count($repository) && false === current($repository)) {
- unset($this->repositories[key($repository)]);
- continue;
- }
- if (is_int($name)) {
- $this->repositories[] = $repository;
- } else {
- $this->repositories[$name] = $repository;
- }
- }
- $this->repositories = array_reverse($this->repositories, true);
- }
- }
- public function getRepositories()
- {
- return $this->repositories;
- }
- public function get($key, $flags = 0)
- {
- switch ($key) {
- case 'vendor-dir':
- case 'bin-dir':
- case 'process-timeout':
- case 'data-dir':
- case 'cache-dir':
- case 'cache-files-dir':
- case 'cache-repo-dir':
- case 'cache-vcs-dir':
- case 'cafile':
- case 'capath':
- $env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_'));
- $val = rtrim($this->process($this->getComposerEnv($env) ?: $this->config[$key], $flags), '/\\');
- $val = preg_replace('#^(\$HOME|~)(/|$)#', rtrim(getenv('HOME') ?: getenv('USERPROFILE'), '/\\') . '/', $val);
- if (substr($key, -4) !== '-dir') {
- return $val;
- }
- return (($flags & self::RELATIVE_PATHS) == self::RELATIVE_PATHS) ? $val : $this->realpath($val);
- case 'cache-ttl':
- return (int) $this->config[$key];
- case 'cache-files-maxsize':
- if (!preg_match('/^\s*([0-9.]+)\s*(?:([kmg])(?:i?b)?)?\s*$/i', $this->config[$key], $matches)) {
- throw new \RuntimeException(
- "Could not parse the value of 'cache-files-maxsize': {$this->config[$key]}"
- );
- }
- $size = $matches[1];
- if (isset($matches[2])) {
- switch (strtolower($matches[2])) {
- case 'g':
- $size *= 1024;
- case 'm':
- $size *= 1024;
- case 'k':
- $size *= 1024;
- break;
- }
- }
- return $size;
- case 'cache-files-ttl':
- if (isset($this->config[$key])) {
- return (int) $this->config[$key];
- }
- return (int) $this->config['cache-ttl'];
- case 'home':
- $val = preg_replace('#^(\$HOME|~)(/|$)#', rtrim(getenv('HOME') ?: getenv('USERPROFILE'), '/\\') . '/', $this->config[$key]);
- return rtrim($this->process($val, $flags), '/\\');
- case 'bin-compat':
- $value = $this->getComposerEnv('COMPOSER_BIN_COMPAT') ?: $this->config[$key];
- if (!in_array($value, array('auto', 'full'))) {
- throw new \RuntimeException(
- "Invalid value for 'bin-compat': {$value}. Expected auto, full"
- );
- }
- return $value;
- case 'discard-changes':
- if ($env = $this->getComposerEnv('COMPOSER_DISCARD_CHANGES')) {
- if (!in_array($env, array('stash', 'true', 'false', '1', '0'), true)) {
- throw new \RuntimeException(
- "Invalid value for COMPOSER_DISCARD_CHANGES: {$env}. Expected 1, 0, true, false or stash"
- );
- }
- if ('stash' === $env) {
- return 'stash';
- }
- return $env !== 'false' && (bool) $env;
- }
- if (!in_array($this->config[$key], array(true, false, 'stash'), true)) {
- throw new \RuntimeException(
- "Invalid value for 'discard-changes': {$this->config[$key]}. Expected true, false or stash"
- );
- }
- return $this->config[$key];
- case 'github-protocols':
- if (reset($this->config['github-protocols']) === 'http') {
- throw new \RuntimeException('The http protocol for github is not available anymore, update your config\'s github-protocols to use "https", "git" or "ssh"');
- }
- return $this->config[$key];
- case 'disable-tls':
- return $this->config[$key] !== 'false' && (bool) $this->config[$key];
- default:
- if (!isset($this->config[$key])) {
- return null;
- }
- return $this->process($this->config[$key], $flags);
- }
- }
- public function all($flags = 0)
- {
- $all = array(
- 'repositories' => $this->getRepositories(),
- );
- foreach (array_keys($this->config) as $key) {
- $all['config'][$key] = $this->get($key, $flags);
- }
- return $all;
- }
- public function raw()
- {
- return array(
- 'repositories' => $this->getRepositories(),
- 'config' => $this->config,
- );
- }
- public function has($key)
- {
- return array_key_exists($key, $this->config);
- }
- private function process($value, $flags)
- {
- $config = $this;
- if (!is_string($value)) {
- return $value;
- }
- return preg_replace_callback('#\{\$(.+)\}#', function ($match) use ($config, $flags) {
- return $config->get($match[1], $flags);
- }, $value);
- }
- private function realpath($path)
- {
- if (preg_match('{^(?:/|[a-z]:|[a-z0-9.]+://)}i', $path)) {
- return $path;
- }
- return $this->baseDir . '/' . $path;
- }
- private function getComposerEnv($var)
- {
- if ($this->useEnvironment) {
- return getenv($var);
- }
- return false;
- }
- }
- <?php
- namespace Composer\Config;
- interface ConfigSourceInterface
- {
- public function addRepository($name, $config);
- public function removeRepository($name);
- public function addConfigSetting($name, $value);
- public function removeConfigSetting($name);
- public function addLink($type, $name, $value);
- public function removeLink($type, $name);
- public function getName();
- }
- <?php
- namespace Composer\Config;
- use Composer\Json\JsonFile;
- use Composer\Json\JsonManipulator;
- use Composer\Util\Silencer;
- class JsonConfigSource implements ConfigSourceInterface
- {
- private $file;
- private $authConfig;
- public function __construct(JsonFile $file, $authConfig = false)
- {
- $this->file = $file;
- $this->authConfig = $authConfig;
- }
- public function getName()
- {
- return $this->file->getPath();
- }
- public function addRepository($name, $config)
- {
- $this->manipulateJson('addRepository', $name, $config, function (&$config, $repo, $repoConfig) {
- $config['repositories'][$repo] = $repoConfig;
- });
- }
- public function removeRepository($name)
- {
- $this->manipulateJson('removeRepository', $name, function (&$config, $repo) {
- unset($config['repositories'][$repo]);
- });
- }
- public function addConfigSetting($name, $value)
- {
- $this->manipulateJson('addConfigSetting', $name, $value, function (&$config, $key, $val) {
- if (preg_match('{^(github-oauth|gitlab-oauth|http-basic|platform)\.}', $key)) {
- list($key, $host) = explode('.', $key, 2);
- if ($this->authConfig) {
- $config[$key][$host] = $val;
- } else {
- $config['config'][$key][$host] = $val;
- }
- } else {
- $config['config'][$key] = $val;
- }
- });
- }
- public function removeConfigSetting($name)
- {
- $this->manipulateJson('removeConfigSetting', $name, function (&$config, $key) {
- if (preg_match('{^(github-oauth|gitlab-oauth|http-basic|platform)\.}', $key)) {
- list($key, $host) = explode('.', $key, 2);
- if ($this->authConfig) {
- unset($config[$key][$host]);
- } else {
- unset($config['config'][$key][$host]);
- }
- } else {
- unset($config['config'][$key]);
- }
- });
- }
- public function addLink($type, $name, $value)
- {
- $this->manipulateJson('addLink', $type, $name, $value, function (&$config, $type, $name, $value) {
- $config[$type][$name] = $value;
- });
- }
- public function removeLink($type, $name)
- {
- $this->manipulateJson('removeSubNode', $type, $name, function (&$config, $type, $name) {
- unset($config[$type][$name]);
- });
- }
- protected function manipulateJson($method, $args, $fallback)
- {
- $args = func_get_args();
- array_shift($args);
- $fallback = array_pop($args);
- if ($this->file->exists()) {
- if (!is_writable($this->file->getPath())) {
- throw new \RuntimeException(sprintf('The file "%s" is not writable.', $this->file->getPath()));
- }
- if (!is_readable($this->file->getPath())) {
- throw new \RuntimeException(sprintf('The file "%s" is not readable.', $this->file->getPath()));
- }
- $contents = file_get_contents($this->file->getPath());
- } elseif ($this->authConfig) {
- $contents = "{\n}\n";
- } else {
- $contents = "{\n \"config\": {\n }\n}\n";
- }
- $manipulator = new JsonManipulator($contents);
- $newFile = !$this->file->exists();
- if ($this->authConfig && $method === 'addConfigSetting') {
- $method = 'addSubNode';
- list($mainNode, $name) = explode('.', $args[0], 2);
- $args = array($mainNode, $name, $args[1]);
- } elseif ($this->authConfig && $method === 'removeConfigSetting') {
- $method = 'removeSubNode';
- list($mainNode, $name) = explode('.', $args[0], 2);
- $args = array($mainNode, $name);
- }
- if (call_user_func_array(array($manipulator, $method), $args)) {
- file_put_contents($this->file->getPath(), $manipulator->getContents());
- } else {
- $config = $this->file->read();
- $this->arrayUnshiftRef($args, $config);
- call_user_func_array($fallback, $args);
- $this->file->write($config);
- }
- if ($newFile) {
- Silencer::call('chmod', $this->file->getPath(), 0600);
- }
- }
- private function arrayUnshiftRef(&$array, &$value)
- {
- $return = array_unshift($array, '');
- $array[0] = &$value;
- return $return;
- }
- }
- <?php
- namespace Composer\Console;
- use Composer\Util\Platform;
- use Composer\Util\Silencer;
- use Symfony\Component\Console\Application as BaseApplication;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Output\ConsoleOutput;
- use Symfony\Component\Console\Formatter\OutputFormatter;
- use Composer\Command;
- use Composer\Composer;
- use Composer\Factory;
- use Composer\IO\IOInterface;
- use Composer\IO\ConsoleIO;
- use Composer\Json\JsonValidationException;
- use Composer\Util\ErrorHandler;
- class Application extends BaseApplication
- {
- protected $composer;
- protected $io;
- private static $logo = ' ______
- / ____/___ ____ ___ ____ ____ ________ _____
- / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
- / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
- \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
- /_/
- ';
- public function __construct()
- {
- static $shutdownRegistered = false;
- if (function_exists('ini_set') && extension_loaded('xdebug')) {
- ini_set('xdebug.show_exception_trace', false);
- ini_set('xdebug.scream', false);
- }
- if (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get')) {
- date_default_timezone_set(Silencer::call('date_default_timezone_get'));
- }
- if (!$shutdownRegistered) {
- $shutdownRegistered = true;
- register_shutdown_function(function () {
- $lastError = error_get_last();
- if ($lastError && $lastError['message'] &&
- (strpos($lastError['message'], 'Allowed memory') !== false ||
- strpos($lastError['message'], 'exceeded memory') !== false )) {
- echo "\n". 'Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.';
- }
- });
- }
- parent::__construct('Composer', Composer::VERSION);
- }
- public function run(InputInterface $input = null, OutputInterface $output = null)
- {
- if (null === $output) {
- $styles = Factory::createAdditionalStyles();
- $formatter = new OutputFormatter(null, $styles);
- $output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, null, $formatter);
- }
- return parent::run($input, $output);
- }
- public function doRun(InputInterface $input, OutputInterface $output)
- {
- $io = $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
- ErrorHandler::register($io);
- $commandName = '';
- if ($name = $this->getCommandName($input)) {
- try {
- $commandName = $this->find($name)->getName();
- } catch (\InvalidArgumentException $e) {
- }
- }
- if ($commandName !== 'global') {
- if (PHP_VERSION_ID < 50302) {
- $io->writeError('<warning>Composer only officially supports PHP 5.3.2 and above, you will most likely encounter problems with your PHP '.PHP_VERSION.', upgrading is strongly recommended.</warning>');
- }
- if (extension_loaded('xdebug') && !getenv('COMPOSER_DISABLE_XDEBUG_WARN')) {
- $io->writeError('<warning>You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug</warning>');
- }
- if (defined('COMPOSER_DEV_WARNING_TIME') && $commandName !== 'self-update' && $commandName !== 'selfupdate' && time() > COMPOSER_DEV_WARNING_TIME) {
- $io->writeError(sprintf('<warning>Warning: This development build of composer is over 60 days old. It is recommended to update it by running "%s self-update" to get the latest version.</warning>', $_SERVER['PHP_SELF']));
- }
- if (getenv('COMPOSER_NO_INTERACTION')) {
- $input->setInteractive(false);
- }
- if ($newWorkDir = $this->getNewWorkingDir($input)) {
- $oldWorkingDir = getcwd();
- chdir($newWorkDir);
- $io->writeError('Changed CWD to ' . getcwd(), true, IOInterface::DEBUG);
- }
- $file = Factory::getComposerFile();
- if (is_file($file) && is_readable($file) && is_array($composer = json_decode(file_get_contents($file), true))) {
- if (isset($composer['scripts']) && is_array($composer['scripts'])) {
- foreach ($composer['scripts'] as $script => $dummy) {
- if (!defined('Composer\Script\ScriptEvents::'.str_replace('-', '_', strtoupper($script)))) {
- if ($this->has($script)) {
- $io->writeError('<warning>A script named '.$script.' would override a native Composer function and has been skipped</warning>');
- } else {
- $this->add(new Command\ScriptAliasCommand($script));
- }
- }
- }
- }
- }
- }
- try {
- if ($input->hasParameterOption('--profile')) {
- $startTime = microtime(true);
- $this->io->enableDebugging($startTime);
- }
- $result = parent::doRun($input, $output);
- if (isset($oldWorkingDir)) {
- chdir($oldWorkingDir);
- }
- if (isset($startTime)) {
- $io->writeError('<info>Memory usage: '.round(memory_get_usage() / 1024 / 1024, 2).'MB (peak: '.round(memory_get_peak_usage() / 1024 / 1024, 2).'MB), time: '.round(microtime(true) - $startTime, 2).'s');
- }
- return $result;
- } catch (\Exception $e) {
- $this->hintCommonErrors($e);
- throw $e;
- }
- }
- private function getNewWorkingDir(InputInterface $input)
- {
- $workingDir = $input->getParameterOption(array('--working-dir', '-d'));
- if (false !== $workingDir && !is_dir($workingDir)) {
- throw new \RuntimeException('Invalid working directory specified, '.$workingDir.' does not exist.');
- }
- return $workingDir;
- }
- private function hintCommonErrors($exception)
- {
- $io = $this->getIO();
- Silencer::suppress();
- try {
- $composer = $this->getComposer(false, true);
- if ($composer) {
- $config = $composer->getConfig();
- $minSpaceFree = 1024 * 1024;
- if ((($df = disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
- || (($df = disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
- || (($df = disk_free_space($dir = sys_get_temp_dir())) !== false && $df < $minSpaceFree)
- ) {
- $io->writeError('<error>The disk hosting '.$dir.' is full, this may be the cause of the following exception</error>', true, IOInterface::QUIET);
- }
- }
- } catch (\Exception $e) {
- }
- Silencer::restore();
- if (Platform::isWindows() && false !== strpos($exception->getMessage(), 'The system cannot find the path specified')) {
- $io->writeError('<error>The following exception may be caused by a stale entry in your cmd.exe AutoRun</error>', true, IOInterface::QUIET);
- $io->writeError('<error>Check https://getcomposer.org/doc/articles/troubleshooting.md#-the-system-cannot-find-the-path-specified-windows- for details</error>', true, IOInterface::QUIET);
- }
- if (false !== strpos($exception->getMessage(), 'fork failed - Cannot allocate memory')) {
- $io->writeError('<error>The following exception is caused by a lack of memory and not having swap configured</error>', true, IOInterface::QUIET);
- $io->writeError('<error>Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details</error>', true, IOInterface::QUIET);
- }
- }
- public function getComposer($required = true, $disablePlugins = false)
- {
- if (null === $this->composer) {
- try {
- $this->composer = Factory::create($this->io, null, $disablePlugins);
- } catch (\InvalidArgumentException $e) {
- if ($required) {
- $this->io->writeError($e->getMessage());
- exit(1);
- }
- } catch (JsonValidationException $e) {
- $errors = ' - ' . implode(PHP_EOL . ' - ', $e->getErrors());
- $message = $e->getMessage() . ':' . PHP_EOL . $errors;
- throw new JsonValidationException($message);
- }
- }
- return $this->composer;
- }
- public function resetComposer()
- {
- $this->composer = null;
- }
- public function getIO()
- {
- return $this->io;
- }
- public function getHelp()
- {
- return self::$logo . parent::getHelp();
- }
- protected function getDefaultCommands()
- {
- $commands = array_merge(parent::getDefaultCommands(), array(
- new Command\AboutCommand(),
- new Command\ConfigCommand(),
- new Command\DependsCommand(),
- new Command\ProhibitsCommand(),
- new Command\InitCommand(),
- new Command\InstallCommand(),
- new Command\CreateProjectCommand(),
- new Command\UpdateCommand(),
- new Command\SearchCommand(),
- new Command\ValidateCommand(),
- new Command\ShowCommand(),
- new Command\SuggestsCommand(),
- new Command\RequireCommand(),
- new Command\DumpAutoloadCommand(),
- new Command\StatusCommand(),
- new Command\ArchiveCommand(),
- new Command\DiagnoseCommand(),
- new Command\RunScriptCommand(),
- new Command\LicensesCommand(),
- new Command\GlobalCommand(),
- new Command\ClearCacheCommand(),
- new Command\RemoveCommand(),
- new Command\HomeCommand(),
- ));
- if ('phar:' === substr(__FILE__, 0, 5)) {
- $commands[] = new Command\SelfUpdateCommand();
- }
- return $commands;
- }
- public function getLongVersion()
- {
- if (Composer::BRANCH_ALIAS_VERSION) {
- return sprintf(
- '<info>%s</info> version <comment>%s (%s)</comment> %s',
- $this->getName(),
- Composer::BRANCH_ALIAS_VERSION,
- $this->getVersion(),
- Composer::RELEASE_DATE
- );
- }
- return parent::getLongVersion() . ' ' . Composer::RELEASE_DATE;
- }
- protected function getDefaultInputDefinition()
- {
- $definition = parent::getDefaultInputDefinition();
- $definition->addOption(new InputOption('--profile', null, InputOption::VALUE_NONE, 'Display timing and memory usage information'));
- $definition->addOption(new InputOption('--working-dir', '-d', InputOption::VALUE_REQUIRED, 'If specified, use the given directory as working directory.'));
- return $definition;
- }
- }
- <?php
- namespace Composer\Console;
- use Symfony\Component\Console\Formatter\OutputFormatter;
- class HtmlOutputFormatter extends OutputFormatter
- {
- private static $availableForegroundColors = array(
- 30 => 'black',
- 31 => 'red',
- 32 => 'green',
- 33 => 'yellow',
- 34 => 'blue',
- 35 => 'magenta',
- 36 => 'cyan',
- 37 => 'white',
- );
- private static $availableBackgroundColors = array(
- 40 => 'black',
- 41 => 'red',
- 42 => 'green',
- 43 => 'yellow',
- 44 => 'blue',
- 45 => 'magenta',
- 46 => 'cyan',
- 47 => 'white',
- );
- private static $availableOptions = array(
- 1 => 'bold',
- 4 => 'underscore',
-
-
- );
- public function __construct(array $styles = array())
- {
- parent::__construct(true, $styles);
- }
- public function format($message)
- {
- $formatted = parent::format($message);
- $clearEscapeCodes = '(?:39|49|0|22|24|25|27|28)';
- return preg_replace_callback("{\033\[([0-9;]+)m(.*?)\033\[(?:".$clearEscapeCodes.";)*?".$clearEscapeCodes."m}s", array($this, 'formatHtml'), $formatted);
- }
- private function formatHtml($matches)
- {
- $out = '<span style="';
- foreach (explode(';', $matches[1]) as $code) {
- if (isset(self::$availableForegroundColors[$code])) {
- $out .= 'color:'.self::$availableForegroundColors[$code].';';
- } elseif (isset(self::$availableBackgroundColors[$code])) {
- $out .= 'background-color:'.self::$availableBackgroundColors[$code].';';
- } elseif (isset(self::$availableOptions[$code])) {
- switch (self::$availableOptions[$code]) {
- case 'bold':
- $out .= 'font-weight:bold;';
- break;
- case 'underscore':
- $out .= 'text-decoration:underline;';
- break;
- }
- }
- }
- return $out.'">'.$matches[2].'</span>';
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- class Decisions implements \Iterator, \Countable
- {
- const DECISION_LITERAL = 0;
- const DECISION_REASON = 1;
- protected $pool;
- protected $decisionMap;
- protected $decisionQueue = array();
- public function __construct($pool)
- {
- $this->pool = $pool;
- $this->decisionMap = array();
- }
- public function decide($literal, $level, $why)
- {
- $this->addDecision($literal, $level);
- $this->decisionQueue[] = array(
- self::DECISION_LITERAL => $literal,
- self::DECISION_REASON => $why,
- );
- }
- public function satisfy($literal)
- {
- $packageId = abs($literal);
- return (
- $literal > 0 && isset($this->decisionMap[$packageId]) && $this->decisionMap[$packageId] > 0 ||
- $literal < 0 && isset($this->decisionMap[$packageId]) && $this->decisionMap[$packageId] < 0
- );
- }
- public function conflict($literal)
- {
- $packageId = abs($literal);
- return (
- (isset($this->decisionMap[$packageId]) && $this->decisionMap[$packageId] > 0 && $literal < 0) ||
- (isset($this->decisionMap[$packageId]) && $this->decisionMap[$packageId] < 0 && $literal > 0)
- );
- }
- public function decided($literalOrPackageId)
- {
- return !empty($this->decisionMap[abs($literalOrPackageId)]);
- }
- public function undecided($literalOrPackageId)
- {
- return empty($this->decisionMap[abs($literalOrPackageId)]);
- }
- public function decidedInstall($literalOrPackageId)
- {
- $packageId = abs($literalOrPackageId);
- return isset($this->decisionMap[$packageId]) && $this->decisionMap[$packageId] > 0;
- }
- public function decisionLevel($literalOrPackageId)
- {
- $packageId = abs($literalOrPackageId);
- if (isset($this->decisionMap[$packageId])) {
- return abs($this->decisionMap[$packageId]);
- }
- return 0;
- }
- public function decisionRule($literalOrPackageId)
- {
- $packageId = abs($literalOrPackageId);
- foreach ($this->decisionQueue as $i => $decision) {
- if ($packageId === abs($decision[self::DECISION_LITERAL])) {
- return $decision[self::DECISION_REASON];
- }
- }
- return null;
- }
- public function atOffset($queueOffset)
- {
- return $this->decisionQueue[$queueOffset];
- }
- public function validOffset($queueOffset)
- {
- return $queueOffset >= 0 && $queueOffset < count($this->decisionQueue);
- }
- public function lastReason()
- {
- return $this->decisionQueue[count($this->decisionQueue) - 1][self::DECISION_REASON];
- }
- public function lastLiteral()
- {
- return $this->decisionQueue[count($this->decisionQueue) - 1][self::DECISION_LITERAL];
- }
- public function reset()
- {
- while ($decision = array_pop($this->decisionQueue)) {
- $this->decisionMap[abs($decision[self::DECISION_LITERAL])] = 0;
- }
- }
- public function resetToOffset($offset)
- {
- while (count($this->decisionQueue) > $offset + 1) {
- $decision = array_pop($this->decisionQueue);
- $this->decisionMap[abs($decision[self::DECISION_LITERAL])] = 0;
- }
- }
- public function revertLast()
- {
- $this->decisionMap[abs($this->lastLiteral())] = 0;
- array_pop($this->decisionQueue);
- }
- public function count()
- {
- return count($this->decisionQueue);
- }
- public function rewind()
- {
- end($this->decisionQueue);
- }
- public function current()
- {
- return current($this->decisionQueue);
- }
- public function key()
- {
- return key($this->decisionQueue);
- }
- public function next()
- {
- return prev($this->decisionQueue);
- }
- public function valid()
- {
- return false !== current($this->decisionQueue);
- }
- public function isEmpty()
- {
- return count($this->decisionQueue) === 0;
- }
- protected function addDecision($literal, $level)
- {
- $packageId = abs($literal);
- $previousDecision = isset($this->decisionMap[$packageId]) ? $this->decisionMap[$packageId] : null;
- if ($previousDecision != 0) {
- $literalString = $this->pool->literalToString($literal);
- $package = $this->pool->literalToPackage($literal);
- throw new SolverBugException(
- "Trying to decide $literalString on level $level, even though $package was previously decided as ".(int) $previousDecision."."
- );
- }
- if ($literal > 0) {
- $this->decisionMap[$packageId] = $level;
- } else {
- $this->decisionMap[$packageId] = -$level;
- }
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- use Composer\Package\PackageInterface;
- use Composer\Package\AliasPackage;
- use Composer\Package\BasePackage;
- use Composer\Semver\Constraint\Constraint;
- class DefaultPolicy implements PolicyInterface
- {
- private $preferStable;
- private $preferLowest;
- public function __construct($preferStable = false, $preferLowest = false)
- {
- $this->preferStable = $preferStable;
- $this->preferLowest = $preferLowest;
- }
- public function versionCompare(PackageInterface $a, PackageInterface $b, $operator)
- {
- if ($this->preferStable && ($stabA = $a->getStability()) !== ($stabB = $b->getStability())) {
- return BasePackage::$stabilities[$stabA] < BasePackage::$stabilities[$stabB];
- }
- $constraint = new Constraint($operator, $b->getVersion());
- $version = new Constraint('==', $a->getVersion());
- return $constraint->matchSpecific($version, true);
- }
- public function findUpdatePackages(Pool $pool, array $installedMap, PackageInterface $package, $mustMatchName = false)
- {
- $packages = array();
- foreach ($pool->whatProvides($package->getName(), null, $mustMatchName) as $candidate) {
- if ($candidate !== $package) {
- $packages[] = $candidate;
- }
- }
- return $packages;
- }
- public function getPriority(Pool $pool, PackageInterface $package)
- {
- return $pool->getPriority($package->getRepository());
- }
- public function selectPreferredPackages(Pool $pool, array $installedMap, array $literals, $requiredPackage = null)
- {
- $packages = $this->groupLiteralsByNamePreferInstalled($pool, $installedMap, $literals);
- foreach ($packages as &$literals) {
- $policy = $this;
- usort($literals, function ($a, $b) use ($policy, $pool, $installedMap, $requiredPackage) {
- return $policy->compareByPriorityPreferInstalled($pool, $installedMap, $pool->literalToPackage($a), $pool->literalToPackage($b), $requiredPackage, true);
- });
- }
- foreach ($packages as &$literals) {
- $literals = $this->pruneToHighestPriorityOrInstalled($pool, $installedMap, $literals);
- $literals = $this->pruneToBestVersion($pool, $literals);
- $literals = $this->pruneRemoteAliases($pool, $literals);
- }
- $selected = call_user_func_array('array_merge', $packages);
- usort($selected, function ($a, $b) use ($policy, $pool, $installedMap, $requiredPackage) {
- return $policy->compareByPriorityPreferInstalled($pool, $installedMap, $pool->literalToPackage($a), $pool->literalToPackage($b), $requiredPackage);
- });
- return $selected;
- }
- protected function groupLiteralsByNamePreferInstalled(Pool $pool, array $installedMap, $literals)
- {
- $packages = array();
- foreach ($literals as $literal) {
- $packageName = $pool->literalToPackage($literal)->getName();
- if (!isset($packages[$packageName])) {
- $packages[$packageName] = array();
- }
- if (isset($installedMap[abs($literal)])) {
- array_unshift($packages[$packageName], $literal);
- } else {
- $packages[$packageName][] = $literal;
- }
- }
- return $packages;
- }
- public function compareByPriorityPreferInstalled(Pool $pool, array $installedMap, PackageInterface $a, PackageInterface $b, $requiredPackage = null, $ignoreReplace = false)
- {
- if ($a->getRepository() === $b->getRepository()) {
- if ($a->getName() === $b->getName()) {
- $aAliased = $a instanceof AliasPackage;
- $bAliased = $b instanceof AliasPackage;
- if ($aAliased && !$bAliased) {
- return -1;
- }
- if (!$aAliased && $bAliased) {
- return 1;
- }
- }
- if (!$ignoreReplace) {
- if ($this->replaces($a, $b)) {
- return 1;
- }
- if ($this->replaces($b, $a)) {
- return -1;
- }
-
- if ($requiredPackage && false !== ($pos = strpos($requiredPackage, '/'))) {
- $requiredVendor = substr($requiredPackage, 0, $pos);
- $aIsSameVendor = substr($a->getName(), 0, $pos) === $requiredVendor;
- $bIsSameVendor = substr($b->getName(), 0, $pos) === $requiredVendor;
- if ($bIsSameVendor !== $aIsSameVendor) {
- return $aIsSameVendor ? -1 : 1;
- }
- }
- }
- if ($a->id === $b->id) {
- return 0;
- }
- return ($a->id < $b->id) ? -1 : 1;
- }
- if (isset($installedMap[$a->id])) {
- return -1;
- }
- if (isset($installedMap[$b->id])) {
- return 1;
- }
- return ($this->getPriority($pool, $a) > $this->getPriority($pool, $b)) ? -1 : 1;
- }
- protected function replaces(PackageInterface $source, PackageInterface $target)
- {
- foreach ($source->getReplaces() as $link) {
- if ($link->getTarget() === $target->getName()
- ) {
- return true;
- }
- }
- return false;
- }
- protected function pruneToBestVersion(Pool $pool, $literals)
- {
- $operator = $this->preferLowest ? '<' : '>';
- $bestLiterals = array($literals[0]);
- $bestPackage = $pool->literalToPackage($literals[0]);
- foreach ($literals as $i => $literal) {
- if (0 === $i) {
- continue;
- }
- $package = $pool->literalToPackage($literal);
- if ($this->versionCompare($package, $bestPackage, $operator)) {
- $bestPackage = $package;
- $bestLiterals = array($literal);
- } elseif ($this->versionCompare($package, $bestPackage, '==')) {
- $bestLiterals[] = $literal;
- }
- }
- return $bestLiterals;
- }
- protected function pruneToHighestPriorityOrInstalled(Pool $pool, array $installedMap, array $literals)
- {
- $selected = array();
- $priority = null;
- foreach ($literals as $literal) {
- $package = $pool->literalToPackage($literal);
- if (isset($installedMap[$package->id])) {
- $selected[] = $literal;
- continue;
- }
- if (null === $priority) {
- $priority = $this->getPriority($pool, $package);
- }
- if ($this->getPriority($pool, $package) != $priority) {
- break;
- }
- $selected[] = $literal;
- }
- return $selected;
- }
- protected function pruneRemoteAliases(Pool $pool, array $literals)
- {
- $hasLocalAlias = false;
- foreach ($literals as $literal) {
- $package = $pool->literalToPackage($literal);
- if ($package instanceof AliasPackage && $package->isRootPackageAlias()) {
- $hasLocalAlias = true;
- break;
- }
- }
- if (!$hasLocalAlias) {
- return $literals;
- }
- $selected = array();
- foreach ($literals as $literal) {
- $package = $pool->literalToPackage($literal);
- if ($package instanceof AliasPackage && $package->isRootPackageAlias()) {
- $selected[] = $literal;
- }
- }
- return $selected;
- }
- }
- <?php
- namespace Composer\DependencyResolver\Operation;
- use Composer\Package\PackageInterface;
- class InstallOperation extends SolverOperation
- {
- protected $package;
- public function __construct(PackageInterface $package, $reason = null)
- {
- parent::__construct($reason);
- $this->package = $package;
- }
- public function getPackage()
- {
- return $this->package;
- }
- public function getJobType()
- {
- return 'install';
- }
- public function __toString()
- {
- return 'Installing '.$this->package->getPrettyName().' ('.$this->formatVersion($this->package).')';
- }
- }
- <?php
- namespace Composer\DependencyResolver\Operation;
- use Composer\Package\AliasPackage;
- use Composer\Package\PackageInterface;
- class MarkAliasInstalledOperation extends SolverOperation
- {
- protected $package;
- public function __construct(AliasPackage $package, $reason = null)
- {
- parent::__construct($reason);
- $this->package = $package;
- }
- public function getPackage()
- {
- return $this->package;
- }
- public function getJobType()
- {
- return 'markAliasInstalled';
- }
- public function __toString()
- {
- return 'Marking '.$this->package->getPrettyName().' ('.$this->formatVersion($this->package).') as installed, alias of '.$this->package->getAliasOf()->getPrettyName().' ('.$this->formatVersion($this->package->getAliasOf()).')';
- }
- }
- <?php
- namespace Composer\DependencyResolver\Operation;
- use Composer\Package\AliasPackage;
- use Composer\Package\PackageInterface;
- class MarkAliasUninstalledOperation extends SolverOperation
- {
- protected $package;
- public function __construct(AliasPackage $package, $reason = null)
- {
- parent::__construct($reason);
- $this->package = $package;
- }
- public function getPackage()
- {
- return $this->package;
- }
- public function getJobType()
- {
- return 'markAliasUninstalled';
- }
- public function __toString()
- {
- return 'Marking '.$this->package->getPrettyName().' ('.$this->formatVersion($this->package).') as uninstalled, alias of '.$this->package->getAliasOf()->getPrettyName().' ('.$this->formatVersion($this->package->getAliasOf()).')';
- }
- }
- <?php
- namespace Composer\DependencyResolver\Operation;
- interface OperationInterface
- {
- public function getJobType();
- public function getReason();
- public function __toString();
- }
- <?php
- namespace Composer\DependencyResolver\Operation;
- use Composer\Package\PackageInterface;
- abstract class SolverOperation implements OperationInterface
- {
- protected $reason;
- public function __construct($reason = null)
- {
- $this->reason = $reason;
- }
- public function getReason()
- {
- return $this->reason;
- }
- protected function formatVersion(PackageInterface $package)
- {
- return $package->getFullPrettyVersion();
- }
- }
- <?php
- namespace Composer\DependencyResolver\Operation;
- use Composer\Package\PackageInterface;
- class UninstallOperation extends SolverOperation
- {
- protected $package;
- public function __construct(PackageInterface $package, $reason = null)
- {
- parent::__construct($reason);
- $this->package = $package;
- }
- public function getPackage()
- {
- return $this->package;
- }
- public function getJobType()
- {
- return 'uninstall';
- }
- public function __toString()
- {
- return 'Uninstalling '.$this->package->getPrettyName().' ('.$this->formatVersion($this->package).')';
- }
- }
- <?php
- namespace Composer\DependencyResolver\Operation;
- use Composer\Package\PackageInterface;
- class UpdateOperation extends SolverOperation
- {
- protected $initialPackage;
- protected $targetPackage;
- public function __construct(PackageInterface $initial, PackageInterface $target, $reason = null)
- {
- parent::__construct($reason);
- $this->initialPackage = $initial;
- $this->targetPackage = $target;
- }
- public function getInitialPackage()
- {
- return $this->initialPackage;
- }
- public function getTargetPackage()
- {
- return $this->targetPackage;
- }
- public function getJobType()
- {
- return 'update';
- }
- public function __toString()
- {
- return 'Updating '.$this->initialPackage->getPrettyName().' ('.$this->formatVersion($this->initialPackage).') to '.
- $this->targetPackage->getPrettyName(). ' ('.$this->formatVersion($this->targetPackage).')';
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- use Composer\Package\PackageInterface;
- interface PolicyInterface
- {
- public function versionCompare(PackageInterface $a, PackageInterface $b, $operator);
- public function findUpdatePackages(Pool $pool, array $installedMap, PackageInterface $package);
- public function selectPreferredPackages(Pool $pool, array $installedMap, array $literals);
- }
- <?php
- namespace Composer\DependencyResolver;
- use Composer\Package\BasePackage;
- use Composer\Package\AliasPackage;
- use Composer\Package\Version\VersionParser;
- use Composer\Semver\Constraint\ConstraintInterface;
- use Composer\Semver\Constraint\Constraint;
- use Composer\Semver\Constraint\EmptyConstraint;
- use Composer\Repository\RepositoryInterface;
- use Composer\Repository\CompositeRepository;
- use Composer\Repository\ComposerRepository;
- use Composer\Repository\InstalledRepositoryInterface;
- use Composer\Repository\PlatformRepository;
- use Composer\Package\PackageInterface;
- class Pool implements \Countable
- {
- const MATCH_NAME = -1;
- const MATCH_NONE = 0;
- const MATCH = 1;
- const MATCH_PROVIDE = 2;
- const MATCH_REPLACE = 3;
- const MATCH_FILTERED = 4;
- protected $repositories = array();
- protected $providerRepos = array();
- protected $packages = array();
- protected $packageByName = array();
- protected $packageByExactName = array();
- protected $acceptableStabilities;
- protected $stabilityFlags;
- protected $versionParser;
- protected $providerCache = array();
- protected $filterRequires;
- protected $whitelist = null;
- protected $id = 1;
- public function __construct($minimumStability = 'stable', array $stabilityFlags = array(), array $filterRequires = array())
- {
- $this->versionParser = new VersionParser;
- $this->acceptableStabilities = array();
- foreach (BasePackage::$stabilities as $stability => $value) {
- if ($value <= BasePackage::$stabilities[$minimumStability]) {
- $this->acceptableStabilities[$stability] = $value;
- }
- }
- $this->stabilityFlags = $stabilityFlags;
- $this->filterRequires = $filterRequires;
- foreach ($filterRequires as $name => $constraint) {
- if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $name)) {
- unset($this->filterRequires[$name]);
- }
- }
- }
- public function setWhitelist($whitelist)
- {
- $this->whitelist = $whitelist;
- $this->providerCache = array();
- }
- public function addRepository(RepositoryInterface $repo, $rootAliases = array())
- {
- if ($repo instanceof CompositeRepository) {
- $repos = $repo->getRepositories();
- } else {
- $repos = array($repo);
- }
- foreach ($repos as $repo) {
- $this->repositories[] = $repo;
- $exempt = $repo instanceof PlatformRepository || $repo instanceof InstalledRepositoryInterface;
- if ($repo instanceof ComposerRepository && $repo->hasProviders()) {
- $this->providerRepos[] = $repo;
- $repo->setRootAliases($rootAliases);
- $repo->resetPackageIds();
- } else {
- foreach ($repo->getPackages() as $package) {
- $names = $package->getNames();
- $stability = $package->getStability();
- if ($exempt || $this->isPackageAcceptable($names, $stability)) {
- $package->setId($this->id++);
- $this->packages[] = $package;
- $this->packageByExactName[$package->getName()][$package->id] = $package;
- foreach ($names as $provided) {
- $this->packageByName[$provided][] = $package;
- }
- $name = $package->getName();
- if (isset($rootAliases[$name][$package->getVersion()])) {
- $alias = $rootAliases[$name][$package->getVersion()];
- if ($package instanceof AliasPackage) {
- $package = $package->getAliasOf();
- }
- $aliasPackage = new AliasPackage($package, $alias['alias_normalized'], $alias['alias']);
- $aliasPackage->setRootPackageAlias(true);
- $aliasPackage->setId($this->id++);
- $package->getRepository()->addPackage($aliasPackage);
- $this->packages[] = $aliasPackage;
- $this->packageByExactName[$aliasPackage->getName()][$aliasPackage->id] = $aliasPackage;
- foreach ($aliasPackage->getNames() as $name) {
- $this->packageByName[$name][] = $aliasPackage;
- }
- }
- }
- }
- }
- }
- }
- public function getPriority(RepositoryInterface $repo)
- {
- $priority = array_search($repo, $this->repositories, true);
- if (false === $priority) {
- throw new \RuntimeException("Could not determine repository priority. The repository was not registered in the pool.");
- }
- return -$priority;
- }
- public function packageById($id)
- {
- return $this->packages[$id - 1];
- }
- public function count()
- {
- return count($this->packages);
- }
- public function whatProvides($name, ConstraintInterface $constraint = null, $mustMatchName = false)
- {
- $key = ((int) $mustMatchName).$constraint;
- if (isset($this->providerCache[$name][$key])) {
- return $this->providerCache[$name][$key];
- }
- return $this->providerCache[$name][$key] = $this->computeWhatProvides($name, $constraint, $mustMatchName);
- }
- private function computeWhatProvides($name, $constraint, $mustMatchName = false)
- {
- $candidates = array();
- foreach ($this->providerRepos as $repo) {
- foreach ($repo->whatProvides($this, $name) as $candidate) {
- $candidates[] = $candidate;
- if ($candidate->id < 1) {
- $candidate->setId($this->id++);
- $this->packages[$this->id - 2] = $candidate;
- }
- }
- }
- if ($mustMatchName) {
- $candidates = array_filter($candidates, function ($candidate) use ($name) {
- return $candidate->getName() == $name;
- });
- if (isset($this->packageByExactName[$name])) {
- $candidates = array_merge($candidates, $this->packageByExactName[$name]);
- }
- } elseif (isset($this->packageByName[$name])) {
- $candidates = array_merge($candidates, $this->packageByName[$name]);
- }
- $matches = $provideMatches = array();
- $nameMatch = false;
- foreach ($candidates as $candidate) {
- $aliasOfCandidate = null;
-
- if ($candidate instanceof AliasPackage) {
- $aliasOfCandidate = $candidate->getAliasOf();
- }
- if ($this->whitelist !== null && (
- (!($candidate instanceof AliasPackage) && !isset($this->whitelist[$candidate->id])) ||
- ($candidate instanceof AliasPackage && !isset($this->whitelist[$aliasOfCandidate->id]))
- )) {
- continue;
- }
- switch ($this->match($candidate, $name, $constraint)) {
- case self::MATCH_NONE:
- break;
- case self::MATCH_NAME:
- $nameMatch = true;
- break;
- case self::MATCH:
- $nameMatch = true;
- $matches[] = $candidate;
- break;
- case self::MATCH_PROVIDE:
- $provideMatches[] = $candidate;
- break;
- case self::MATCH_REPLACE:
- $matches[] = $candidate;
- break;
- case self::MATCH_FILTERED:
- break;
- default:
- throw new \UnexpectedValueException('Unexpected match type');
- }
- }
- if ($nameMatch) {
- return $matches;
- }
- return array_merge($matches, $provideMatches);
- }
- public function literalToPackage($literal)
- {
- $packageId = abs($literal);
- return $this->packageById($packageId);
- }
- public function literalToPrettyString($literal, $installedMap)
- {
- $package = $this->literalToPackage($literal);
- if (isset($installedMap[$package->id])) {
- $prefix = ($literal > 0 ? 'keep' : 'remove');
- } else {
- $prefix = ($literal > 0 ? 'install' : 'don\'t install');
- }
- return $prefix.' '.$package->getPrettyString();
- }
- public function isPackageAcceptable($name, $stability)
- {
- foreach ((array) $name as $n) {
- if (!isset($this->stabilityFlags[$n]) && isset($this->acceptableStabilities[$stability])) {
- return true;
- }
- if (isset($this->stabilityFlags[$n]) && BasePackage::$stabilities[$stability] <= $this->stabilityFlags[$n]) {
- return true;
- }
- }
- return false;
- }
- private function match($candidate, $name, ConstraintInterface $constraint = null)
- {
- $candidateName = $candidate->getName();
- $candidateVersion = $candidate->getVersion();
- $isDev = $candidate->getStability() === 'dev';
- $isAlias = $candidate instanceof AliasPackage;
- if (!$isDev && !$isAlias && isset($this->filterRequires[$name])) {
- $requireFilter = $this->filterRequires[$name];
- } else {
- $requireFilter = new EmptyConstraint;
- }
- if ($candidateName === $name) {
- $pkgConstraint = new Constraint('==', $candidateVersion);
- if ($constraint === null || $constraint->matches($pkgConstraint)) {
- return $requireFilter->matches($pkgConstraint) ? self::MATCH : self::MATCH_FILTERED;
- }
- return self::MATCH_NAME;
- }
- $provides = $candidate->getProvides();
- $replaces = $candidate->getReplaces();
- if (isset($replaces[0]) || isset($provides[0])) {
- foreach ($provides as $link) {
- if ($link->getTarget() === $name && ($constraint === null || $constraint->matches($link->getConstraint()))) {
- return $requireFilter->matches($link->getConstraint()) ? self::MATCH_PROVIDE : self::MATCH_FILTERED;
- }
- }
- foreach ($replaces as $link) {
- if ($link->getTarget() === $name && ($constraint === null || $constraint->matches($link->getConstraint()))) {
- return $requireFilter->matches($link->getConstraint()) ? self::MATCH_REPLACE : self::MATCH_FILTERED;
- }
- }
- return self::MATCH_NONE;
- }
- if (isset($provides[$name]) && ($constraint === null || $constraint->matches($provides[$name]->getConstraint()))) {
- return $requireFilter->matches($provides[$name]->getConstraint()) ? self::MATCH_PROVIDE : self::MATCH_FILTERED;
- }
- if (isset($replaces[$name]) && ($constraint === null || $constraint->matches($replaces[$name]->getConstraint()))) {
- return $requireFilter->matches($replaces[$name]->getConstraint()) ? self::MATCH_REPLACE : self::MATCH_FILTERED;
- }
- return self::MATCH_NONE;
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- class Problem
- {
- protected $reasonSeen;
- protected $reasons = array();
- protected $section = 0;
- protected $pool;
- public function __construct(Pool $pool)
- {
- $this->pool = $pool;
- }
- public function addRule(Rule $rule)
- {
- $this->addReason(spl_object_hash($rule), array(
- 'rule' => $rule,
- 'job' => $rule->getJob(),
- ));
- }
- public function getReasons()
- {
- return $this->reasons;
- }
- public function getPrettyString(array $installedMap = array())
- {
- $reasons = call_user_func_array('array_merge', array_reverse($this->reasons));
- if (count($reasons) === 1) {
- reset($reasons);
- $reason = current($reasons);
- $rule = $reason['rule'];
- $job = $reason['job'];
- if (isset($job['constraint'])) {
- $packages = $this->pool->whatProvides($job['packageName'], $job['constraint']);
- } else {
- $packages = array();
- }
- if ($job && $job['cmd'] === 'install' && empty($packages)) {
- if ($job['packageName'] === 'php' || $job['packageName'] === 'php-64bit' || $job['packageName'] === 'hhvm') {
- $available = $this->pool->whatProvides($job['packageName']);
- $version = count($available) ? $available[0]->getPrettyVersion() : phpversion();
- $msg = "\n - This package requires ".$job['packageName'].$this->constraintToText($job['constraint']).' but ';
- if (defined('HHVM_VERSION')) {
- return $msg . 'your HHVM version does not satisfy that requirement.';
- } elseif ($job['packageName'] === 'hhvm') {
- return $msg . 'you are running this with PHP and not HHVM.';
- }
- return $msg . 'your PHP version ('. $version .') does not satisfy that requirement.';
- }
- if (0 === stripos($job['packageName'], 'ext-')) {
- $ext = substr($job['packageName'], 4);
- $error = extension_loaded($ext) ? 'has the wrong version ('.(phpversion($ext) ?: '0').') installed' : 'is missing from your system';
- return "\n - The requested PHP extension ".$job['packageName'].$this->constraintToText($job['constraint']).' '.$error.'. Install or enable PHP\'s '.$ext.' extension.';
- }
- if (0 === stripos($job['packageName'], 'lib-')) {
- if (strtolower($job['packageName']) === 'lib-icu') {
- $error = extension_loaded('intl') ? 'has the wrong version installed, try upgrading the intl extension.' : 'is missing from your system, make sure the intl extension is loaded.';
- return "\n - The requested linked library ".$job['packageName'].$this->constraintToText($job['constraint']).' '.$error;
- }
- return "\n - The requested linked library ".$job['packageName'].$this->constraintToText($job['constraint']).' has the wrong version installed or is missing from your system, make sure to load the extension providing it.';
- }
- if (!preg_match('{^[A-Za-z0-9_./-]+$}', $job['packageName'])) {
- $illegalChars = preg_replace('{[A-Za-z0-9_./-]+}', '', $job['packageName']);
- return "\n - The requested package ".$job['packageName'].' could not be found, it looks like its name is invalid, "'.$illegalChars.'" is not allowed in package names.';
- }
- if (!$this->pool->whatProvides($job['packageName'])) {
- return "\n - The requested package ".$job['packageName'].' could not be found in any version, there may be a typo in the package name.';
- }
- return "\n - The requested package ".$job['packageName'].$this->constraintToText($job['constraint']).' could not be found.';
- }
- }
- $messages = array();
- foreach ($reasons as $reason) {
- $rule = $reason['rule'];
- $job = $reason['job'];
- if ($job) {
- $messages[] = $this->jobToText($job);
- } elseif ($rule) {
- if ($rule instanceof Rule) {
- $messages[] = $rule->getPrettyString($this->pool, $installedMap);
- }
- }
- }
- return "\n - ".implode("\n - ", $messages);
- }
- protected function addReason($id, $reason)
- {
- if (!isset($this->reasonSeen[$id])) {
- $this->reasonSeen[$id] = true;
- $this->reasons[$this->section][] = $reason;
- }
- }
- public function nextSection()
- {
- $this->section++;
- }
- protected function jobToText($job)
- {
- switch ($job['cmd']) {
- case 'install':
- $packages = $this->pool->whatProvides($job['packageName'], $job['constraint']);
- if (!$packages) {
- return 'No package found to satisfy install request for '.$job['packageName'].$this->constraintToText($job['constraint']);
- }
- return 'Installation request for '.$job['packageName'].$this->constraintToText($job['constraint']).' -> satisfiable by '.$this->getPackageList($packages).'.';
- case 'update':
- return 'Update request for '.$job['packageName'].$this->constraintToText($job['constraint']).'.';
- case 'remove':
- return 'Removal request for '.$job['packageName'].$this->constraintToText($job['constraint']).'';
- }
- if (isset($job['constraint'])) {
- $packages = $this->pool->whatProvides($job['packageName'], $job['constraint']);
- } else {
- $packages = array();
- }
- return 'Job(cmd='.$job['cmd'].', target='.$job['packageName'].', packages=['.$this->getPackageList($packages).'])';
- }
- protected function getPackageList($packages)
- {
- $prepared = array();
- foreach ($packages as $package) {
- $prepared[$package->getName()]['name'] = $package->getPrettyName();
- $prepared[$package->getName()]['versions'][$package->getVersion()] = $package->getPrettyVersion();
- }
- foreach ($prepared as $name => $package) {
- $prepared[$name] = $package['name'].'['.implode(', ', $package['versions']).']';
- }
- return implode(', ', $prepared);
- }
- protected function constraintToText($constraint)
- {
- return ($constraint) ? ' '.$constraint->getPrettyString() : '';
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- use Composer\Semver\Constraint\ConstraintInterface;
- class Request
- {
- protected $jobs;
- public function __construct()
- {
- $this->jobs = array();
- }
- public function install($packageName, ConstraintInterface $constraint = null)
- {
- $this->addJob($packageName, 'install', $constraint);
- }
- public function update($packageName, ConstraintInterface $constraint = null)
- {
- $this->addJob($packageName, 'update', $constraint);
- }
- public function remove($packageName, ConstraintInterface $constraint = null)
- {
- $this->addJob($packageName, 'remove', $constraint);
- }
- public function fix($packageName, ConstraintInterface $constraint = null)
- {
- $this->addJob($packageName, 'install', $constraint, true);
- }
- protected function addJob($packageName, $cmd, ConstraintInterface $constraint = null, $fixed = false)
- {
- $packageName = strtolower($packageName);
- $this->jobs[] = array(
- 'cmd' => $cmd,
- 'packageName' => $packageName,
- 'constraint' => $constraint,
- 'fixed' => $fixed,
- );
- }
- public function updateAll()
- {
- $this->jobs[] = array('cmd' => 'update-all');
- }
- public function getJobs()
- {
- return $this->jobs;
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- use Composer\Package\CompletePackage;
- class Rule
- {
- const RULE_INTERNAL_ALLOW_UPDATE = 1;
- const RULE_JOB_INSTALL = 2;
- const RULE_JOB_REMOVE = 3;
- const RULE_PACKAGE_CONFLICT = 6;
- const RULE_PACKAGE_REQUIRES = 7;
- const RULE_PACKAGE_OBSOLETES = 8;
- const RULE_INSTALLED_PACKAGE_OBSOLETES = 9;
- const RULE_PACKAGE_SAME_NAME = 10;
- const RULE_PACKAGE_IMPLICIT_OBSOLETES = 11;
- const RULE_LEARNED = 12;
- const RULE_PACKAGE_ALIAS = 13;
- const BITFIELD_TYPE = 0;
- const BITFIELD_REASON = 8;
- const BITFIELD_DISABLED = 16;
- public $literals;
- protected $bitfield;
- protected $reasonData;
- public function __construct(array $literals, $reason, $reasonData, $job = null)
- {
- sort($literals);
- $this->literals = $literals;
- $this->reasonData = $reasonData;
- if ($job) {
- $this->job = $job;
- }
- $this->bitfield = (0 << self::BITFIELD_DISABLED) |
- ($reason << self::BITFIELD_REASON) |
- (255 << self::BITFIELD_TYPE);
- }
- public function getHash()
- {
- $data = unpack('ihash', md5(implode(',', $this->literals), true));
- return $data['hash'];
- }
- public function getJob()
- {
- return isset($this->job) ? $this->job : null;
- }
- public function getReason()
- {
- return ($this->bitfield & (255 << self::BITFIELD_REASON)) >> self::BITFIELD_REASON;
- }
- public function getReasonData()
- {
- return $this->reasonData;
- }
- public function getRequiredPackage()
- {
- if ($this->getReason() === self::RULE_JOB_INSTALL) {
- return $this->reasonData;
- }
- if ($this->getReason() === self::RULE_PACKAGE_REQUIRES) {
- return $this->reasonData->getTarget();
- }
- }
- public function equals(Rule $rule)
- {
- if (count($this->literals) != count($rule->literals)) {
- return false;
- }
- for ($i = 0, $n = count($this->literals); $i < $n; $i++) {
- if ($this->literals[$i] !== $rule->literals[$i]) {
- return false;
- }
- }
- return true;
- }
- public function setType($type)
- {
- $this->bitfield = ($this->bitfield & ~(255 << self::BITFIELD_TYPE)) | ((255 & $type) << self::BITFIELD_TYPE);
- }
- public function getType()
- {
- return ($this->bitfield & (255 << self::BITFIELD_TYPE)) >> self::BITFIELD_TYPE;
- }
- public function disable()
- {
- $this->bitfield = ($this->bitfield & ~(255 << self::BITFIELD_DISABLED)) | (1 << self::BITFIELD_DISABLED);
- }
- public function enable()
- {
- $this->bitfield = $this->bitfield & ~(255 << self::BITFIELD_DISABLED);
- }
- public function isDisabled()
- {
- return (bool) (($this->bitfield & (255 << self::BITFIELD_DISABLED)) >> self::BITFIELD_DISABLED);
- }
- public function isEnabled()
- {
- return !(($this->bitfield & (255 << self::BITFIELD_DISABLED)) >> self::BITFIELD_DISABLED);
- }
- public function isAssertion()
- {
- return 1 === count($this->literals);
- }
- public function getPrettyString(Pool $pool, array $installedMap = array())
- {
- $ruleText = '';
- foreach ($this->literals as $i => $literal) {
- if ($i != 0) {
- $ruleText .= '|';
- }
- $ruleText .= $pool->literalToPrettyString($literal, $installedMap);
- }
- switch ($this->getReason()) {
- case self::RULE_INTERNAL_ALLOW_UPDATE:
- return $ruleText;
- case self::RULE_JOB_INSTALL:
- return "Install command rule ($ruleText)";
- case self::RULE_JOB_REMOVE:
- return "Remove command rule ($ruleText)";
- case self::RULE_PACKAGE_CONFLICT:
- $package1 = $pool->literalToPackage($this->literals[0]);
- $package2 = $pool->literalToPackage($this->literals[1]);
- return $package1->getPrettyString().' conflicts with '.$this->formatPackagesUnique($pool, array($package2)).'.';
- case self::RULE_PACKAGE_REQUIRES:
- $literals = $this->literals;
- $sourceLiteral = array_shift($literals);
- $sourcePackage = $pool->literalToPackage($sourceLiteral);
- $requires = array();
- foreach ($literals as $literal) {
- $requires[] = $pool->literalToPackage($literal);
- }
- $text = $this->reasonData->getPrettyString($sourcePackage);
- if ($requires) {
- $text .= ' -> satisfiable by ' . $this->formatPackagesUnique($pool, $requires) . '.';
- } else {
- $targetName = $this->reasonData->getTarget();
- if ($targetName === 'php' || $targetName === 'php-64bit' || $targetName === 'hhvm') {
- if (defined('HHVM_VERSION')) {
- return $text . ' -> your HHVM version does not satisfy that requirement.';
- } elseif ($targetName === 'hhvm') {
- return $text . ' -> you are running this with PHP and not HHVM.';
- } else {
- $packages = $pool->whatProvides($targetName);
- $package = count($packages) ? current($packages) : phpversion();
- if (!($package instanceof CompletePackage)) {
- return $text . ' -> your PHP version ('.phpversion().') does not satisfy that requirement.';
- }
- $extra = $package->getExtra();
- if (!empty($extra['config.platform'])) {
- $text .= ' -> your PHP version ('.phpversion().') overriden by "config.platform.php" version ('.$package->getPrettyVersion().') does not satisfy that requirement.';
- } else {
- $text .= ' -> your PHP version ('.$package->getPrettyVersion().') does not satisfy that requirement.';
- }
- return $text;
- }
- } elseif (0 === strpos($targetName, 'ext-')) {
- $ext = substr($targetName, 4);
- $error = extension_loaded($ext) ? 'has the wrong version ('.(phpversion($ext) ?: '0').') installed' : 'is missing from your system';
- return $text . ' -> the requested PHP extension '.$ext.' '.$error.'.';
- } elseif (0 === strpos($targetName, 'lib-')) {
- $lib = substr($targetName, 4);
- return $text . ' -> the requested linked library '.$lib.' has the wrong version installed or is missing from your system, make sure to have the extension providing it.';
- } else {
- return $text . ' -> no matching package found.';
- }
- }
- return $text;
- case self::RULE_PACKAGE_OBSOLETES:
- return $ruleText;
- case self::RULE_INSTALLED_PACKAGE_OBSOLETES:
- return $ruleText;
- case self::RULE_PACKAGE_SAME_NAME:
- return 'Can only install one of: ' . $this->formatPackagesUnique($pool, $this->literals) . '.';
- case self::RULE_PACKAGE_IMPLICIT_OBSOLETES:
- return $ruleText;
- case self::RULE_LEARNED:
- return 'Conclusion: '.$ruleText;
- case self::RULE_PACKAGE_ALIAS:
- return $ruleText;
- default:
- return '('.$ruleText.')';
- }
- }
- protected function formatPackagesUnique($pool, array $packages)
- {
- $prepared = array();
- foreach ($packages as $package) {
- if (!is_object($package)) {
- $package = $pool->literalToPackage($package);
- }
- $prepared[$package->getName()]['name'] = $package->getPrettyName();
- $prepared[$package->getName()]['versions'][$package->getVersion()] = $package->getPrettyVersion();
- }
- foreach ($prepared as $name => $package) {
- $prepared[$name] = $package['name'].'['.implode(', ', $package['versions']).']';
- }
- return implode(', ', $prepared);
- }
- public function __toString()
- {
- $result = ($this->isDisabled()) ? 'disabled(' : '(';
- foreach ($this->literals as $i => $literal) {
- if ($i != 0) {
- $result .= '|';
- }
- $result .= $literal;
- }
- $result .= ')';
- return $result;
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- class RuleSet implements \IteratorAggregate, \Countable
- {
- const TYPE_PACKAGE = 0;
- const TYPE_JOB = 1;
- const TYPE_LEARNED = 4;
- public $ruleById;
- protected static $types = array(
- 255 => 'UNKNOWN',
- self::TYPE_PACKAGE => 'PACKAGE',
- self::TYPE_JOB => 'JOB',
- self::TYPE_LEARNED => 'LEARNED',
- );
- protected $rules;
- protected $nextRuleId;
- protected $rulesByHash;
- public function __construct()
- {
- $this->nextRuleId = 0;
- foreach ($this->getTypes() as $type) {
- $this->rules[$type] = array();
- }
- $this->rulesByHash = array();
- }
- public function add(Rule $rule, $type)
- {
- if (!isset(self::$types[$type])) {
- throw new \OutOfBoundsException('Unknown rule type: ' . $type);
- }
- if (!isset($this->rules[$type])) {
- $this->rules[$type] = array();
- }
- $this->rules[$type][] = $rule;
- $this->ruleById[$this->nextRuleId] = $rule;
- $rule->setType($type);
- $this->nextRuleId++;
- $hash = $rule->getHash();
- if (!isset($this->rulesByHash[$hash])) {
- $this->rulesByHash[$hash] = array($rule);
- } else {
- $this->rulesByHash[$hash][] = $rule;
- }
- }
- public function count()
- {
- return $this->nextRuleId;
- }
- public function ruleById($id)
- {
- return $this->ruleById[$id];
- }
- public function getRules()
- {
- return $this->rules;
- }
- public function getIterator()
- {
- return new RuleSetIterator($this->getRules());
- }
- public function getIteratorFor($types)
- {
- if (!is_array($types)) {
- $types = array($types);
- }
- $allRules = $this->getRules();
- $rules = array();
- foreach ($types as $type) {
- $rules[$type] = $allRules[$type];
- }
- return new RuleSetIterator($rules);
- }
- public function getIteratorWithout($types)
- {
- if (!is_array($types)) {
- $types = array($types);
- }
- $rules = $this->getRules();
- foreach ($types as $type) {
- unset($rules[$type]);
- }
- return new RuleSetIterator($rules);
- }
- public function getTypes()
- {
- $types = self::$types;
- unset($types[255]);
- return array_keys($types);
- }
- public function containsEqual($rule)
- {
- if (isset($this->rulesByHash[$rule->getHash()])) {
- $potentialDuplicates = $this->rulesByHash[$rule->getHash()];
- foreach ($potentialDuplicates as $potentialDuplicate) {
- if ($rule->equals($potentialDuplicate)) {
- return true;
- }
- }
- }
- return false;
- }
- public function getPrettyString(Pool $pool = null)
- {
- $string = "\n";
- foreach ($this->rules as $type => $rules) {
- $string .= str_pad(self::$types[$type], 8, ' ') . ": ";
- foreach ($rules as $rule) {
- $string .= ($pool ? $rule->getPrettyString($pool) : $rule)."\n";
- }
- $string .= "\n\n";
- }
- return $string;
- }
- public function __toString()
- {
- return $this->getPrettyString(null);
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- use Composer\Package\PackageInterface;
- use Composer\Package\AliasPackage;
- use Composer\Repository\PlatformRepository;
- class RuleSetGenerator
- {
- protected $policy;
- protected $pool;
- protected $rules;
- protected $jobs;
- protected $installedMap;
- protected $whitelistedMap;
- protected $addedMap;
- public function __construct(PolicyInterface $policy, Pool $pool)
- {
- $this->policy = $policy;
- $this->pool = $pool;
- }
- protected function createRequireRule(PackageInterface $package, array $providers, $reason, $reasonData = null)
- {
- $literals = array(-$package->id);
- foreach ($providers as $provider) {
- if ($provider === $package) {
- return null;
- }
- $literals[] = $provider->id;
- }
- return new Rule($literals, $reason, $reasonData);
- }
- protected function createInstallOneOfRule(array $packages, $reason, $job)
- {
- $literals = array();
- foreach ($packages as $package) {
- $literals[] = $package->id;
- }
- return new Rule($literals, $reason, $job['packageName'], $job);
- }
- protected function createRemoveRule(PackageInterface $package, $reason, $job)
- {
- return new Rule(array(-$package->id), $reason, $job['packageName'], $job);
- }
- protected function createConflictRule(PackageInterface $issuer, PackageInterface $provider, $reason, $reasonData = null)
- {
- if ($issuer === $provider) {
- return null;
- }
- return new Rule(array(-$issuer->id, -$provider->id), $reason, $reasonData);
- }
- private function addRule($type, Rule $newRule = null)
- {
- if (!$newRule || $this->rules->containsEqual($newRule)) {
- return;
- }
- $this->rules->add($newRule, $type);
- }
- protected function whitelistFromPackage(PackageInterface $package)
- {
- $workQueue = new \SplQueue;
- $workQueue->enqueue($package);
- while (!$workQueue->isEmpty()) {
- $package = $workQueue->dequeue();
- if (isset($this->whitelistedMap[$package->id])) {
- continue;
- }
- $this->whitelistedMap[$package->id] = true;
- foreach ($package->getRequires() as $link) {
- $possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint(), true);
- foreach ($possibleRequires as $require) {
- $workQueue->enqueue($require);
- }
- }
- $obsoleteProviders = $this->pool->whatProvides($package->getName(), null, true);
- foreach ($obsoleteProviders as $provider) {
- if ($provider === $package) {
- continue;
- }
- if (($package instanceof AliasPackage) && $package->getAliasOf() === $provider) {
- $workQueue->enqueue($provider);
- }
- }
- }
- }
- protected function addRulesForPackage(PackageInterface $package, $ignorePlatformReqs)
- {
- $workQueue = new \SplQueue;
- $workQueue->enqueue($package);
- while (!$workQueue->isEmpty()) {
- $package = $workQueue->dequeue();
- if (isset($this->addedMap[$package->id])) {
- continue;
- }
- $this->addedMap[$package->id] = true;
- foreach ($package->getRequires() as $link) {
- if ($ignorePlatformReqs && preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $link->getTarget())) {
- continue;
- }
- $possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint());
- $this->addRule(RuleSet::TYPE_PACKAGE, $rule = $this->createRequireRule($package, $possibleRequires, Rule::RULE_PACKAGE_REQUIRES, $link));
- foreach ($possibleRequires as $require) {
- $workQueue->enqueue($require);
- }
- }
- foreach ($package->getConflicts() as $link) {
- $possibleConflicts = $this->pool->whatProvides($link->getTarget(), $link->getConstraint());
- foreach ($possibleConflicts as $conflict) {
- $this->addRule(RuleSet::TYPE_PACKAGE, $this->createConflictRule($package, $conflict, Rule::RULE_PACKAGE_CONFLICT, $link));
- }
- }
- $isInstalled = (isset($this->installedMap[$package->id]));
- foreach ($package->getReplaces() as $link) {
- $obsoleteProviders = $this->pool->whatProvides($link->getTarget(), $link->getConstraint());
- foreach ($obsoleteProviders as $provider) {
- if ($provider === $package) {
- continue;
- }
- if (!$this->obsoleteImpossibleForAlias($package, $provider)) {
- $reason = ($isInstalled) ? Rule::RULE_INSTALLED_PACKAGE_OBSOLETES : Rule::RULE_PACKAGE_OBSOLETES;
- $this->addRule(RuleSet::TYPE_PACKAGE, $this->createConflictRule($package, $provider, $reason, $link));
- }
- }
- }
- $obsoleteProviders = $this->pool->whatProvides($package->getName(), null);
- foreach ($obsoleteProviders as $provider) {
- if ($provider === $package) {
- continue;
- }
- if (($package instanceof AliasPackage) && $package->getAliasOf() === $provider) {
- $this->addRule(RuleSet::TYPE_PACKAGE, $rule = $this->createRequireRule($package, array($provider), Rule::RULE_PACKAGE_ALIAS, $package));
- } elseif (!$this->obsoleteImpossibleForAlias($package, $provider)) {
- $reason = ($package->getName() == $provider->getName()) ? Rule::RULE_PACKAGE_SAME_NAME : Rule::RULE_PACKAGE_IMPLICIT_OBSOLETES;
- $this->addRule(RuleSet::TYPE_PACKAGE, $rule = $this->createConflictRule($package, $provider, $reason, $package));
- }
- }
- }
- }
- protected function obsoleteImpossibleForAlias($package, $provider)
- {
- $packageIsAlias = $package instanceof AliasPackage;
- $providerIsAlias = $provider instanceof AliasPackage;
- $impossible = (
- ($packageIsAlias && $package->getAliasOf() === $provider) ||
- ($providerIsAlias && $provider->getAliasOf() === $package) ||
- ($packageIsAlias && $providerIsAlias && $provider->getAliasOf() === $package->getAliasOf())
- );
- return $impossible;
- }
- protected function whitelistFromJobs()
- {
- foreach ($this->jobs as $job) {
- switch ($job['cmd']) {
- case 'install':
- $packages = $this->pool->whatProvides($job['packageName'], $job['constraint'], true);
- foreach ($packages as $package) {
- $this->whitelistFromPackage($package);
- }
- break;
- }
- }
- }
- protected function addRulesForJobs($ignorePlatformReqs)
- {
- foreach ($this->jobs as $job) {
- switch ($job['cmd']) {
- case 'install':
- if (!$job['fixed'] && $ignorePlatformReqs && preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $job['packageName'])) {
- continue;
- }
- $packages = $this->pool->whatProvides($job['packageName'], $job['constraint']);
- if ($packages) {
- foreach ($packages as $package) {
- if (!isset($this->installedMap[$package->id])) {
- $this->addRulesForPackage($package, $ignorePlatformReqs);
- }
- }
- $rule = $this->createInstallOneOfRule($packages, Rule::RULE_JOB_INSTALL, $job);
- $this->addRule(RuleSet::TYPE_JOB, $rule);
- }
- break;
- case 'remove':
-
- $packages = $this->pool->whatProvides($job['packageName'], $job['constraint']);
- foreach ($packages as $package) {
- $rule = $this->createRemoveRule($package, Rule::RULE_JOB_REMOVE, $job);
- $this->addRule(RuleSet::TYPE_JOB, $rule);
- }
- break;
- }
- }
- }
- public function getRulesFor($jobs, $installedMap, $ignorePlatformReqs = false)
- {
- $this->jobs = $jobs;
- $this->rules = new RuleSet;
- $this->installedMap = $installedMap;
- $this->whitelistedMap = array();
- foreach ($this->installedMap as $package) {
- $this->whitelistFromPackage($package);
- }
- $this->whitelistFromJobs();
- $this->pool->setWhitelist($this->whitelistedMap);
- $this->addedMap = array();
- foreach ($this->installedMap as $package) {
- $this->addRulesForPackage($package, $ignorePlatformReqs);
- }
- $this->addRulesForJobs($ignorePlatformReqs);
- return $this->rules;
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- class RuleSetIterator implements \Iterator
- {
- protected $rules;
- protected $types;
- protected $currentOffset;
- protected $currentType;
- protected $currentTypeOffset;
- public function __construct(array $rules)
- {
- $this->rules = $rules;
- $this->types = array_keys($rules);
- sort($this->types);
- $this->rewind();
- }
- public function current()
- {
- return $this->rules[$this->currentType][$this->currentOffset];
- }
- public function key()
- {
- return $this->currentType;
- }
- public function next()
- {
- $this->currentOffset++;
- if (!isset($this->rules[$this->currentType])) {
- return;
- }
- if ($this->currentOffset >= sizeof($this->rules[$this->currentType])) {
- $this->currentOffset = 0;
- do {
- $this->currentTypeOffset++;
- if (!isset($this->types[$this->currentTypeOffset])) {
- $this->currentType = -1;
- break;
- }
- $this->currentType = $this->types[$this->currentTypeOffset];
- } while (isset($this->types[$this->currentTypeOffset]) && !sizeof($this->rules[$this->currentType]));
- }
- }
- public function rewind()
- {
- $this->currentOffset = 0;
- $this->currentTypeOffset = -1;
- $this->currentType = -1;
- do {
- $this->currentTypeOffset++;
- if (!isset($this->types[$this->currentTypeOffset])) {
- $this->currentType = -1;
- break;
- }
- $this->currentType = $this->types[$this->currentTypeOffset];
- } while (isset($this->types[$this->currentTypeOffset]) && !sizeof($this->rules[$this->currentType]));
- }
- public function valid()
- {
- return isset($this->rules[$this->currentType])
- && isset($this->rules[$this->currentType][$this->currentOffset]);
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- class RuleWatchChain extends \SplDoublyLinkedList
- {
- protected $offset = 0;
- public function seek($offset)
- {
- $this->rewind();
- for ($i = 0; $i < $offset; $i++, $this->next());
- }
- public function remove()
- {
- $offset = $this->key();
- $this->offsetUnset($offset);
- $this->seek($offset);
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- class RuleWatchGraph
- {
- protected $watchChains = array();
- public function insert(RuleWatchNode $node)
- {
- if ($node->getRule()->isAssertion()) {
- return;
- }
- foreach (array($node->watch1, $node->watch2) as $literal) {
- if (!isset($this->watchChains[$literal])) {
- $this->watchChains[$literal] = new RuleWatchChain;
- }
- $this->watchChains[$literal]->unshift($node);
- }
- }
- public function propagateLiteral($decidedLiteral, $level, $decisions)
- {
-
-
- $literal = -$decidedLiteral;
- if (!isset($this->watchChains[$literal])) {
- return null;
- }
- $chain = $this->watchChains[$literal];
- $chain->rewind();
- while ($chain->valid()) {
- $node = $chain->current();
- $otherWatch = $node->getOtherWatch($literal);
- if (!$node->getRule()->isDisabled() && !$decisions->satisfy($otherWatch)) {
- $ruleLiterals = $node->getRule()->literals;
- $alternativeLiterals = array_filter($ruleLiterals, function ($ruleLiteral) use ($literal, $otherWatch, $decisions) {
- return $literal !== $ruleLiteral &&
- $otherWatch !== $ruleLiteral &&
- !$decisions->conflict($ruleLiteral);
- });
- if ($alternativeLiterals) {
- reset($alternativeLiterals);
- $this->moveWatch($literal, current($alternativeLiterals), $node);
- continue;
- }
- if ($decisions->conflict($otherWatch)) {
- return $node->getRule();
- }
- $decisions->decide($otherWatch, $level, $node->getRule());
- }
- $chain->next();
- }
- return null;
- }
- protected function moveWatch($fromLiteral, $toLiteral, $node)
- {
- if (!isset($this->watchChains[$toLiteral])) {
- $this->watchChains[$toLiteral] = new RuleWatchChain;
- }
- $node->moveWatch($fromLiteral, $toLiteral);
- $this->watchChains[$fromLiteral]->remove();
- $this->watchChains[$toLiteral]->unshift($node);
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- class RuleWatchNode
- {
- public $watch1;
- public $watch2;
- protected $rule;
- public function __construct($rule)
- {
- $this->rule = $rule;
- $literals = $rule->literals;
- $this->watch1 = count($literals) > 0 ? $literals[0] : 0;
- $this->watch2 = count($literals) > 1 ? $literals[1] : 0;
- }
- public function watch2OnHighest(Decisions $decisions)
- {
- $literals = $this->rule->literals;
- if (count($literals) < 3) {
- return;
- }
- $watchLevel = 0;
- foreach ($literals as $literal) {
- $level = $decisions->decisionLevel($literal);
- if ($level > $watchLevel) {
- $this->watch2 = $literal;
- $watchLevel = $level;
- }
- }
- }
- public function getRule()
- {
- return $this->rule;
- }
- public function getOtherWatch($literal)
- {
- if ($this->watch1 == $literal) {
- return $this->watch2;
- } else {
- return $this->watch1;
- }
- }
- public function moveWatch($from, $to)
- {
- if ($this->watch1 == $from) {
- $this->watch1 = $to;
- } else {
- $this->watch2 = $to;
- }
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- use Composer\Repository\RepositoryInterface;
- use Composer\Repository\PlatformRepository;
- class Solver
- {
- const BRANCH_LITERALS = 0;
- const BRANCH_LEVEL = 1;
- protected $policy;
- protected $pool;
- protected $installed;
- protected $rules;
- protected $ruleSetGenerator;
- protected $jobs;
- protected $updateMap = array();
- protected $watchGraph;
- protected $decisions;
- protected $installedMap;
- protected $propagateIndex;
- protected $branches = array();
- protected $problems = array();
- protected $learnedPool = array();
- protected $learnedWhy = array();
- public function __construct(PolicyInterface $policy, Pool $pool, RepositoryInterface $installed)
- {
- $this->policy = $policy;
- $this->pool = $pool;
- $this->installed = $installed;
- $this->ruleSetGenerator = new RuleSetGenerator($policy, $pool);
- }
- public function getRuleSetSize()
- {
- return count($this->rules);
- }
- private function makeAssertionRuleDecisions()
- {
- $decisionStart = count($this->decisions) - 1;
- $rulesCount = count($this->rules);
- for ($ruleIndex = 0; $ruleIndex < $rulesCount; $ruleIndex++) {
- $rule = $this->rules->ruleById[$ruleIndex];
- if (!$rule->isAssertion() || $rule->isDisabled()) {
- continue;
- }
- $literals = $rule->literals;
- $literal = $literals[0];
- if (!$this->decisions->decided(abs($literal))) {
- $this->decisions->decide($literal, 1, $rule);
- continue;
- }
- if ($this->decisions->satisfy($literal)) {
- continue;
- }
- if (RuleSet::TYPE_LEARNED === $rule->getType()) {
- $rule->disable();
- continue;
- }
- $conflict = $this->decisions->decisionRule($literal);
- if ($conflict && RuleSet::TYPE_PACKAGE === $conflict->getType()) {
- $problem = new Problem($this->pool);
- $problem->addRule($rule);
- $problem->addRule($conflict);
- $this->disableProblem($rule);
- $this->problems[] = $problem;
- continue;
- }
- $problem = new Problem($this->pool);
- $problem->addRule($rule);
- $problem->addRule($conflict);
-
- foreach ($this->rules->getIteratorFor(RuleSet::TYPE_JOB) as $assertRule) {
- if ($assertRule->isDisabled() || !$assertRule->isAssertion()) {
- continue;
- }
- $assertRuleLiterals = $assertRule->literals;
- $assertRuleLiteral = $assertRuleLiterals[0];
- if (abs($literal) !== abs($assertRuleLiteral)) {
- continue;
- }
- $problem->addRule($assertRule);
- $this->disableProblem($assertRule);
- }
- $this->problems[] = $problem;
- $this->decisions->resetToOffset($decisionStart);
- $ruleIndex = -1;
- }
- }
- protected function setupInstalledMap()
- {
- $this->installedMap = array();
- foreach ($this->installed->getPackages() as $package) {
- $this->installedMap[$package->id] = $package;
- }
- }
- protected function checkForRootRequireProblems($ignorePlatformReqs)
- {
- foreach ($this->jobs as $job) {
- switch ($job['cmd']) {
- case 'update':
- $packages = $this->pool->whatProvides($job['packageName'], $job['constraint']);
- foreach ($packages as $package) {
- if (isset($this->installedMap[$package->id])) {
- $this->updateMap[$package->id] = true;
- }
- }
- break;
- case 'update-all':
- foreach ($this->installedMap as $package) {
- $this->updateMap[$package->id] = true;
- }
- break;
- case 'install':
- if ($ignorePlatformReqs && preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $job['packageName'])) {
- break;
- }
- if (!$this->pool->whatProvides($job['packageName'], $job['constraint'])) {
- $problem = new Problem($this->pool);
- $problem->addRule(new Rule(array(), null, null, $job));
- $this->problems[] = $problem;
- }
- break;
- }
- }
- }
- public function solve(Request $request, $ignorePlatformReqs = false)
- {
- $this->jobs = $request->getJobs();
- $this->setupInstalledMap();
- $this->rules = $this->ruleSetGenerator->getRulesFor($this->jobs, $this->installedMap, $ignorePlatformReqs);
- $this->checkForRootRequireProblems($ignorePlatformReqs);
- $this->decisions = new Decisions($this->pool);
- $this->watchGraph = new RuleWatchGraph;
- foreach ($this->rules as $rule) {
- $this->watchGraph->insert(new RuleWatchNode($rule));
- }
- $this->makeAssertionRuleDecisions();
- $this->runSat(true);
- foreach ($this->installedMap as $packageId => $void) {
- if ($this->decisions->undecided($packageId)) {
- $this->decisions->decide(-$packageId, 1, null);
- }
- }
- if ($this->problems) {
- throw new SolverProblemsException($this->problems, $this->installedMap);
- }
- $transaction = new Transaction($this->policy, $this->pool, $this->installedMap, $this->decisions);
- return $transaction->getOperations();
- }
- protected function propagate($level)
- {
- while ($this->decisions->validOffset($this->propagateIndex)) {
- $decision = $this->decisions->atOffset($this->propagateIndex);
- $conflict = $this->watchGraph->propagateLiteral(
- $decision[Decisions::DECISION_LITERAL],
- $level,
- $this->decisions
- );
- $this->propagateIndex++;
- if ($conflict) {
- return $conflict;
- }
- }
- return null;
- }
- private function revert($level)
- {
- while (!$this->decisions->isEmpty()) {
- $literal = $this->decisions->lastLiteral();
- if ($this->decisions->undecided($literal)) {
- break;
- }
- $decisionLevel = $this->decisions->decisionLevel($literal);
- if ($decisionLevel <= $level) {
- break;
- }
- $this->decisions->revertLast();
- $this->propagateIndex = count($this->decisions);
- }
- while (!empty($this->branches) && $this->branches[count($this->branches) - 1][self::BRANCH_LEVEL] >= $level) {
- array_pop($this->branches);
- }
- }
- private function setPropagateLearn($level, $literal, $disableRules, Rule $rule)
- {
- $level++;
- $this->decisions->decide($literal, $level, $rule);
- while (true) {
- $rule = $this->propagate($level);
- if (!$rule) {
- break;
- }
- if ($level == 1) {
- return $this->analyzeUnsolvable($rule, $disableRules);
- }
- list($learnLiteral, $newLevel, $newRule, $why) = $this->analyze($level, $rule);
- if ($newLevel <= 0 || $newLevel >= $level) {
- throw new SolverBugException(
- "Trying to revert to invalid level ".(int) $newLevel." from level ".(int) $level."."
- );
- } elseif (!$newRule) {
- throw new SolverBugException(
- "No rule was learned from analyzing $rule at level $level."
- );
- }
- $level = $newLevel;
- $this->revert($level);
- $this->rules->add($newRule, RuleSet::TYPE_LEARNED);
- $this->learnedWhy[spl_object_hash($newRule)] = $why;
- $ruleNode = new RuleWatchNode($newRule);
- $ruleNode->watch2OnHighest($this->decisions);
- $this->watchGraph->insert($ruleNode);
- $this->decisions->decide($learnLiteral, $level, $newRule);
- }
- return $level;
- }
- private function selectAndInstall($level, array $decisionQueue, $disableRules, Rule $rule)
- {
- $literals = $this->policy->selectPreferredPackages($this->pool, $this->installedMap, $decisionQueue, $rule->getRequiredPackage());
- $selectedLiteral = array_shift($literals);
- if (count($literals)) {
- $this->branches[] = array($literals, $level);
- }
- return $this->setPropagateLearn($level, $selectedLiteral, $disableRules, $rule);
- }
- protected function analyze($level, Rule $rule)
- {
- $analyzedRule = $rule;
- $ruleLevel = 1;
- $num = 0;
- $l1num = 0;
- $seen = array();
- $learnedLiterals = array(null);
- $decisionId = count($this->decisions);
- $this->learnedPool[] = array();
- while (true) {
- $this->learnedPool[count($this->learnedPool) - 1][] = $rule;
- foreach ($rule->literals as $literal) {
- if ($this->decisions->satisfy($literal)) {
- continue;
- }
- if (isset($seen[abs($literal)])) {
- continue;
- }
- $seen[abs($literal)] = true;
- $l = $this->decisions->decisionLevel($literal);
- if (1 === $l) {
- $l1num++;
- } elseif ($level === $l) {
- $num++;
- } else {
- $learnedLiterals[] = $literal;
- if ($l > $ruleLevel) {
- $ruleLevel = $l;
- }
- }
- }
- $l1retry = true;
- while ($l1retry) {
- $l1retry = false;
- if (!$num && !--$l1num) {
- break 2;
- }
- while (true) {
- if ($decisionId <= 0) {
- throw new SolverBugException(
- "Reached invalid decision id $decisionId while looking through $rule for a literal present in the analyzed rule $analyzedRule."
- );
- }
- $decisionId--;
- $decision = $this->decisions->atOffset($decisionId);
- $literal = $decision[Decisions::DECISION_LITERAL];
- if (isset($seen[abs($literal)])) {
- break;
- }
- }
- unset($seen[abs($literal)]);
- if ($num && 0 === --$num) {
- $learnedLiterals[0] = -abs($literal);
- if (!$l1num) {
- break 2;
- }
- foreach ($learnedLiterals as $i => $learnedLiteral) {
- if ($i !== 0) {
- unset($seen[abs($learnedLiteral)]);
- }
- }
- $l1num++;
- $l1retry = true;
- }
- }
- $decision = $this->decisions->atOffset($decisionId);
- $rule = $decision[Decisions::DECISION_REASON];
- }
- $why = count($this->learnedPool) - 1;
- if (!$learnedLiterals[0]) {
- throw new SolverBugException(
- "Did not find a learnable literal in analyzed rule $analyzedRule."
- );
- }
- $newRule = new Rule($learnedLiterals, Rule::RULE_LEARNED, $why);
- return array($learnedLiterals[0], $ruleLevel, $newRule, $why);
- }
- private function analyzeUnsolvableRule(Problem $problem, Rule $conflictRule)
- {
- $why = spl_object_hash($conflictRule);
- if ($conflictRule->getType() == RuleSet::TYPE_LEARNED) {
- $learnedWhy = $this->learnedWhy[$why];
- $problemRules = $this->learnedPool[$learnedWhy];
- foreach ($problemRules as $problemRule) {
- $this->analyzeUnsolvableRule($problem, $problemRule);
- }
- return;
- }
- if ($conflictRule->getType() == RuleSet::TYPE_PACKAGE) {
- return;
- }
- $problem->nextSection();
- $problem->addRule($conflictRule);
- }
- private function analyzeUnsolvable(Rule $conflictRule, $disableRules)
- {
- $problem = new Problem($this->pool);
- $problem->addRule($conflictRule);
- $this->analyzeUnsolvableRule($problem, $conflictRule);
- $this->problems[] = $problem;
- $seen = array();
- $literals = $conflictRule->literals;
- foreach ($literals as $literal) {
- if ($this->decisions->satisfy($literal)) {
- continue;
- }
- $seen[abs($literal)] = true;
- }
- foreach ($this->decisions as $decision) {
- $literal = $decision[Decisions::DECISION_LITERAL];
- if (!isset($seen[abs($literal)])) {
- continue;
- }
- $why = $decision[Decisions::DECISION_REASON];
- $problem->addRule($why);
- $this->analyzeUnsolvableRule($problem, $why);
- $literals = $why->literals;
- foreach ($literals as $literal) {
- if ($this->decisions->satisfy($literal)) {
- continue;
- }
- $seen[abs($literal)] = true;
- }
- }
- if ($disableRules) {
- foreach ($this->problems[count($this->problems) - 1] as $reason) {
- $this->disableProblem($reason['rule']);
- }
- $this->resetSolver();
- return 1;
- }
- return 0;
- }
- private function disableProblem(Rule $why)
- {
- $job = $why->getJob();
- if (!$job) {
- $why->disable();
- return;
- }
- foreach ($this->rules as $rule) {
- if ($job === $rule->getJob()) {
- $rule->disable();
- }
- }
- }
- private function resetSolver()
- {
- $this->decisions->reset();
- $this->propagateIndex = 0;
- $this->branches = array();
- $this->enableDisableLearnedRules();
- $this->makeAssertionRuleDecisions();
- }
- private function enableDisableLearnedRules()
- {
- foreach ($this->rules->getIteratorFor(RuleSet::TYPE_LEARNED) as $rule) {
- $why = $this->learnedWhy[spl_object_hash($rule)];
- $problemRules = $this->learnedPool[$why];
- $foundDisabled = false;
- foreach ($problemRules as $problemRule) {
- if ($problemRule->isDisabled()) {
- $foundDisabled = true;
- break;
- }
- }
- if ($foundDisabled && $rule->isEnabled()) {
- $rule->disable();
- } elseif (!$foundDisabled && $rule->isDisabled()) {
- $rule->enable();
- }
- }
- }
- private function runSat($disableRules = true)
- {
- $this->propagateIndex = 0;
- $decisionQueue = array();
- $decisionSupplementQueue = array();
- $disableRules = array();
- $level = 1;
- $systemLevel = $level + 1;
- $installedPos = 0;
- while (true) {
- if (1 === $level) {
- $conflictRule = $this->propagate($level);
- if (null !== $conflictRule) {
- if ($this->analyzeUnsolvable($conflictRule, $disableRules)) {
- continue;
- }
- return;
- }
- }
- if ($level < $systemLevel) {
- $iterator = $this->rules->getIteratorFor(RuleSet::TYPE_JOB);
- foreach ($iterator as $rule) {
- if ($rule->isEnabled()) {
- $decisionQueue = array();
- $noneSatisfied = true;
- foreach ($rule->literals as $literal) {
- if ($this->decisions->satisfy($literal)) {
- $noneSatisfied = false;
- break;
- }
- if ($literal > 0 && $this->decisions->undecided($literal)) {
- $decisionQueue[] = $literal;
- }
- }
- if ($noneSatisfied && count($decisionQueue)) {
-
- if (count($this->installed) != count($this->updateMap)) {
- $prunedQueue = array();
- foreach ($decisionQueue as $literal) {
- if (isset($this->installedMap[abs($literal)])) {
- $prunedQueue[] = $literal;
- if (isset($this->updateMap[abs($literal)])) {
- $prunedQueue = $decisionQueue;
- break;
- }
- }
- }
- $decisionQueue = $prunedQueue;
- }
- }
- if ($noneSatisfied && count($decisionQueue)) {
- $oLevel = $level;
- $level = $this->selectAndInstall($level, $decisionQueue, $disableRules, $rule);
- if (0 === $level) {
- return;
- }
- if ($level <= $oLevel) {
- break;
- }
- }
- }
- }
- $systemLevel = $level + 1;
- $iterator->next();
- if ($iterator->valid()) {
- continue;
- }
- }
- if ($level < $systemLevel) {
- $systemLevel = $level;
- }
- for ($i = 0, $n = 0; $n < count($this->rules); $i++, $n++) {
- if ($i == count($this->rules)) {
- $i = 0;
- }
- $rule = $this->rules->ruleById[$i];
- $literals = $rule->literals;
- if ($rule->isDisabled()) {
- continue;
- }
- $decisionQueue = array();
-
-
-
-
-
- foreach ($literals as $literal) {
- if ($literal <= 0) {
- if (!$this->decisions->decidedInstall(abs($literal))) {
- continue 2;
- }
- } else {
- if ($this->decisions->decidedInstall(abs($literal))) {
- continue 2;
- }
- if ($this->decisions->undecided(abs($literal))) {
- $decisionQueue[] = $literal;
- }
- }
- }
- if (count($decisionQueue) < 2) {
- continue;
- }
- $oLevel = $level;
- $level = $this->selectAndInstall($level, $decisionQueue, $disableRules, $rule);
- if (0 === $level) {
- return;
- }
- $n = -1;
- }
- if ($level < $systemLevel) {
- continue;
- }
- if (count($this->branches)) {
- $lastLiteral = null;
- $lastLevel = null;
- $lastBranchIndex = 0;
- $lastBranchOffset = 0;
- $l = 0;
- for ($i = count($this->branches) - 1; $i >= 0; $i--) {
- list($literals, $l) = $this->branches[$i];
- foreach ($literals as $offset => $literal) {
- if ($literal && $literal > 0 && $this->decisions->decisionLevel($literal) > $l + 1) {
- $lastLiteral = $literal;
- $lastBranchIndex = $i;
- $lastBranchOffset = $offset;
- $lastLevel = $l;
- }
- }
- }
- if ($lastLiteral) {
- unset($this->branches[$lastBranchIndex][self::BRANCH_LITERALS][$lastBranchOffset]);
- $level = $lastLevel;
- $this->revert($level);
- $why = $this->decisions->lastReason();
- $oLevel = $level;
- $level = $this->setPropagateLearn($level, $lastLiteral, $disableRules, $why);
- if ($level == 0) {
- return;
- }
- continue;
- }
- }
- break;
- }
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- class SolverBugException extends \RuntimeException
- {
- public function __construct($message)
- {
- parent::__construct(
- $message."\nThis exception was most likely caused by a bug in Composer.\n".
- "Please report the command you ran, the exact error you received, and your composer.json on https://github.com/composer/composer/issues - thank you!\n");
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- class SolverProblemsException extends \RuntimeException
- {
- protected $problems;
- protected $installedMap;
- public function __construct(array $problems, array $installedMap)
- {
- $this->problems = $problems;
- $this->installedMap = $installedMap;
- parent::__construct($this->createMessage(), 2);
- }
- protected function createMessage()
- {
- $text = "\n";
- $hasExtensionProblems = false;
- foreach ($this->problems as $i => $problem) {
- $text .= " Problem ".($i + 1).$problem->getPrettyString($this->installedMap)."\n";
- if (!$hasExtensionProblems && $this->hasExtensionProblems($problem->getReasons())) {
- $hasExtensionProblems = true;
- }
- }
- if (strpos($text, 'could not be found') || strpos($text, 'no matching package found')) {
- $text .= "\nPotential causes:\n - A typo in the package name\n - The package is not available in a stable-enough version according to your minimum-stability setting\n see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.\n\nRead <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.";
- }
- if ($hasExtensionProblems) {
- $text .= $this->createExtensionHint();
- }
- return $text;
- }
- public function getProblems()
- {
- return $this->problems;
- }
- private function createExtensionHint()
- {
- $paths = array();
- if (($iniPath = php_ini_loaded_file()) !== false) {
- $paths[] = $iniPath;
- }
- if (!defined('HHVM_VERSION') && $additionalIniPaths = php_ini_scanned_files()) {
- $paths = array_merge($paths, array_map("trim", explode(",", $additionalIniPaths)));
- }
- if (count($paths) === 0) {
- return '';
- }
- $text = "\n To enable extensions, verify that they are enabled in those .ini files:\n - ";
- $text .= implode("\n - ", $paths);
- $text .= "\n You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.";
- return $text;
- }
- private function hasExtensionProblems(array $reasonSets)
- {
- foreach ($reasonSets as $reasonSet) {
- foreach ($reasonSet as $reason) {
- if (isset($reason["rule"]) && 0 === strpos($reason["rule"]->getRequiredPackage(), 'ext-')) {
- return true;
- }
- }
- }
- return false;
- }
- }
- <?php
- namespace Composer\DependencyResolver;
- use Composer\Package\AliasPackage;
- class Transaction
- {
- protected $policy;
- protected $pool;
- protected $installedMap;
- protected $decisions;
- protected $transaction;
- public function __construct($policy, $pool, $installedMap, $decisions)
- {
- $this->policy = $policy;
- $this->pool = $pool;
- $this->installedMap = $installedMap;
- $this->decisions = $decisions;
- $this->transaction = array();
- }
- public function getOperations()
- {
- $installMeansUpdateMap = $this->findUpdates();
- $updateMap = array();
- $installMap = array();
- $uninstallMap = array();
- foreach ($this->decisions as $i => $decision) {
- $literal = $decision[Decisions::DECISION_LITERAL];
- $reason = $decision[Decisions::DECISION_REASON];
- $package = $this->pool->literalToPackage($literal);
- if (($literal > 0) == (isset($this->installedMap[$package->id]))) {
- continue;
- }
- if ($literal > 0) {
- if (isset($installMeansUpdateMap[abs($literal)]) && !$package instanceof AliasPackage) {
- $source = $installMeansUpdateMap[abs($literal)];
- $updateMap[$package->id] = array(
- 'package' => $package,
- 'source' => $source,
- 'reason' => $reason,
- );
- unset($installMeansUpdateMap[abs($literal)]);
- $ignoreRemove[$source->id] = true;
- } else {
- $installMap[$package->id] = array(
- 'package' => $package,
- 'reason' => $reason,
- );
- }
- }
- }
- foreach ($this->decisions as $i => $decision) {
- $literal = $decision[Decisions::DECISION_LITERAL];
- $reason = $decision[Decisions::DECISION_REASON];
- $package = $this->pool->literalToPackage($literal);
- if ($literal <= 0 &&
- isset($this->installedMap[$package->id]) &&
- !isset($ignoreRemove[$package->id])) {
- $uninstallMap[$package->id] = array(
- 'package' => $package,
- 'reason' => $reason,
- );
- }
- }
- $this->transactionFromMaps($installMap, $updateMap, $uninstallMap);
- return $this->transaction;
- }
- protected function transactionFromMaps($installMap, $updateMap, $uninstallMap)
- {
- $queue = array_map(function ($operation) {
- return $operation['package'];
- },
- $this->findRootPackages($installMap, $updateMap)
- );
- $visited = array();
- while (!empty($queue)) {
- $package = array_pop($queue);
- $packageId = $package->id;
- if (!isset($visited[$packageId])) {
- array_push($queue, $package);
- if ($package instanceof AliasPackage) {
- array_push($queue, $package->getAliasOf());
- } else {
- foreach ($package->getRequires() as $link) {
- $possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint());
- foreach ($possibleRequires as $require) {
- array_push($queue, $require);
- }
- }
- }
- $visited[$package->id] = true;
- } else {
- if (isset($installMap[$packageId])) {
- $this->install(
- $installMap[$packageId]['package'],
- $installMap[$packageId]['reason']
- );
- unset($installMap[$packageId]);
- }
- if (isset($updateMap[$packageId])) {
- $this->update(
- $updateMap[$packageId]['source'],
- $updateMap[$packageId]['package'],
- $updateMap[$packageId]['reason']
- );
- unset($updateMap[$packageId]);
- }
- }
- }
- foreach ($uninstallMap as $uninstall) {
- $this->uninstall($uninstall['package'], $uninstall['reason']);
- }
- }
- protected function findRootPackages($installMap, $updateMap)
- {
- $packages = $installMap + $updateMap;
- $roots = $packages;
- foreach ($packages as $packageId => $operation) {
- $package = $operation['package'];
- if (!isset($roots[$packageId])) {
- continue;
- }
- foreach ($package->getRequires() as $link) {
- $possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint());
- foreach ($possibleRequires as $require) {
- unset($roots[$require->id]);
- }
- }
- }
- return $roots;
- }
- protected function findUpdates()
- {
- $installMeansUpdateMap = array();
- foreach ($this->decisions as $i => $decision) {
- $literal = $decision[Decisions::DECISION_LITERAL];
- $package = $this->pool->literalToPackage($literal);
- if ($package instanceof AliasPackage) {
- continue;
- }
- if ($literal <= 0 && isset($this->installedMap[$package->id])) {
- $updates = $this->policy->findUpdatePackages($this->pool, $this->installedMap, $package);
- $literals = array($package->id);
- foreach ($updates as $update) {
- $literals[] = $update->id;
- }
- foreach ($literals as $updateLiteral) {
- if ($updateLiteral !== $literal) {
- $installMeansUpdateMap[abs($updateLiteral)] = $package;
- }
- }
- }
- }
- return $installMeansUpdateMap;
- }
- protected function install($package, $reason)
- {
- if ($package instanceof AliasPackage) {
- return $this->markAliasInstalled($package, $reason);
- }
- $this->transaction[] = new Operation\InstallOperation($package, $reason);
- }
- protected function update($from, $to, $reason)
- {
- $this->transaction[] = new Operation\UpdateOperation($from, $to, $reason);
- }
- protected function uninstall($package, $reason)
- {
- if ($package instanceof AliasPackage) {
- return $this->markAliasUninstalled($package, $reason);
- }
- $this->transaction[] = new Operation\UninstallOperation($package, $reason);
- }
- protected function markAliasInstalled($package, $reason)
- {
- $this->transaction[] = new Operation\MarkAliasInstalledOperation($package, $reason);
- }
- protected function markAliasUninstalled($package, $reason)
- {
- $this->transaction[] = new Operation\MarkAliasUninstalledOperation($package, $reason);
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Package\PackageInterface;
- use Symfony\Component\Finder\Finder;
- use Composer\IO\IOInterface;
- abstract class ArchiveDownloader extends FileDownloader
- {
- public function download(PackageInterface $package, $path)
- {
- $temporaryDir = $this->config->get('vendor-dir').'/composer/'.substr(md5(uniqid('', true)), 0, 8);
- $retries = 3;
- while ($retries--) {
- $fileName = parent::download($package, $path);
- $this->io->writeError(' Extracting archive', true, IOInterface::VERBOSE);
- try {
- $this->filesystem->ensureDirectoryExists($temporaryDir);
- try {
- $this->extract($fileName, $temporaryDir);
- } catch (\Exception $e) {
- parent::clearLastCacheWrite($package);
- throw $e;
- }
- $this->filesystem->unlink($fileName);
- $contentDir = $this->getFolderContent($temporaryDir);
- if (1 === count($contentDir) && is_dir(reset($contentDir))) {
- $contentDir = $this->getFolderContent((string) reset($contentDir));
- }
- foreach ($contentDir as $file) {
- $file = (string) $file;
- $this->filesystem->rename($file, $path . '/' . basename($file));
- }
- $this->filesystem->removeDirectory($temporaryDir);
- if ($this->filesystem->isDirEmpty($this->config->get('vendor-dir').'/composer/')) {
- $this->filesystem->removeDirectory($this->config->get('vendor-dir').'/composer/');
- }
- if ($this->filesystem->isDirEmpty($this->config->get('vendor-dir'))) {
- $this->filesystem->removeDirectory($this->config->get('vendor-dir'));
- }
- } catch (\Exception $e) {
- $this->filesystem->removeDirectory($path);
- $this->filesystem->removeDirectory($temporaryDir);
- if ($retries && $e instanceof \UnexpectedValueException && class_exists('ZipArchive') && $e->getCode() === \ZipArchive::ER_NOZIP) {
- if ($this->io->isDebug()) {
- $this->io->writeError(' Invalid zip file ('.$e->getMessage().'), retrying...');
- } else {
- $this->io->writeError(' Invalid zip file, retrying...');
- }
- usleep(500000);
- continue;
- }
- throw $e;
- }
- break;
- }
- $this->io->writeError('');
- }
- protected function getFileName(PackageInterface $package, $path)
- {
- return rtrim($path.'/'.md5($path.spl_object_hash($package)).'.'.pathinfo(parse_url($package->getDistUrl(), PHP_URL_PATH), PATHINFO_EXTENSION), '.');
- }
- protected function processUrl(PackageInterface $package, $url)
- {
- if ($package->getDistReference() && strpos($url, 'github.com')) {
- if (preg_match('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/(zip|tar)ball/(.+)$}i', $url, $match)) {
- $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $package->getDistReference();
- } elseif ($package->getDistReference() && preg_match('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/archive/.+\.(zip|tar)(?:\.gz)?$}i', $url, $match)) {
- $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $package->getDistReference();
- } elseif ($package->getDistReference() && preg_match('{^https?://api\.github\.com/repos/([^/]+)/([^/]+)/(zip|tar)ball(?:/.+)?$}i', $url, $match)) {
- $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $package->getDistReference();
- }
- } elseif ($package->getDistReference() && strpos($url, 'bitbucket.org')) {
- if (preg_match('{^https?://(?:www\.)?bitbucket\.org/([^/]+)/([^/]+)/get/(.+)\.(zip|tar\.gz|tar\.bz2)$}i', $url, $match)) {
- $url = 'https://bitbucket.org/' . $match[1] . '/'. $match[2] . '/get/' . $package->getDistReference() . '.' . $match[4];
- }
- }
- return parent::processUrl($package, $url);
- }
- abstract protected function extract($file, $path);
- private function getFolderContent($dir)
- {
- $finder = Finder::create()
- ->ignoreVCS(false)
- ->ignoreDotFiles(false)
- ->depth(0)
- ->in($dir);
- return iterator_to_array($finder);
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Package\PackageInterface;
- interface ChangeReportInterface
- {
- public function getLocalChanges(PackageInterface $package, $path);
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Package\PackageInterface;
- use Composer\IO\IOInterface;
- use Composer\Util\Filesystem;
- class DownloadManager
- {
- private $io;
- private $preferDist = false;
- private $preferSource = false;
- private $filesystem;
- private $downloaders = array();
- public function __construct(IOInterface $io, $preferSource = false, Filesystem $filesystem = null)
- {
- $this->io = $io;
- $this->preferSource = $preferSource;
- $this->filesystem = $filesystem ?: new Filesystem();
- }
- public function setPreferSource($preferSource)
- {
- $this->preferSource = $preferSource;
- return $this;
- }
- public function setPreferDist($preferDist)
- {
- $this->preferDist = $preferDist;
- return $this;
- }
- public function setOutputProgress($outputProgress)
- {
- foreach ($this->downloaders as $downloader) {
- $downloader->setOutputProgress($outputProgress);
- }
- return $this;
- }
- public function setDownloader($type, DownloaderInterface $downloader)
- {
- $type = strtolower($type);
- $this->downloaders[$type] = $downloader;
- return $this;
- }
- public function getDownloader($type)
- {
- $type = strtolower($type);
- if (!isset($this->downloaders[$type])) {
- throw new \InvalidArgumentException(sprintf('Unknown downloader type: %s. Available types: %s.', $type, implode(', ', array_keys($this->downloaders))));
- }
- return $this->downloaders[$type];
- }
- public function getDownloaderForInstalledPackage(PackageInterface $package)
- {
- $installationSource = $package->getInstallationSource();
- if ('metapackage' === $package->getType()) {
- return;
- }
- if ('dist' === $installationSource) {
- $downloader = $this->getDownloader($package->getDistType());
- } elseif ('source' === $installationSource) {
- $downloader = $this->getDownloader($package->getSourceType());
- } else {
- throw new \InvalidArgumentException(
- 'Package '.$package.' seems not been installed properly'
- );
- }
- if ($installationSource !== $downloader->getInstallationSource()) {
- throw new \LogicException(sprintf(
- 'Downloader "%s" is a %s type downloader and can not be used to download %s',
- get_class($downloader), $downloader->getInstallationSource(), $installationSource
- ));
- }
- return $downloader;
- }
- public function download(PackageInterface $package, $targetDir, $preferSource = null)
- {
- $preferSource = null !== $preferSource ? $preferSource : $this->preferSource;
- $sourceType = $package->getSourceType();
- $distType = $package->getDistType();
- $sources = array();
- if ($sourceType) {
- $sources[] = 'source';
- }
- if ($distType) {
- $sources[] = 'dist';
- }
- if (empty($sources)) {
- throw new \InvalidArgumentException('Package '.$package.' must have a source or dist specified');
- }
- if ((!$package->isDev() || $this->preferDist) && !$preferSource) {
- $sources = array_reverse($sources);
- }
- $this->filesystem->ensureDirectoryExists($targetDir);
- foreach ($sources as $i => $source) {
- if (isset($e)) {
- $this->io->writeError(' <warning>Now trying to download from ' . $source . '</warning>');
- }
- $package->setInstallationSource($source);
- try {
- $downloader = $this->getDownloaderForInstalledPackage($package);
- if ($downloader) {
- $downloader->download($package, $targetDir);
- }
- break;
- } catch (\RuntimeException $e) {
- if ($i === count($sources) - 1) {
- throw $e;
- }
- $this->io->writeError(
- ' <warning>Failed to download '.
- $package->getPrettyName().
- ' from ' . $source . ': '.
- $e->getMessage().'</warning>'
- );
- }
- }
- }
- public function update(PackageInterface $initial, PackageInterface $target, $targetDir)
- {
- $downloader = $this->getDownloaderForInstalledPackage($initial);
- if (!$downloader) {
- return;
- }
- $installationSource = $initial->getInstallationSource();
- if ('dist' === $installationSource) {
- $initialType = $initial->getDistType();
- $targetType = $target->getDistType();
- } else {
- $initialType = $initial->getSourceType();
- $targetType = $target->getSourceType();
- }
- if ($target->isDev() && 'dist' === $installationSource) {
- $downloader->remove($initial, $targetDir);
- $this->download($target, $targetDir);
- return;
- }
- if ($initialType === $targetType) {
- $target->setInstallationSource($installationSource);
- try {
- $downloader->update($initial, $target, $targetDir);
- return;
- } catch (\RuntimeException $e) {
- if (!$this->io->isInteractive()) {
- throw $e;
- }
- $this->io->writeError('<error> Update failed ('.$e->getMessage().')</error>');
- if (!$this->io->askConfirmation(' Would you like to try reinstalling the package instead [<comment>yes</comment>]? ', true)) {
- throw $e;
- }
- }
- }
- $downloader->remove($initial, $targetDir);
- $this->download($target, $targetDir, 'source' === $installationSource);
- }
- public function remove(PackageInterface $package, $targetDir)
- {
- $downloader = $this->getDownloaderForInstalledPackage($package);
- if ($downloader) {
- $downloader->remove($package, $targetDir);
- }
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Package\PackageInterface;
- interface DownloaderInterface
- {
- public function getInstallationSource();
- public function download(PackageInterface $package, $path);
- public function update(PackageInterface $initial, PackageInterface $target, $path);
- public function remove(PackageInterface $package, $path);
- public function setOutputProgress($outputProgress);
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Config;
- use Composer\Cache;
- use Composer\Factory;
- use Composer\IO\IOInterface;
- use Composer\Package\PackageInterface;
- use Composer\Plugin\PluginEvents;
- use Composer\Plugin\PreFileDownloadEvent;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Util\Filesystem;
- use Composer\Util\RemoteFilesystem;
- class FileDownloader implements DownloaderInterface
- {
- protected $io;
- protected $config;
- protected $rfs;
- protected $filesystem;
- protected $cache;
- protected $outputProgress = true;
- private $lastCacheWrites = array();
- public function __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, RemoteFilesystem $rfs = null, Filesystem $filesystem = null)
- {
- $this->io = $io;
- $this->config = $config;
- $this->eventDispatcher = $eventDispatcher;
- $this->rfs = $rfs ?: Factory::createRemoteFilesystem($this->io, $config);
- $this->filesystem = $filesystem ?: new Filesystem();
- $this->cache = $cache;
- if ($this->cache && $this->cache->gcIsNecessary()) {
- $this->cache->gc($config->get('cache-files-ttl'), $config->get('cache-files-maxsize'));
- }
- }
- public function getInstallationSource()
- {
- return 'dist';
- }
- public function download(PackageInterface $package, $path)
- {
- if (!$package->getDistUrl()) {
- throw new \InvalidArgumentException('The given package is missing url information');
- }
- $this->io->writeError(" - Installing <info>" . $package->getName() . "</info> (<comment>" . $package->getFullPrettyVersion() . "</comment>)");
- $urls = $package->getDistUrls();
- while ($url = array_shift($urls)) {
- try {
- return $this->doDownload($package, $path, $url);
- } catch (\Exception $e) {
- if ($this->io->isDebug()) {
- $this->io->writeError('');
- $this->io->writeError('Failed: ['.get_class($e).'] '.$e->getCode().': '.$e->getMessage());
- } elseif (count($urls)) {
- $this->io->writeError('');
- $this->io->writeError(' Failed, trying the next URL ('.$e->getCode().': '.$e->getMessage().')');
- }
- if (!count($urls)) {
- throw $e;
- }
- }
- }
- $this->io->writeError('');
- }
- protected function doDownload(PackageInterface $package, $path, $url)
- {
- $this->filesystem->emptyDirectory($path);
- $fileName = $this->getFileName($package, $path);
- $processedUrl = $this->processUrl($package, $url);
- $hostname = parse_url($processedUrl, PHP_URL_HOST);
- $preFileDownloadEvent = new PreFileDownloadEvent(PluginEvents::PRE_FILE_DOWNLOAD, $this->rfs, $processedUrl);
- if ($this->eventDispatcher) {
- $this->eventDispatcher->dispatch($preFileDownloadEvent->getName(), $preFileDownloadEvent);
- }
- $rfs = $preFileDownloadEvent->getRemoteFilesystem();
- try {
- $checksum = $package->getDistSha1Checksum();
- $cacheKey = $this->getCacheKey($package, $processedUrl);
- if (!$this->cache || ($checksum && $checksum !== $this->cache->sha1($cacheKey)) || !$this->cache->copyTo($cacheKey, $fileName)) {
- if (!$this->outputProgress) {
- $this->io->writeError(' Downloading');
- }
- $retries = 3;
- while ($retries--) {
- try {
- $rfs->copy($hostname, $processedUrl, $fileName, $this->outputProgress, $package->getTransportOptions());
- break;
- } catch (TransportException $e) {
- if ((0 !== $e->getCode() && !in_array($e->getCode(), array(500, 502, 503, 504))) || !$retries) {
- throw $e;
- }
- $this->io->writeError(' Download failed, retrying...', true, IOInterface::VERBOSE);
- usleep(500000);
- }
- }
- if ($this->cache) {
- $this->lastCacheWrites[$package->getName()] = $cacheKey;
- $this->cache->copyFrom($cacheKey, $fileName);
- }
- } else {
- $this->io->writeError(' Loading from cache');
- }
- if (!file_exists($fileName)) {
- throw new \UnexpectedValueException($url.' could not be saved to '.$fileName.', make sure the'
- .' directory is writable and you have internet connectivity');
- }
- if ($checksum && hash_file('sha1', $fileName) !== $checksum) {
- throw new \UnexpectedValueException('The checksum verification of the file failed (downloaded from '.$url.')');
- }
- } catch (\Exception $e) {
- $this->filesystem->removeDirectory($path);
- $this->clearLastCacheWrite($package);
- throw $e;
- }
- return $fileName;
- }
- public function setOutputProgress($outputProgress)
- {
- $this->outputProgress = $outputProgress;
- return $this;
- }
- protected function clearLastCacheWrite(PackageInterface $package)
- {
- if ($this->cache && isset($this->lastCacheWrites[$package->getName()])) {
- $this->cache->remove($this->lastCacheWrites[$package->getName()]);
- unset($this->lastCacheWrites[$package->getName()]);
- }
- }
- public function update(PackageInterface $initial, PackageInterface $target, $path)
- {
- $this->remove($initial, $path);
- $this->download($target, $path);
- }
- public function remove(PackageInterface $package, $path)
- {
- $this->io->writeError(" - Removing <info>" . $package->getName() . "</info> (<comment>" . $package->getFullPrettyVersion() . "</comment>)");
- if (!$this->filesystem->removeDirectory($path)) {
- throw new \RuntimeException('Could not completely delete '.$path.', aborting.');
- }
- }
- protected function getFileName(PackageInterface $package, $path)
- {
- return $path.'/'.pathinfo(parse_url($package->getDistUrl(), PHP_URL_PATH), PATHINFO_BASENAME);
- }
- protected function processUrl(PackageInterface $package, $url)
- {
- if (!extension_loaded('openssl') && 0 === strpos($url, 'https:')) {
- throw new \RuntimeException('You must enable the openssl extension to download files via https');
- }
- return $url;
- }
- private function getCacheKey(PackageInterface $package, $processedUrl)
- {
-
-
-
- $cacheKey = sha1($processedUrl);
- return $package->getName().'/'.$cacheKey.'.'.$package->getDistType();
- }
- }
- <?php
- namespace Composer\Downloader;
- class FilesystemException extends \Exception
- {
- public function __construct($message = '', $code = 0, \Exception $previous = null)
- {
- parent::__construct("Filesystem exception: \n".$message, $code, $previous);
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Package\PackageInterface;
- use Composer\Util\Git as GitUtil;
- use Composer\Util\Platform;
- use Composer\Util\ProcessExecutor;
- use Composer\IO\IOInterface;
- use Composer\Util\Filesystem;
- use Composer\Config;
- class GitDownloader extends VcsDownloader
- {
- private $hasStashedChanges = false;
- private $hasDiscardedChanges = false;
- private $gitUtil;
- public function __construct(IOInterface $io, Config $config, ProcessExecutor $process = null, Filesystem $fs = null)
- {
- parent::__construct($io, $config, $process, $fs);
- $this->gitUtil = new GitUtil($this->io, $this->config, $this->process, $this->filesystem);
- }
- public function doDownload(PackageInterface $package, $path, $url)
- {
- GitUtil::cleanEnv();
- $path = $this->normalizePath($path);
- $ref = $package->getSourceReference();
- $flag = Platform::isWindows() ? '/D ' : '';
- $command = 'git clone --no-checkout %s %s && cd '.$flag.'%2$s && git remote add composer %1$s && git fetch composer';
- $this->io->writeError(" Cloning ".$ref);
- $commandCallable = function ($url) use ($ref, $path, $command) {
- return sprintf($command, ProcessExecutor::escape($url), ProcessExecutor::escape($path), ProcessExecutor::escape($ref));
- };
- $this->gitUtil->runCommand($commandCallable, $url, $path, true);
- if ($url !== $package->getSourceUrl()) {
- $url = $package->getSourceUrl();
- $this->process->execute(sprintf('git remote set-url origin %s', ProcessExecutor::escape($url)), $output, $path);
- }
- $this->setPushUrl($path, $url);
- if ($newRef = $this->updateToCommit($path, $ref, $package->getPrettyVersion(), $package->getReleaseDate())) {
- if ($package->getDistReference() === $package->getSourceReference()) {
- $package->setDistReference($newRef);
- }
- $package->setSourceReference($newRef);
- }
- }
- public function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url)
- {
- GitUtil::cleanEnv();
- if (!$this->hasMetadataRepository($path)) {
- throw new \RuntimeException('The .git directory is missing from '.$path.', see https://getcomposer.org/commit-deps for more information');
- }
- $ref = $target->getSourceReference();
- $this->io->writeError(" Checking out ".$ref);
- $command = 'git remote set-url composer %s && git fetch composer && git fetch --tags composer';
- $commandCallable = function ($url) use ($command) {
- return sprintf($command, ProcessExecutor::escape($url));
- };
- $this->gitUtil->runCommand($commandCallable, $url, $path);
- if ($newRef = $this->updateToCommit($path, $ref, $target->getPrettyVersion(), $target->getReleaseDate())) {
- if ($target->getDistReference() === $target->getSourceReference()) {
- $target->setDistReference($newRef);
- }
- $target->setSourceReference($newRef);
- }
- }
- public function getLocalChanges(PackageInterface $package, $path)
- {
- GitUtil::cleanEnv();
- if (!$this->hasMetadataRepository($path)) {
- return;
- }
- $command = 'git status --porcelain --untracked-files=no';
- if (0 !== $this->process->execute($command, $output, $path)) {
- throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
- }
- return trim($output) ?: null;
- }
- protected function cleanChanges(PackageInterface $package, $path, $update)
- {
- GitUtil::cleanEnv();
- $path = $this->normalizePath($path);
- if (!$changes = $this->getLocalChanges($package, $path)) {
- return;
- }
- if (!$this->io->isInteractive()) {
- $discardChanges = $this->config->get('discard-changes');
- if (true === $discardChanges) {
- return $this->discardChanges($path);
- }
- if ('stash' === $discardChanges) {
- if (!$update) {
- return parent::cleanChanges($package, $path, $update);
- }
- return $this->stashChanges($path);
- }
- return parent::cleanChanges($package, $path, $update);
- }
- $changes = array_map(function ($elem) {
- return ' '.$elem;
- }, preg_split('{\s*\r?\n\s*}', $changes));
- $this->io->writeError(' <error>The package has modified files:</error>');
- $this->io->writeError(array_slice($changes, 0, 10));
- if (count($changes) > 10) {
- $this->io->writeError(' <info>'.count($changes) - 10 . ' more files modified, choose "v" to view the full list</info>');
- }
- while (true) {
- switch ($this->io->ask(' <info>Discard changes [y,n,v,d,'.($update ? 's,' : '').'?]?</info> ', '?')) {
- case 'y':
- $this->discardChanges($path);
- break 2;
- case 's':
- if (!$update) {
- goto help;
- }
- $this->stashChanges($path);
- break 2;
- case 'n':
- throw new \RuntimeException('Update aborted');
- case 'v':
- $this->io->writeError($changes);
- break;
- case 'd':
- $this->viewDiff($path);
- break;
- case '?':
- default:
- help:
- $this->io->writeError(array(
- ' y - discard changes and apply the '.($update ? 'update' : 'uninstall'),
- ' n - abort the '.($update ? 'update' : 'uninstall').' and let you manually clean things up',
- ' v - view modified files',
- ' d - view local modifications (diff)',
- ));
- if ($update) {
- $this->io->writeError(' s - stash changes and try to reapply them after the update');
- }
- $this->io->writeError(' ? - print help');
- break;
- }
- }
- }
- protected function reapplyChanges($path)
- {
- $path = $this->normalizePath($path);
- if ($this->hasStashedChanges) {
- $this->hasStashedChanges = false;
- $this->io->writeError(' <info>Re-applying stashed changes</info>');
- if (0 !== $this->process->execute('git stash pop', $output, $path)) {
- throw new \RuntimeException("Failed to apply stashed changes:\n\n".$this->process->getErrorOutput());
- }
- }
- $this->hasDiscardedChanges = false;
- }
- protected function updateToCommit($path, $reference, $branch, $date)
- {
- $force = $this->hasDiscardedChanges || $this->hasStashedChanges ? '-f ' : '';
-
-
-
-
- $template = 'git checkout '.$force.'%s -- && git reset --hard %1$s --';
- $branch = preg_replace('{(?:^dev-|(?:\.x)?-dev$)}i', '', $branch);
- $branches = null;
- if (0 === $this->process->execute('git branch -r', $output, $path)) {
- $branches = $output;
- }
- $gitRef = $reference;
- if (!preg_match('{^[a-f0-9]{40}$}', $reference)
- && $branches
- && preg_match('{^\s+composer/'.preg_quote($reference).'$}m', $branches)
- ) {
- $command = sprintf('git checkout '.$force.'-B %s %s -- && git reset --hard %2$s --', ProcessExecutor::escape($branch), ProcessExecutor::escape('composer/'.$reference));
- if (0 === $this->process->execute($command, $output, $path)) {
- return;
- }
- }
- if (preg_match('{^[a-f0-9]{40}$}', $reference)) {
- if (!preg_match('{^\s+composer/'.preg_quote($branch).'$}m', $branches) && preg_match('{^\s+composer/v'.preg_quote($branch).'$}m', $branches)) {
- $branch = 'v' . $branch;
- }
- $command = sprintf('git checkout %s --', ProcessExecutor::escape($branch));
- $fallbackCommand = sprintf('git checkout '.$force.'-B %s %s --', ProcessExecutor::escape($branch), ProcessExecutor::escape('composer/'.$branch));
- if (0 === $this->process->execute($command, $output, $path)
- || 0 === $this->process->execute($fallbackCommand, $output, $path)
- ) {
- $command = sprintf('git reset --hard %s --', ProcessExecutor::escape($reference));
- if (0 === $this->process->execute($command, $output, $path)) {
- return;
- }
- }
- }
- $command = sprintf($template, ProcessExecutor::escape($gitRef));
- if (0 === $this->process->execute($command, $output, $path)) {
- return;
- }
- if (false !== strpos($this->process->getErrorOutput(), $reference)) {
- $this->io->writeError(' <warning>'.$reference.' is gone (history was rewritten?)</warning>');
- }
- throw new \RuntimeException('Failed to execute ' . GitUtil::sanitizeUrl($command) . "\n\n" . $this->process->getErrorOutput());
- }
- protected function setPushUrl($path, $url)
- {
- if (preg_match('{^(?:https?|git)://'.GitUtil::getGitHubDomainsRegex($this->config).'/([^/]+)/([^/]+?)(?:\.git)?$}', $url, $match)) {
- $protocols = $this->config->get('github-protocols');
- $pushUrl = 'git@'.$match[1].':'.$match[2].'/'.$match[3].'.git';
- if ($protocols[0] !== 'git') {
- $pushUrl = 'https://' . $match[1] . '/'.$match[2].'/'.$match[3].'.git';
- }
- $cmd = sprintf('git remote set-url --push origin %s', ProcessExecutor::escape($pushUrl));
- $this->process->execute($cmd, $ignoredOutput, $path);
- }
- }
- protected function getCommitLogs($fromReference, $toReference, $path)
- {
- $path = $this->normalizePath($path);
- $command = sprintf('git log %s..%s --pretty=format:"%%h - %%an: %%s"', $fromReference, $toReference);
- if (0 !== $this->process->execute($command, $output, $path)) {
- throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
- }
- return $output;
- }
- protected function discardChanges($path)
- {
- $path = $this->normalizePath($path);
- if (0 !== $this->process->execute('git reset --hard', $output, $path)) {
- throw new \RuntimeException("Could not reset changes\n\n:".$this->process->getErrorOutput());
- }
- $this->hasDiscardedChanges = true;
- }
- protected function stashChanges($path)
- {
- $path = $this->normalizePath($path);
- if (0 !== $this->process->execute('git stash --include-untracked', $output, $path)) {
- throw new \RuntimeException("Could not stash changes\n\n:".$this->process->getErrorOutput());
- }
- $this->hasStashedChanges = true;
- }
- protected function viewDiff($path)
- {
- $path = $this->normalizePath($path);
- if (0 !== $this->process->execute('git diff HEAD', $output, $path)) {
- throw new \RuntimeException("Could not view diff\n\n:".$this->process->getErrorOutput());
- }
- $this->io->writeError($output);
- }
- protected function normalizePath($path)
- {
- if (Platform::isWindows() && strlen($path) > 0) {
- $basePath = $path;
- $removed = array();
- while (!is_dir($basePath) && $basePath !== '\\') {
- array_unshift($removed, basename($basePath));
- $basePath = dirname($basePath);
- }
- if ($basePath === '\\') {
- return $path;
- }
- $path = rtrim(realpath($basePath) . '/' . implode('/', $removed), '/');
- }
- return $path;
- }
- protected function hasMetadataRepository($path)
- {
- $path = $this->normalizePath($path);
- return is_dir($path.'/.git');
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Config;
- use Composer\Cache;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Package\PackageInterface;
- use Composer\Util\Platform;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\RemoteFilesystem;
- use Composer\IO\IOInterface;
- class GzipDownloader extends ArchiveDownloader
- {
- protected $process;
- public function __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, ProcessExecutor $process = null, RemoteFilesystem $rfs = null)
- {
- $this->process = $process ?: new ProcessExecutor($io);
- parent::__construct($io, $config, $eventDispatcher, $cache, $rfs);
- }
- protected function extract($file, $path)
- {
- $targetFilepath = $path . DIRECTORY_SEPARATOR . basename(substr($file, 0, -3));
- if (!Platform::isWindows()) {
- $command = 'gzip -cd ' . ProcessExecutor::escape($file) . ' > ' . ProcessExecutor::escape($targetFilepath);
- if (0 === $this->process->execute($command, $ignoredOutput)) {
- return;
- }
- if (extension_loaded('zlib')) {
- $this->extractUsingExt($file, $targetFilepath);
- return;
- }
- $processError = 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput();
- throw new \RuntimeException($processError);
- }
- $this->extractUsingExt($file, $targetFilepath);
- }
- protected function getFileName(PackageInterface $package, $path)
- {
- return $path.'/'.pathinfo(parse_url($package->getDistUrl(), PHP_URL_PATH), PATHINFO_BASENAME);
- }
- private function extractUsingExt($file, $targetFilepath)
- {
- $archiveFile = gzopen($file, 'rb');
- $targetFile = fopen($targetFilepath, 'wb');
- while ($string = gzread($archiveFile, 4096)) {
- fwrite($targetFile, $string, strlen($string));
- }
- gzclose($archiveFile);
- fclose($targetFile);
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Package\PackageInterface;
- use Composer\Util\ProcessExecutor;
- class HgDownloader extends VcsDownloader
- {
- public function doDownload(PackageInterface $package, $path, $url)
- {
- $url = ProcessExecutor::escape($url);
- $ref = ProcessExecutor::escape($package->getSourceReference());
- $this->io->writeError(" Cloning ".$package->getSourceReference());
- $command = sprintf('hg clone %s %s', $url, ProcessExecutor::escape($path));
- if (0 !== $this->process->execute($command, $ignoredOutput)) {
- throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
- }
- $command = sprintf('hg up %s', $ref);
- if (0 !== $this->process->execute($command, $ignoredOutput, realpath($path))) {
- throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
- }
- }
- public function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url)
- {
- $url = ProcessExecutor::escape($url);
- $ref = ProcessExecutor::escape($target->getSourceReference());
- $this->io->writeError(" Updating to ".$target->getSourceReference());
- if (!$this->hasMetadataRepository($path)) {
- throw new \RuntimeException('The .hg directory is missing from '.$path.', see https://getcomposer.org/commit-deps for more information');
- }
- $command = sprintf('hg pull %s && hg up %s', $url, $ref);
- if (0 !== $this->process->execute($command, $ignoredOutput, realpath($path))) {
- throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
- }
- }
- public function getLocalChanges(PackageInterface $package, $path)
- {
- if (!is_dir($path.'/.hg')) {
- return;
- }
- $this->process->execute('hg st', $output, realpath($path));
- return trim($output) ?: null;
- }
- protected function getCommitLogs($fromReference, $toReference, $path)
- {
- $command = sprintf('hg log -r %s:%s --style compact', $fromReference, $toReference);
- if (0 !== $this->process->execute($command, $output, realpath($path))) {
- throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
- }
- return $output;
- }
- protected function hasMetadataRepository($path)
- {
- return is_dir($path . '/.hg');
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Package\PackageInterface;
- use Composer\Util\Platform;
- use Symfony\Component\Filesystem\Exception\IOException;
- use Symfony\Component\Filesystem\Filesystem;
- class PathDownloader extends FileDownloader
- {
- public function download(PackageInterface $package, $path)
- {
- $url = $package->getDistUrl();
- $realUrl = realpath($url);
- if (false === $realUrl || !file_exists($realUrl) || !is_dir($realUrl)) {
- throw new \RuntimeException(sprintf(
- 'Source path "%s" is not found for package %s', $url, $package->getName()
- ));
- }
- if (strpos(realpath($path) . DIRECTORY_SEPARATOR, $realUrl . DIRECTORY_SEPARATOR) === 0) {
- throw new \RuntimeException(sprintf(
- 'Package %s cannot install to "%s" inside its source at "%s"',
- $package->getName(), realpath($path), $realUrl
- ));
- }
- $fileSystem = new Filesystem();
- $this->filesystem->removeDirectory($path);
- $this->io->writeError(sprintf(
- ' - Installing <info>%s</info> (<comment>%s</comment>)',
- $package->getName(),
- $package->getFullPrettyVersion()
- ));
- try {
- if (Platform::isWindows()) {
- $this->filesystem->junction($realUrl, $path);
- $this->io->writeError(sprintf(' Junctioned from %s', $url));
- } else {
- $shortestPath = $this->filesystem->findShortestPath($path, $realUrl);
- $fileSystem->symlink($shortestPath, $path);
- $this->io->writeError(sprintf(' Symlinked from %s', $url));
- }
- } catch (IOException $e) {
- $fileSystem->mirror($realUrl, $path);
- $this->io->writeError(sprintf(' Mirrored from %s', $url));
- }
- $this->io->writeError('');
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Util\Filesystem;
- class PearPackageExtractor
- {
- private static $rolesWithoutPackageNamePrefix = array('php', 'script', 'www');
- private $filesystem;
- private $file;
- public function __construct($file)
- {
- if (!is_file($file)) {
- throw new \UnexpectedValueException('PEAR package file is not found at '.$file);
- }
- $this->filesystem = new Filesystem();
- $this->file = $file;
- }
- public function extractTo($target, array $roles = array('php' => '/', 'script' => '/bin'), $vars = array())
- {
- $extractionPath = $target.'/tarball';
- try {
- $archive = new \PharData($this->file);
- $archive->extractTo($extractionPath, null, true);
- if (!is_file($this->combine($extractionPath, '/package.xml'))) {
- throw new \RuntimeException('Invalid PEAR package. It must contain package.xml file.');
- }
- $fileCopyActions = $this->buildCopyActions($extractionPath, $roles, $vars);
- $this->copyFiles($fileCopyActions, $extractionPath, $target, $roles, $vars);
- $this->filesystem->removeDirectory($extractionPath);
- } catch (\Exception $exception) {
- throw new \UnexpectedValueException(sprintf('Failed to extract PEAR package %s to %s. Reason: %s', $this->file, $target, $exception->getMessage()), 0, $exception);
- }
- }
- private function copyFiles($files, $source, $target, $roles, $vars)
- {
- foreach ($files as $file) {
- $from = $this->combine($source, $file['from']);
- $to = $this->combine($target, $roles[$file['role']]);
- $to = $this->combine($to, $file['to']);
- $tasks = $file['tasks'];
- $this->copyFile($from, $to, $tasks, $vars);
- }
- }
- private function copyFile($from, $to, $tasks, $vars)
- {
- if (!is_file($from)) {
- throw new \RuntimeException('Invalid PEAR package. package.xml defines file that is not located inside tarball.');
- }
- $this->filesystem->ensureDirectoryExists(dirname($to));
- if (0 == count($tasks)) {
- $copied = copy($from, $to);
- } else {
- $content = file_get_contents($from);
- $replacements = array();
- foreach ($tasks as $task) {
- $pattern = $task['from'];
- $varName = $task['to'];
- if (isset($vars[$varName])) {
- if ($varName === 'php_bin' && false === strpos($to, '.bat')) {
- $replacements[$pattern] = preg_replace('{\.bat$}', '', $vars[$varName]);
- } else {
- $replacements[$pattern] = $vars[$varName];
- }
- }
- }
- $content = strtr($content, $replacements);
- $copied = file_put_contents($to, $content);
- }
- if (false === $copied) {
- throw new \RuntimeException(sprintf('Failed to copy %s to %s', $from, $to));
- }
- }
- private function buildCopyActions($source, array $roles, $vars)
- {
- $package = simplexml_load_string(file_get_contents($this->combine($source, 'package.xml')));
- if (false === $package) {
- throw new \RuntimeException('Package definition file is not valid.');
- }
- $packageSchemaVersion = $package['version'];
- if ('1.0' == $packageSchemaVersion) {
- $children = $package->release->filelist->children();
- $packageName = (string) $package->name;
- $packageVersion = (string) $package->release->version;
- $sourceDir = $packageName . '-' . $packageVersion;
- $result = $this->buildSourceList10($children, $roles, $sourceDir, '', null, $packageName);
- } elseif ('2.0' == $packageSchemaVersion || '2.1' == $packageSchemaVersion) {
- $children = $package->contents->children();
- $packageName = (string) $package->name;
- $packageVersion = (string) $package->version->release;
- $sourceDir = $packageName . '-' . $packageVersion;
- $result = $this->buildSourceList20($children, $roles, $sourceDir, '', null, $packageName);
- $namespaces = $package->getNamespaces();
- $package->registerXPathNamespace('ns', $namespaces['']);
- $releaseNodes = $package->xpath('ns:phprelease');
- $this->applyRelease($result, $releaseNodes, $vars);
- } else {
- throw new \RuntimeException('Unsupported schema version of package definition file.');
- }
- return $result;
- }
- private function applyRelease(&$actions, $releaseNodes, $vars)
- {
- foreach ($releaseNodes as $releaseNode) {
- $requiredOs = $releaseNode->installconditions && $releaseNode->installconditions->os && $releaseNode->installconditions->os->name ? (string) $releaseNode->installconditions->os->name : '';
- if ($requiredOs && $vars['os'] != $requiredOs) {
- continue;
- }
- if ($releaseNode->filelist) {
- foreach ($releaseNode->filelist->children() as $action) {
- if ('install' == $action->getName()) {
- $name = (string) $action['name'];
- $as = (string) $action['as'];
- if (isset($actions[$name])) {
- $actions[$name]['to'] = $as;
- }
- } elseif ('ignore' == $action->getName()) {
- $name = (string) $action['name'];
- unset($actions[$name]);
- } else {
- }
- }
- }
- break;
- }
- }
- private function buildSourceList10($children, $targetRoles, $source, $target, $role, $packageName)
- {
- $result = array();
- foreach ($children as $child) {
- if ($child->getName() == 'dir') {
- $dirSource = $this->combine($source, (string) $child['name']);
- $dirTarget = $child['baseinstalldir'] ?: $target;
- $dirRole = $child['role'] ?: $role;
- $dirFiles = $this->buildSourceList10($child->children(), $targetRoles, $dirSource, $dirTarget, $dirRole, $packageName);
- $result = array_merge($result, $dirFiles);
- } elseif ($child->getName() == 'file') {
- $fileRole = (string) $child['role'] ?: $role;
- if (isset($targetRoles[$fileRole])) {
- $fileName = (string) ($child['name'] ?: $child[0]);
- $fileSource = $this->combine($source, $fileName);
- $fileTarget = $this->combine((string) $child['baseinstalldir'] ?: $target, $fileName);
- if (!in_array($fileRole, self::$rolesWithoutPackageNamePrefix)) {
- $fileTarget = $packageName . '/' . $fileTarget;
- }
- $result[(string) $child['name']] = array('from' => $fileSource, 'to' => $fileTarget, 'role' => $fileRole, 'tasks' => array());
- }
- }
- }
- return $result;
- }
- private function buildSourceList20($children, $targetRoles, $source, $target, $role, $packageName)
- {
- $result = array();
- foreach ($children as $child) {
- if ('dir' == $child->getName()) {
- $dirSource = $this->combine($source, $child['name']);
- $dirTarget = $child['baseinstalldir'] ?: $target;
- $dirRole = $child['role'] ?: $role;
- $dirFiles = $this->buildSourceList20($child->children(), $targetRoles, $dirSource, $dirTarget, $dirRole, $packageName);
- $result = array_merge($result, $dirFiles);
- } elseif ('file' == $child->getName()) {
- $fileRole = (string) $child['role'] ?: $role;
- if (isset($targetRoles[$fileRole])) {
- $fileSource = $this->combine($source, (string) $child['name']);
- $fileTarget = $this->combine((string) ($child['baseinstalldir'] ?: $target), (string) $child['name']);
- $fileTasks = array();
- foreach ($child->children('http://pear.php.net/dtd/tasks-1.0') as $taskNode) {
- if ('replace' == $taskNode->getName()) {
- $fileTasks[] = array('from' => (string) $taskNode->attributes()->from, 'to' => (string) $taskNode->attributes()->to);
- }
- }
- if (!in_array($fileRole, self::$rolesWithoutPackageNamePrefix)) {
- $fileTarget = $packageName . '/' . $fileTarget;
- }
- $result[(string) $child['name']] = array('from' => $fileSource, 'to' => $fileTarget, 'role' => $fileRole, 'tasks' => $fileTasks);
- }
- }
- }
- return $result;
- }
- private function combine($left, $right)
- {
- return rtrim($left, '/') . '/' . ltrim($right, '/');
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Package\PackageInterface;
- use Composer\Repository\VcsRepository;
- use Composer\Util\Perforce;
- class PerforceDownloader extends VcsDownloader
- {
- protected $perforce;
- public function doDownload(PackageInterface $package, $path, $url)
- {
- $ref = $package->getSourceReference();
- $label = $this->getLabelFromSourceReference($ref);
- $this->io->writeError(' Cloning ' . $ref);
- $this->initPerforce($package, $path, $url);
- $this->perforce->setStream($ref);
- $this->perforce->p4Login($this->io);
- $this->perforce->writeP4ClientSpec();
- $this->perforce->connectClient();
- $this->perforce->syncCodeBase($label);
- $this->perforce->cleanupClientSpec();
- }
- private function getLabelFromSourceReference($ref)
- {
- $pos = strpos($ref, '@');
- if (false !== $pos) {
- return substr($ref, $pos + 1);
- }
- return null;
- }
- public function initPerforce($package, $path, $url)
- {
- if (!empty($this->perforce)) {
- $this->perforce->initializePath($path);
- return;
- }
- $repository = $package->getRepository();
- $repoConfig = null;
- if ($repository instanceof VcsRepository) {
- $repoConfig = $this->getRepoConfig($repository);
- }
- $this->perforce = Perforce::create($repoConfig, $url, $path, $this->process, $this->io);
- }
- private function getRepoConfig(VcsRepository $repository)
- {
- return $repository->getRepoConfig();
- }
- public function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url)
- {
- $this->doDownload($target, $path, $url);
- }
- public function getLocalChanges(PackageInterface $package, $path)
- {
- $this->io->writeError('Perforce driver does not check for local changes before overriding', true);
- return;
- }
- protected function getCommitLogs($fromReference, $toReference, $path)
- {
- $commitLogs = $this->perforce->getCommitLogs($fromReference, $toReference);
- return $commitLogs;
- }
- public function setPerforce($perforce)
- {
- $this->perforce = $perforce;
- }
- protected function hasMetadataRepository($path)
- {
- return true;
- }
- }
- <?php
- namespace Composer\Downloader;
- class PharDownloader extends ArchiveDownloader
- {
- protected function extract($file, $path)
- {
- $archive = new \Phar($file);
- $archive->extractTo($path, null, true);
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Config;
- use Composer\Cache;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Util\Platform;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\RemoteFilesystem;
- use Composer\IO\IOInterface;
- use RarArchive;
- class RarDownloader extends ArchiveDownloader
- {
- protected $process;
- public function __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, ProcessExecutor $process = null, RemoteFilesystem $rfs = null)
- {
- $this->process = $process ?: new ProcessExecutor($io);
- parent::__construct($io, $config, $eventDispatcher, $cache, $rfs);
- }
- protected function extract($file, $path)
- {
- $processError = null;
- if (!Platform::isWindows()) {
- $command = 'unrar x ' . ProcessExecutor::escape($file) . ' ' . ProcessExecutor::escape($path) . ' && chmod -R u+w ' . ProcessExecutor::escape($path);
- if (0 === $this->process->execute($command, $ignoredOutput)) {
- return;
- }
- $processError = 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput();
- }
- if (!class_exists('RarArchive')) {
- $iniPath = php_ini_loaded_file();
- if ($iniPath) {
- $iniMessage = 'The php.ini used by your command-line PHP is: ' . $iniPath;
- } else {
- $iniMessage = 'A php.ini file does not exist. You will have to create one.';
- }
- $error = "Could not decompress the archive, enable the PHP rar extension or install unrar.\n"
- . $iniMessage . "\n" . $processError;
- if (!Platform::isWindows()) {
- $error = "Could not decompress the archive, enable the PHP rar extension.\n" . $iniMessage;
- }
- throw new \RuntimeException($error);
- }
- $rarArchive = RarArchive::open($file);
- if (false === $rarArchive) {
- throw new \UnexpectedValueException('Could not open RAR archive: ' . $file);
- }
- $entries = $rarArchive->getEntries();
- if (false === $entries) {
- throw new \RuntimeException('Could not retrieve RAR archive entries');
- }
- foreach ($entries as $entry) {
- if (false === $entry->extract($path)) {
- throw new \RuntimeException('Could not extract entry');
- }
- }
- $rarArchive->close();
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Package\PackageInterface;
- use Composer\Util\Svn as SvnUtil;
- use Composer\Repository\VcsRepository;
- class SvnDownloader extends VcsDownloader
- {
- protected $cacheCredentials = true;
- public function doDownload(PackageInterface $package, $path, $url)
- {
- SvnUtil::cleanEnv();
- $ref = $package->getSourceReference();
- $repo = $package->getRepository();
- if ($repo instanceof VcsRepository) {
- $repoConfig = $repo->getRepoConfig();
- if (array_key_exists('svn-cache-credentials', $repoConfig)) {
- $this->cacheCredentials = (bool) $repoConfig['svn-cache-credentials'];
- }
- }
- $this->io->writeError(" Checking out ".$package->getSourceReference());
- $this->execute($url, "svn co", sprintf("%s/%s", $url, $ref), null, $path);
- }
- public function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url)
- {
- SvnUtil::cleanEnv();
- $ref = $target->getSourceReference();
- if (!$this->hasMetadataRepository($path)) {
- throw new \RuntimeException('The .svn directory is missing from '.$path.', see https://getcomposer.org/commit-deps for more information');
- }
- $flags = "";
- if (0 === $this->process->execute('svn --version', $output)) {
- if (preg_match('{(\d+(?:\.\d+)+)}', $output, $match) && version_compare($match[1], '1.7.0', '>=')) {
- $flags .= ' --ignore-ancestry';
- }
- }
- $this->io->writeError(" Checking out " . $ref);
- $this->execute($url, "svn switch" . $flags, sprintf("%s/%s", $url, $ref), $path);
- }
- public function getLocalChanges(PackageInterface $package, $path)
- {
- if (!$this->hasMetadataRepository($path)) {
- return;
- }
- $this->process->execute('svn status --ignore-externals', $output, $path);
- return preg_match('{^ *[^X ] +}m', $output) ? $output : null;
- }
- protected function execute($baseUrl, $command, $url, $cwd = null, $path = null)
- {
- $util = new SvnUtil($baseUrl, $this->io, $this->config);
- $util->setCacheCredentials($this->cacheCredentials);
- try {
- return $util->execute($command, $url, $cwd, $path, $this->io->isVerbose());
- } catch (\RuntimeException $e) {
- throw new \RuntimeException(
- 'Package could not be downloaded, '.$e->getMessage()
- );
- }
- }
- protected function cleanChanges(PackageInterface $package, $path, $update)
- {
- if (!$changes = $this->getLocalChanges($package, $path)) {
- return;
- }
- if (!$this->io->isInteractive()) {
- if (true === $this->config->get('discard-changes')) {
- return $this->discardChanges($path);
- }
- return parent::cleanChanges($package, $path, $update);
- }
- $changes = array_map(function ($elem) {
- return ' '.$elem;
- }, preg_split('{\s*\r?\n\s*}', $changes));
- $this->io->writeError(' <error>The package has modified files:</error>');
- $this->io->writeError(array_slice($changes, 0, 10));
- if (count($changes) > 10) {
- $this->io->writeError(' <info>'.count($changes) - 10 . ' more files modified, choose "v" to view the full list</info>');
- }
- while (true) {
- switch ($this->io->ask(' <info>Discard changes [y,n,v,?]?</info> ', '?')) {
- case 'y':
- $this->discardChanges($path);
- break 2;
- case 'n':
- throw new \RuntimeException('Update aborted');
- case 'v':
- $this->io->writeError($changes);
- break;
- case '?':
- default:
- $this->io->writeError(array(
- ' y - discard changes and apply the '.($update ? 'update' : 'uninstall'),
- ' n - abort the '.($update ? 'update' : 'uninstall').' and let you manually clean things up',
- ' v - view modified files',
- ' ? - print help',
- ));
- break;
- }
- }
- }
- protected function getCommitLogs($fromReference, $toReference, $path)
- {
- if (preg_match('{.*@(\d+)$}', $fromReference) && preg_match('{.*@(\d+)$}', $toReference)) {
- $fromRevision = preg_replace('{.*@(\d+)$}', '$1', $fromReference);
- $toRevision = preg_replace('{.*@(\d+)$}', '$1', $toReference);
- $command = sprintf('svn log -r%s:%s --incremental', $fromRevision, $toRevision);
- if (0 !== $this->process->execute($command, $output, $path)) {
- throw new \RuntimeException(
- 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput()
- );
- }
- } else {
- $output = "Could not retrieve changes between $fromReference and $toReference due to missing revision information";
- }
- return $output;
- }
- protected function discardChanges($path)
- {
- if (0 !== $this->process->execute('svn revert -R .', $output, $path)) {
- throw new \RuntimeException("Could not reset changes\n\n:".$this->process->getErrorOutput());
- }
- }
- protected function hasMetadataRepository($path)
- {
- return is_dir($path.'/.svn');
- }
- }
- <?php
- namespace Composer\Downloader;
- class TarDownloader extends ArchiveDownloader
- {
- protected function extract($file, $path)
- {
- $archive = new \PharData($file);
- $archive->extractTo($path, null, true);
- }
- }
- <?php
- namespace Composer\Downloader;
- class TransportException extends \RuntimeException
- {
- protected $headers;
- protected $response;
- protected $statusCode;
- public function setHeaders($headers)
- {
- $this->headers = $headers;
- }
- public function getHeaders()
- {
- return $this->headers;
- }
- public function setResponse($response)
- {
- $this->response = $response;
- }
- public function getResponse()
- {
- return $this->response;
- }
- public function setStatusCode($statusCode)
- {
- $this->statusCode = $statusCode;
- }
- public function getStatusCode()
- {
- return $this->statusCode;
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Config;
- use Composer\Package\PackageInterface;
- use Composer\Util\ProcessExecutor;
- use Composer\IO\IOInterface;
- use Composer\Util\Filesystem;
- abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterface
- {
- protected $io;
- protected $config;
- protected $process;
- protected $filesystem;
- public function __construct(IOInterface $io, Config $config, ProcessExecutor $process = null, Filesystem $fs = null)
- {
- $this->io = $io;
- $this->config = $config;
- $this->process = $process ?: new ProcessExecutor($io);
- $this->filesystem = $fs ?: new Filesystem($this->process);
- }
- public function getInstallationSource()
- {
- return 'source';
- }
- public function download(PackageInterface $package, $path)
- {
- if (!$package->getSourceReference()) {
- throw new \InvalidArgumentException('Package '.$package->getPrettyName().' is missing reference information');
- }
- $this->io->writeError(" - Installing <info>" . $package->getName() . "</info> (<comment>" . $package->getFullPrettyVersion() . "</comment>)");
- $this->filesystem->emptyDirectory($path);
- $urls = $package->getSourceUrls();
- while ($url = array_shift($urls)) {
- try {
- if (Filesystem::isLocalPath($url)) {
- $url = realpath($url);
- }
- $this->doDownload($package, $path, $url);
- break;
- } catch (\Exception $e) {
- if ($this->io->isDebug()) {
- $this->io->writeError('Failed: ['.get_class($e).'] '.$e->getMessage());
- } elseif (count($urls)) {
- $this->io->writeError(' Failed, trying the next URL');
- }
- if (!count($urls)) {
- throw $e;
- }
- }
- }
- $this->io->writeError('');
- }
- public function update(PackageInterface $initial, PackageInterface $target, $path)
- {
- if (!$target->getSourceReference()) {
- throw new \InvalidArgumentException('Package '.$target->getPrettyName().' is missing reference information');
- }
- $name = $target->getName();
- if ($initial->getPrettyVersion() == $target->getPrettyVersion()) {
- if ($target->getSourceType() === 'svn') {
- $from = $initial->getSourceReference();
- $to = $target->getSourceReference();
- } else {
- $from = substr($initial->getSourceReference(), 0, 7);
- $to = substr($target->getSourceReference(), 0, 7);
- }
- $name .= ' '.$initial->getPrettyVersion();
- } else {
- $from = $initial->getFullPrettyVersion();
- $to = $target->getFullPrettyVersion();
- }
- $this->io->writeError(" - Updating <info>" . $name . "</info> (<comment>" . $from . "</comment> => <comment>" . $to . "</comment>)");
- $this->cleanChanges($initial, $path, true);
- $urls = $target->getSourceUrls();
- $exception = null;
- while ($url = array_shift($urls)) {
- try {
- if (Filesystem::isLocalPath($url)) {
- $url = realpath($url);
- }
- $this->doUpdate($initial, $target, $path, $url);
- $exception = null;
- break;
- } catch (\Exception $exception) {
- if ($this->io->isDebug()) {
- $this->io->writeError('Failed: ['.get_class($exception).'] '.$exception->getMessage());
- } elseif (count($urls)) {
- $this->io->writeError(' Failed, trying the next URL');
- }
- }
- }
- $this->reapplyChanges($path);
-
- if (!$exception && $this->io->isVerbose() && $this->hasMetadataRepository($path)) {
- $message = 'Pulling in changes:';
- $logs = $this->getCommitLogs($initial->getSourceReference(), $target->getSourceReference(), $path);
- if (!trim($logs)) {
- $message = 'Rolling back changes:';
- $logs = $this->getCommitLogs($target->getSourceReference(), $initial->getSourceReference(), $path);
- }
- if (trim($logs)) {
- $logs = implode("\n", array_map(function ($line) {
- return ' ' . $line;
- }, explode("\n", $logs)));
- $logs = str_replace('<', '\<', $logs);
- $this->io->writeError(' '.$message);
- $this->io->writeError($logs);
- }
- }
- if (!$urls && $exception) {
- throw $exception;
- }
- $this->io->writeError('');
- }
- public function remove(PackageInterface $package, $path)
- {
- $this->io->writeError(" - Removing <info>" . $package->getName() . "</info> (<comment>" . $package->getPrettyVersion() . "</comment>)");
- $this->cleanChanges($package, $path, false);
- if (!$this->filesystem->removeDirectory($path)) {
- throw new \RuntimeException('Could not completely delete '.$path.', aborting.');
- }
- }
- public function setOutputProgress($outputProgress)
- {
- return $this;
- }
- protected function cleanChanges(PackageInterface $package, $path, $update)
- {
- if (null !== $this->getLocalChanges($package, $path)) {
- throw new \RuntimeException('Source directory ' . $path . ' has uncommitted changes.');
- }
- }
- protected function reapplyChanges($path)
- {
- }
- abstract protected function doDownload(PackageInterface $package, $path, $url);
- abstract protected function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url);
- abstract protected function getCommitLogs($fromReference, $toReference, $path);
- abstract protected function hasMetadataRepository($path);
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Config;
- use Composer\Cache;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Package\PackageInterface;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\RemoteFilesystem;
- use Composer\IO\IOInterface;
- class XzDownloader extends ArchiveDownloader
- {
- protected $process;
- public function __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, ProcessExecutor $process = null, RemoteFilesystem $rfs = null)
- {
- $this->process = $process ?: new ProcessExecutor($io);
- parent::__construct($io, $config, $eventDispatcher, $cache, $rfs);
- }
- protected function extract($file, $path)
- {
- $command = 'tar -xJf ' . ProcessExecutor::escape($file) . ' -C ' . ProcessExecutor::escape($path);
- if (0 === $this->process->execute($command, $ignoredOutput)) {
- return;
- }
- $processError = 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput();
- throw new \RuntimeException($processError);
- }
- protected function getFileName(PackageInterface $package, $path)
- {
- return $path.'/'.pathinfo(parse_url($package->getDistUrl(), PHP_URL_PATH), PATHINFO_BASENAME);
- }
- }
- <?php
- namespace Composer\Downloader;
- use Composer\Config;
- use Composer\Cache;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Util\Platform;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\RemoteFilesystem;
- use Composer\IO\IOInterface;
- use ZipArchive;
- class ZipDownloader extends ArchiveDownloader
- {
- protected $process;
- public function __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, ProcessExecutor $process = null, RemoteFilesystem $rfs = null)
- {
- $this->process = $process ?: new ProcessExecutor($io);
- parent::__construct($io, $config, $eventDispatcher, $cache, $rfs);
- }
- protected function extract($file, $path)
- {
- $processError = null;
- if (!Platform::isWindows()) {
- $command = 'unzip '.ProcessExecutor::escape($file).' -d '.ProcessExecutor::escape($path) . ' && chmod -R u+w ' . ProcessExecutor::escape($path);
- try {
- if (0 === $this->process->execute($command, $ignoredOutput)) {
- return;
- }
- $processError = 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput();
- } catch (\Exception $e) {
- $processError = 'Failed to execute ' . $command . "\n\n" . $e->getMessage();
- }
- }
- if (!class_exists('ZipArchive')) {
- $iniPath = php_ini_loaded_file();
- if ($iniPath) {
- $iniMessage = 'The php.ini used by your command-line PHP is: ' . $iniPath;
- } else {
- $iniMessage = 'A php.ini file does not exist. You will have to create one.';
- }
- $error = "Could not decompress the archive, enable the PHP zip extension or install unzip.\n"
- . $iniMessage . "\n" . $processError;
- if (!Platform::isWindows()) {
- $error = "Could not decompress the archive, enable the PHP zip extension.\n" . $iniMessage;
- }
- throw new \RuntimeException($error);
- }
- $zipArchive = new ZipArchive();
- if (true !== ($retval = $zipArchive->open($file))) {
- throw new \UnexpectedValueException(rtrim($this->getErrorMessage($retval, $file)."\n".$processError), $retval);
- }
- if (true !== $zipArchive->extractTo($path)) {
- throw new \RuntimeException("There was an error extracting the ZIP file. Corrupt file?");
- }
- $zipArchive->close();
- }
- protected function getErrorMessage($retval, $file)
- {
- switch ($retval) {
- case ZipArchive::ER_EXISTS:
- return sprintf("File '%s' already exists.", $file);
- case ZipArchive::ER_INCONS:
- return sprintf("Zip archive '%s' is inconsistent.", $file);
- case ZipArchive::ER_INVAL:
- return sprintf("Invalid argument (%s)", $file);
- case ZipArchive::ER_MEMORY:
- return sprintf("Malloc failure (%s)", $file);
- case ZipArchive::ER_NOENT:
- return sprintf("No such zip file: '%s'", $file);
- case ZipArchive::ER_NOZIP:
- return sprintf("'%s' is not a zip archive.", $file);
- case ZipArchive::ER_OPEN:
- return sprintf("Can't open zip file: %s", $file);
- case ZipArchive::ER_READ:
- return sprintf("Zip read error (%s)", $file);
- case ZipArchive::ER_SEEK:
- return sprintf("Zip seek error (%s)", $file);
- default:
- return sprintf("'%s' is not a valid zip archive, got error code: %s", $file, $retval);
- }
- }
- }
- <?php
- namespace Composer\EventDispatcher;
- class Event
- {
- protected $name;
- protected $args;
- protected $flags;
- private $propagationStopped = false;
- public function __construct($name, array $args = array(), array $flags = array())
- {
- $this->name = $name;
- $this->args = $args;
- $this->flags = $flags;
- }
- public function getName()
- {
- return $this->name;
- }
- public function getArguments()
- {
- return $this->args;
- }
- public function getFlags()
- {
- return $this->flags;
- }
- public function isPropagationStopped()
- {
- return $this->propagationStopped;
- }
- public function stopPropagation()
- {
- $this->propagationStopped = true;
- }
- }
- <?php
- namespace Composer\EventDispatcher;
- use Composer\DependencyResolver\PolicyInterface;
- use Composer\DependencyResolver\Pool;
- use Composer\DependencyResolver\Request;
- use Composer\Installer\InstallerEvent;
- use Composer\IO\IOInterface;
- use Composer\Composer;
- use Composer\DependencyResolver\Operation\OperationInterface;
- use Composer\Repository\CompositeRepository;
- use Composer\Script;
- use Composer\Script\CommandEvent;
- use Composer\Script\PackageEvent;
- use Composer\Util\ProcessExecutor;
- class EventDispatcher
- {
- protected $composer;
- protected $io;
- protected $loader;
- protected $process;
- protected $listeners;
- private $eventStack;
- public function __construct(Composer $composer, IOInterface $io, ProcessExecutor $process = null)
- {
- $this->composer = $composer;
- $this->io = $io;
- $this->process = $process ?: new ProcessExecutor($io);
- $this->eventStack = array();
- }
- public function dispatch($eventName, Event $event = null)
- {
- if (null == $event) {
- $event = new Event($eventName);
- }
- return $this->doDispatch($event);
- }
- public function dispatchScript($eventName, $devMode = false, $additionalArgs = array(), $flags = array())
- {
- return $this->doDispatch(new Script\Event($eventName, $this->composer, $this->io, $devMode, $additionalArgs, $flags));
- }
- public function dispatchPackageEvent($eventName, $devMode, PolicyInterface $policy, Pool $pool, CompositeRepository $installedRepo, Request $request, array $operations, OperationInterface $operation)
- {
- return $this->doDispatch(new PackageEvent($eventName, $this->composer, $this->io, $devMode, $policy, $pool, $installedRepo, $request, $operations, $operation));
- }
- public function dispatchInstallerEvent($eventName, $devMode, PolicyInterface $policy, Pool $pool, CompositeRepository $installedRepo, Request $request, array $operations = array())
- {
- return $this->doDispatch(new InstallerEvent($eventName, $this->composer, $this->io, $devMode, $policy, $pool, $installedRepo, $request, $operations));
- }
- protected function doDispatch(Event $event)
- {
- $binDir = $this->composer->getConfig()->get('bin-dir');
- if (is_dir($binDir)) {
- $binDir = realpath($binDir);
- if (isset($_SERVER['PATH']) && !preg_match('{(^|'.PATH_SEPARATOR.')'.preg_quote($binDir).'($|'.PATH_SEPARATOR.')}', $_SERVER['PATH'])) {
- $_SERVER['PATH'] = $binDir.PATH_SEPARATOR.getenv('PATH');
- putenv('PATH='.$_SERVER['PATH']);
- }
- }
- $listeners = $this->getListeners($event);
- $this->pushEvent($event);
- $return = 0;
- foreach ($listeners as $callable) {
- if (!is_string($callable) && is_callable($callable)) {
- $event = $this->checkListenerExpectedEvent($callable, $event);
- $return = false === call_user_func($callable, $event) ? 1 : 0;
- } elseif ($this->isComposerScript($callable)) {
- $this->io->writeError(sprintf('> %s: %s', $event->getName(), $callable), true, IOInterface::VERBOSE);
- $scriptName = substr($callable, 1);
- $args = $event->getArguments();
- $flags = $event->getFlags();
- $return = $this->dispatch($scriptName, new Script\Event($scriptName, $event->getComposer(), $event->getIO(), $event->isDevMode(), $args, $flags));
- } elseif ($this->isPhpScript($callable)) {
- $className = substr($callable, 0, strpos($callable, '::'));
- $methodName = substr($callable, strpos($callable, '::') + 2);
- if (!class_exists($className)) {
- $this->io->writeError('<warning>Class '.$className.' is not autoloadable, can not call '.$event->getName().' script</warning>');
- continue;
- }
- if (!is_callable($callable)) {
- $this->io->writeError('<warning>Method '.$callable.' is not callable, can not call '.$event->getName().' script</warning>');
- continue;
- }
- try {
- $return = false === $this->executeEventPhpScript($className, $methodName, $event) ? 1 : 0;
- } catch (\Exception $e) {
- $message = "Script %s handling the %s event terminated with an exception";
- $this->io->writeError('<error>'.sprintf($message, $callable, $event->getName()).'</error>');
- throw $e;
- }
- } else {
- $args = implode(' ', array_map(array('Composer\Util\ProcessExecutor', 'escape'), $event->getArguments()));
- $exec = $callable . ($args === '' ? '' : ' '.$args);
- if ($this->io->isVerbose()) {
- $this->io->writeError(sprintf('> %s: %s', $event->getName(), $exec));
- } else {
- $this->io->writeError(sprintf('> %s', $exec));
- }
- if (0 !== ($exitCode = $this->process->execute($exec))) {
- $this->io->writeError(sprintf('<error>Script %s handling the %s event returned with an error</error>', $callable, $event->getName()));
- throw new \RuntimeException('Error Output: '.$this->process->getErrorOutput(), $exitCode);
- }
- }
- if ($event->isPropagationStopped()) {
- break;
- }
- }
- $this->popEvent();
- return $return;
- }
- protected function executeEventPhpScript($className, $methodName, Event $event)
- {
- $event = $this->checkListenerExpectedEvent(array($className, $methodName), $event);
- if ($this->io->isVerbose()) {
- $this->io->writeError(sprintf('> %s: %s::%s', $event->getName(), $className, $methodName));
- } else {
- $this->io->writeError(sprintf('> %s::%s', $className, $methodName));
- }
- return $className::$methodName($event);
- }
- protected function checkListenerExpectedEvent($target, Event $event)
- {
- try {
- $reflected = new \ReflectionParameter($target, 0);
- } catch (\Exception $e) {
- return $event;
- }
- $typehint = $reflected->getClass();
- if (!$typehint instanceof \ReflectionClass) {
- return $event;
- }
- $expected = $typehint->getName();
- if (!$event instanceof $expected && $expected === 'Composer\Script\CommandEvent') {
- $event = new \Composer\Script\CommandEvent(
- $event->getName(), $event->getComposer(), $event->getIO(), $event->isDevMode(), $event->getArguments()
- );
- }
- if (!$event instanceof $expected && $expected === 'Composer\Script\PackageEvent') {
- $event = new \Composer\Script\PackageEvent(
- $event->getName(), $event->getComposer(), $event->getIO(), $event->isDevMode(),
- $event->getPolicy(), $event->getPool(), $event->getInstalledRepo(), $event->getRequest(),
- $event->getOperations(), $event->getOperation()
- );
- }
- if (!$event instanceof $expected && $expected === 'Composer\Script\Event') {
- $event = new \Composer\Script\Event(
- $event->getName(), $event->getComposer(), $event->getIO(), $event->isDevMode(),
- $event->getArguments(), $event->getFlags()
- );
- }
- return $event;
- }
- protected function addListener($eventName, $listener, $priority = 0)
- {
- $this->listeners[$eventName][$priority][] = $listener;
- }
- public function addSubscriber(EventSubscriberInterface $subscriber)
- {
- foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
- if (is_string($params)) {
- $this->addListener($eventName, array($subscriber, $params));
- } elseif (is_string($params[0])) {
- $this->addListener($eventName, array($subscriber, $params[0]), isset($params[1]) ? $params[1] : 0);
- } else {
- foreach ($params as $listener) {
- $this->addListener($eventName, array($subscriber, $listener[0]), isset($listener[1]) ? $listener[1] : 0);
- }
- }
- }
- }
- protected function getListeners(Event $event)
- {
- $scriptListeners = $this->getScriptListeners($event);
- if (!isset($this->listeners[$event->getName()][0])) {
- $this->listeners[$event->getName()][0] = array();
- }
- krsort($this->listeners[$event->getName()]);
- $listeners = $this->listeners;
- $listeners[$event->getName()][0] = array_merge($listeners[$event->getName()][0], $scriptListeners);
- return call_user_func_array('array_merge', $listeners[$event->getName()]);
- }
- public function hasEventListeners(Event $event)
- {
- $listeners = $this->getListeners($event);
- return count($listeners) > 0;
- }
- protected function getScriptListeners(Event $event)
- {
- $package = $this->composer->getPackage();
- $scripts = $package->getScripts();
- if (empty($scripts[$event->getName()])) {
- return array();
- }
- if ($this->loader) {
- $this->loader->unregister();
- }
- $generator = $this->composer->getAutoloadGenerator();
- $packages = $this->composer->getRepositoryManager()->getLocalRepository()->getCanonicalPackages();
- $packageMap = $generator->buildPackageMap($this->composer->getInstallationManager(), $package, $packages);
- $map = $generator->parseAutoloads($packageMap, $package);
- $this->loader = $generator->createLoader($map);
- $this->loader->register();
- return $scripts[$event->getName()];
- }
- protected function isPhpScript($callable)
- {
- return false === strpos($callable, ' ') && false !== strpos($callable, '::');
- }
- protected function isComposerScript($callable)
- {
- return '@' === substr($callable, 0, 1);
- }
- protected function pushEvent(Event $event)
- {
- $eventName = $event->getName();
- if (in_array($eventName, $this->eventStack)) {
- throw new \RuntimeException(sprintf("Circular call to script handler '%s' detected", $eventName));
- }
- return array_push($this->eventStack, $eventName);
- }
- protected function popEvent()
- {
- return array_pop($this->eventStack);
- }
- }
- <?php
- namespace Composer\EventDispatcher;
- interface EventSubscriberInterface
- {
- public static function getSubscribedEvents();
- }
- <?php
- namespace Composer;
- use Composer\Config\JsonConfigSource;
- use Composer\Json\JsonFile;
- use Composer\IO\IOInterface;
- use Composer\Package\Archiver;
- use Composer\Package\Version\VersionGuesser;
- use Composer\Repository\RepositoryManager;
- use Composer\Repository\WritableRepositoryInterface;
- use Composer\Util\Filesystem;
- use Composer\Util\Platform;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\RemoteFilesystem;
- use Composer\Util\Silencer;
- use Symfony\Component\Console\Formatter\OutputFormatterStyle;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Autoload\AutoloadGenerator;
- use Composer\Package\Version\VersionParser;
- use Composer\Downloader\TransportException;
- use Seld\JsonLint\JsonParser;
- class Factory
- {
- protected static function getHomeDir()
- {
- $home = getenv('COMPOSER_HOME');
- if ($home) {
- return $home;
- }
- if (Platform::isWindows()) {
- if (!getenv('APPDATA')) {
- throw new \RuntimeException('The APPDATA or COMPOSER_HOME environment variable must be set for composer to run correctly');
- }
- return rtrim(strtr(getenv('APPDATA'), '\\', '/'), '/') . '/Composer';
- }
- $userDir = self::getUserDir();
- if (is_dir($userDir . '/.composer')) {
- return $userDir . '/.composer';
- }
- if (self::useXdg()) {
- $xdgConfig = getenv('XDG_CONFIG_HOME') ?: $userDir . '/.config';
- return $xdgConfig . '/composer';
- }
- return $userDir . '/.composer';
- }
- protected static function getCacheDir($home)
- {
- $cacheDir = getenv('COMPOSER_CACHE_DIR');
- if ($cacheDir) {
- return $cacheDir;
- }
- $homeEnv = getenv('COMPOSER_HOME');
- if ($homeEnv) {
- return $homeEnv . '/cache';
- }
- if (Platform::isWindows()) {
- if ($cacheDir = getenv('LOCALAPPDATA')) {
- $cacheDir .= '/Composer';
- } else {
- $cacheDir = $home . '/cache';
- }
- return rtrim(strtr($cacheDir, '\\', '/'), '/');
- }
- $userDir = self::getUserDir();
- if ($home === $userDir . '/.composer' && is_dir($home . '/cache')) {
- return $home . '/cache';
- }
- if (self::useXdg()) {
- $xdgCache = getenv('XDG_CACHE_HOME') ?: $userDir . '/.cache';
- return $xdgCache . '/composer';
- }
- return $home . '/cache';
- }
- protected static function getDataDir($home)
- {
- $homeEnv = getenv('COMPOSER_HOME');
- if ($homeEnv) {
- return $homeEnv;
- }
- if (Platform::isWindows()) {
- return strtr($home, '\\', '/');
- }
- $userDir = self::getUserDir();
- if ($home !== $userDir . '/.composer' && self::useXdg()) {
- $xdgData = getenv('XDG_DATA_HOME') ?: $userDir . '/.local/share';
- return $xdgData . '/composer';
- }
- return $home;
- }
- public static function createConfig(IOInterface $io = null, $cwd = null)
- {
- $cwd = $cwd ?: getcwd();
- $config = new Config(true, $cwd);
- $home = self::getHomeDir();
- $config->merge(array('config' => array(
- 'home' => $home,
- 'cache-dir' => self::getCacheDir($home),
- 'data-dir' => self::getDataDir($home),
- )));
-
-
- $dirs = array($config->get('home'), $config->get('cache-dir'), $config->get('data-dir'));
- foreach ($dirs as $dir) {
- if (!file_exists($dir . '/.htaccess')) {
- if (!is_dir($dir)) {
- Silencer::call('mkdir', $dir, 0777, true);
- }
- Silencer::call('file_put_contents', $dir . '/.htaccess', 'Deny from all');
- }
- }
- $file = new JsonFile($config->get('home').'/config.json');
- if ($file->exists()) {
- if ($io && $io->isDebug()) {
- $io->writeError('Loading config file ' . $file->getPath());
- }
- $config->merge($file->read());
- }
- $config->setConfigSource(new JsonConfigSource($file));
- $file = new JsonFile($config->get('home').'/auth.json');
- if ($file->exists()) {
- if ($io && $io->isDebug()) {
- $io->writeError('Loading config file ' . $file->getPath());
- }
- $config->merge(array('config' => $file->read()));
- }
- $config->setAuthConfigSource(new JsonConfigSource($file, true));
- if ($composerAuthEnv = getenv('COMPOSER_AUTH')) {
- $authData = json_decode($composerAuthEnv, true);
- if (is_null($authData)) {
- throw new \UnexpectedValueException('COMPOSER_AUTH environment variable is malformed, should be a valid JSON object');
- }
- if ($io && $io->isDebug()) {
- $io->writeError('Loading auth config from COMPOSER_AUTH');
- }
- $config->merge(array('config' => $authData));
- }
- return $config;
- }
- public static function getComposerFile()
- {
- return trim(getenv('COMPOSER')) ?: './composer.json';
- }
- public static function createAdditionalStyles()
- {
- return array(
- 'highlight' => new OutputFormatterStyle('red'),
- 'warning' => new OutputFormatterStyle('black', 'yellow'),
- );
- }
- public static function createDefaultRepositories(IOInterface $io = null, Config $config = null, RepositoryManager $rm = null)
- {
- $repos = array();
- if (!$config) {
- $config = static::createConfig($io);
- }
- if (!$rm) {
- if (!$io) {
- throw new \InvalidArgumentException('This function requires either an IOInterface or a RepositoryManager');
- }
- $factory = new static;
- $rm = $factory->createRepositoryManager($io, $config, null, self::createRemoteFilesystem($io, $config));
- }
- foreach ($config->getRepositories() as $index => $repo) {
- if (is_string($repo)) {
- throw new \UnexpectedValueException('"repositories" should be an array of repository definitions, only a single repository was given');
- }
- if (!is_array($repo)) {
- throw new \UnexpectedValueException('Repository "'.$index.'" ('.json_encode($repo).') should be an array, '.gettype($repo).' given');
- }
- if (!isset($repo['type'])) {
- throw new \UnexpectedValueException('Repository "'.$index.'" ('.json_encode($repo).') must have a type defined');
- }
- $name = is_int($index) && isset($repo['url']) ? preg_replace('{^https?://}i', '', $repo['url']) : $index;
- while (isset($repos[$name])) {
- $name .= '2';
- }
- $repos[$name] = $rm->createRepository($repo['type'], $repo);
- }
- return $repos;
- }
- public function createComposer(IOInterface $io, $localConfig = null, $disablePlugins = false, $cwd = null, $fullLoad = true)
- {
- $cwd = $cwd ?: getcwd();
- if (null === $localConfig) {
- $localConfig = static::getComposerFile();
- }
- if (is_string($localConfig)) {
- $composerFile = $localConfig;
- $file = new JsonFile($localConfig, null, $io);
- if (!$file->exists()) {
- if ($localConfig === './composer.json' || $localConfig === 'composer.json') {
- $message = 'Composer could not find a composer.json file in '.$cwd;
- } else {
- $message = 'Composer could not find the config file: '.$localConfig;
- }
- $instructions = 'To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section';
- throw new \InvalidArgumentException($message.PHP_EOL.$instructions);
- }
- $file->validateSchema(JsonFile::LAX_SCHEMA);
- $jsonParser = new JsonParser;
- try {
- $jsonParser->parse(file_get_contents($localConfig), JsonParser::DETECT_KEY_CONFLICTS);
- } catch (\Seld\JsonLint\DuplicateKeyException $e) {
- $details = $e->getDetails();
- $io->writeError('<warning>Key '.$details['key'].' is a duplicate in '.$localConfig.' at line '.$details['line'].'</warning>');
- }
- $localConfig = $file->read();
- }
- $config = static::createConfig($io, $cwd);
- $config->merge($localConfig);
- if (isset($composerFile)) {
- $io->writeError('Loading config file ' . $composerFile, true, IOInterface::DEBUG);
- $localAuthFile = new JsonFile(dirname(realpath($composerFile)) . '/auth.json');
- if ($localAuthFile->exists()) {
- $io->writeError('Loading config file ' . $localAuthFile->getPath(), true, IOInterface::DEBUG);
- $config->merge(array('config' => $localAuthFile->read()));
- $config->setAuthConfigSource(new JsonConfigSource($localAuthFile, true));
- }
- }
- $vendorDir = $config->get('vendor-dir');
- $binDir = $config->get('bin-dir');
- $composer = new Composer();
- $composer->setConfig($config);
- if ($fullLoad) {
- $io->loadConfiguration($config);
- }
- $rfs = self::createRemoteFilesystem($io, $config);
- $dispatcher = new EventDispatcher($composer, $io);
- $composer->setEventDispatcher($dispatcher);
- $rm = $this->createRepositoryManager($io, $config, $dispatcher, $rfs);
- $composer->setRepositoryManager($rm);
- $this->addLocalRepository($io, $rm, $vendorDir);
-
- if (!$fullLoad && !isset($localConfig['version'])) {
- $localConfig['version'] = '1.0.0';
- }
- $parser = new VersionParser;
- $guesser = new VersionGuesser($config, new ProcessExecutor($io), $parser);
- $loader = new Package\Loader\RootPackageLoader($rm, $config, $parser, $guesser);
- $package = $loader->load($localConfig, 'Composer\Package\RootPackage', $cwd);
- $composer->setPackage($package);
- $im = $this->createInstallationManager();
- $composer->setInstallationManager($im);
- if ($fullLoad) {
- $dm = $this->createDownloadManager($io, $config, $dispatcher, $rfs);
- $composer->setDownloadManager($dm);
- $generator = new AutoloadGenerator($dispatcher, $io);
- $composer->setAutoloadGenerator($generator);
- }
- $this->createDefaultInstallers($im, $composer, $io);
- if ($fullLoad) {
- $globalComposer = $this->createGlobalComposer($io, $config, $disablePlugins);
- $pm = $this->createPluginManager($io, $composer, $globalComposer, $disablePlugins);
- $composer->setPluginManager($pm);
- $pm->loadInstalledPlugins();
-
- if ($rm->getLocalRepository()) {
- $this->purgePackages($rm->getLocalRepository(), $im);
- }
- }
- if ($fullLoad && isset($composerFile)) {
- $lockFile = "json" === pathinfo($composerFile, PATHINFO_EXTENSION)
- ? substr($composerFile, 0, -4).'lock'
- : $composerFile . '.lock';
- $locker = new Package\Locker($io, new JsonFile($lockFile, null, $io), $rm, $im, file_get_contents($composerFile));
- $composer->setLocker($locker);
- }
- return $composer;
- }
- protected function createRepositoryManager(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, RemoteFilesystem $rfs = null)
- {
- $rm = new RepositoryManager($io, $config, $eventDispatcher, $rfs);
- $rm->setRepositoryClass('composer', 'Composer\Repository\ComposerRepository');
- $rm->setRepositoryClass('vcs', 'Composer\Repository\VcsRepository');
- $rm->setRepositoryClass('package', 'Composer\Repository\PackageRepository');
- $rm->setRepositoryClass('pear', 'Composer\Repository\PearRepository');
- $rm->setRepositoryClass('git', 'Composer\Repository\VcsRepository');
- $rm->setRepositoryClass('gitlab', 'Composer\Repository\VcsRepository');
- $rm->setRepositoryClass('svn', 'Composer\Repository\VcsRepository');
- $rm->setRepositoryClass('perforce', 'Composer\Repository\VcsRepository');
- $rm->setRepositoryClass('hg', 'Composer\Repository\VcsRepository');
- $rm->setRepositoryClass('artifact', 'Composer\Repository\ArtifactRepository');
- $rm->setRepositoryClass('path', 'Composer\Repository\PathRepository');
- return $rm;
- }
- protected function addLocalRepository(IOInterface $io, RepositoryManager $rm, $vendorDir)
- {
- $rm->setLocalRepository(new Repository\InstalledFilesystemRepository(new JsonFile($vendorDir.'/composer/installed.json', null, $io)));
- }
- protected function createGlobalComposer(IOInterface $io, Config $config, $disablePlugins)
- {
- if (realpath($config->get('home')) === getcwd()) {
- return;
- }
- $composer = null;
- try {
- $composer = self::createComposer($io, $config->get('home') . '/composer.json', $disablePlugins, $config->get('home'), false);
- } catch (\Exception $e) {
- $io->writeError('Failed to initialize global composer: '.$e->getMessage(), true, IOInterface::DEBUG);
- }
- return $composer;
- }
- public function createDownloadManager(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, RemoteFilesystem $rfs = null)
- {
- $cache = null;
- if ($config->get('cache-files-ttl') > 0) {
- $cache = new Cache($io, $config->get('cache-files-dir'), 'a-z0-9_./');
- }
- $dm = new Downloader\DownloadManager($io);
- switch ($config->get('preferred-install')) {
- case 'dist':
- $dm->setPreferDist(true);
- break;
- case 'source':
- $dm->setPreferSource(true);
- break;
- case 'auto':
- default:
- break;
- }
- $executor = new ProcessExecutor($io);
- $fs = new Filesystem($executor);
- $dm->setDownloader('git', new Downloader\GitDownloader($io, $config, $executor, $fs));
- $dm->setDownloader('svn', new Downloader\SvnDownloader($io, $config, $executor, $fs));
- $dm->setDownloader('hg', new Downloader\HgDownloader($io, $config, $executor, $fs));
- $dm->setDownloader('perforce', new Downloader\PerforceDownloader($io, $config));
- $dm->setDownloader('zip', new Downloader\ZipDownloader($io, $config, $eventDispatcher, $cache, $executor, $rfs));
- $dm->setDownloader('rar', new Downloader\RarDownloader($io, $config, $eventDispatcher, $cache, $executor, $rfs));
- $dm->setDownloader('tar', new Downloader\TarDownloader($io, $config, $eventDispatcher, $cache, $rfs));
- $dm->setDownloader('gzip', new Downloader\GzipDownloader($io, $config, $eventDispatcher, $cache, $executor, $rfs));
- $dm->setDownloader('xz', new Downloader\XzDownloader($io, $config, $eventDispatcher, $cache, $executor, $rfs));
- $dm->setDownloader('phar', new Downloader\PharDownloader($io, $config, $eventDispatcher, $cache, $rfs));
- $dm->setDownloader('file', new Downloader\FileDownloader($io, $config, $eventDispatcher, $cache, $rfs));
- $dm->setDownloader('path', new Downloader\PathDownloader($io, $config, $eventDispatcher, $cache, $rfs));
- return $dm;
- }
- public function createArchiveManager(Config $config, Downloader\DownloadManager $dm = null)
- {
- if (null === $dm) {
- $io = new IO\NullIO();
- $io->loadConfiguration($config);
- $dm = $this->createDownloadManager($io, $config);
- }
- $am = new Archiver\ArchiveManager($dm);
- $am->addArchiver(new Archiver\ZipArchiver);
- $am->addArchiver(new Archiver\PharArchiver);
- return $am;
- }
- protected function createPluginManager(IOInterface $io, Composer $composer, Composer $globalComposer = null, $disablePlugins = false)
- {
- return new Plugin\PluginManager($io, $composer, $globalComposer, $disablePlugins);
- }
- protected function createInstallationManager()
- {
- return new Installer\InstallationManager();
- }
- protected function createDefaultInstallers(Installer\InstallationManager $im, Composer $composer, IOInterface $io)
- {
- $im->addInstaller(new Installer\LibraryInstaller($io, $composer, null));
- $im->addInstaller(new Installer\PearInstaller($io, $composer, 'pear-library'));
- $im->addInstaller(new Installer\PluginInstaller($io, $composer));
- $im->addInstaller(new Installer\MetapackageInstaller($io));
- }
- protected function purgePackages(WritableRepositoryInterface $repo, Installer\InstallationManager $im)
- {
- foreach ($repo->getPackages() as $package) {
- if (!$im->isPackageInstalled($repo, $package)) {
- $repo->removePackage($package);
- }
- }
- }
- public static function create(IOInterface $io, $config = null, $disablePlugins = false)
- {
- $factory = new static();
- return $factory->createComposer($io, $config, $disablePlugins);
- }
- public static function createRemoteFilesystem(IOInterface $io, Config $config = null, $options = array())
- {
- static $warned = false;
- $disableTls = false;
- if ($config && $config->get('disable-tls') === true) {
- if (!$warned) {
- $io->write('<warning>You are running Composer with SSL/TLS protection disabled.</warning>');
- }
- $warned = true;
- $disableTls = true;
- } elseif (!extension_loaded('openssl')) {
- throw new \RuntimeException('The openssl extension is required for SSL/TLS protection but is not available. '
- . 'If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the \'disable-tls\' option to true.');
- }
- $remoteFilesystemOptions = array();
- if ($disableTls === false) {
- if ($config && $config->get('cafile')) {
- $remoteFilesystemOptions['ssl']['cafile'] = $config->get('cafile');
- }
- if ($config && $config->get('capath')) {
- $remoteFilesystemOptions['ssl']['capath'] = $config->get('capath');
- }
- $remoteFilesystemOptions = array_replace_recursive($remoteFilesystemOptions, $options);
- }
- try {
- $remoteFilesystem = new RemoteFilesystem($io, $config, $remoteFilesystemOptions, $disableTls);
- } catch (TransportException $e) {
- if (false !== strpos($e->getMessage(), 'cafile')) {
- $io->write('<error>Unable to locate a valid CA certificate file. You must set a valid \'cafile\' option.</error>');
- $io->write('<error>A valid CA certificate file is required for SSL/TLS protection.</error>');
- if (PHP_VERSION_ID < 50600) {
- $io->write('<error>It is recommended you upgrade to PHP 5.6+ which can detect your system CA file automatically.</error>');
- }
- $io->write('<error>You can disable this error, at your own risk, by setting the \'disable-tls\' option to true.</error>');
- }
- throw $e;
- }
- return $remoteFilesystem;
- }
- private static function useXdg()
- {
- foreach (array_keys($_SERVER) as $key) {
- if (substr($key, 0, 4) === 'XDG_') {
- return true;
- }
- }
- return false;
- }
- private static function getUserDir()
- {
- $home = getenv('HOME');
- if (!$home) {
- throw new \RuntimeException('The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly');
- }
- return rtrim(strtr($home, '\\', '/'), '/');
- }
- }
- <?php
- namespace Composer\IO;
- use Composer\Config;
- use Composer\Util\ProcessExecutor;
- abstract class BaseIO implements IOInterface
- {
- protected $authentications = array();
- public function getAuthentications()
- {
- return $this->authentications;
- }
- public function hasAuthentication($repositoryName)
- {
- return isset($this->authentications[$repositoryName]);
- }
- public function getAuthentication($repositoryName)
- {
- if (isset($this->authentications[$repositoryName])) {
- return $this->authentications[$repositoryName];
- }
- return array('username' => null, 'password' => null);
- }
- public function setAuthentication($repositoryName, $username, $password = null)
- {
- $this->authentications[$repositoryName] = array('username' => $username, 'password' => $password);
- }
- public function loadConfiguration(Config $config)
- {
- $githubOauth = $config->get('github-oauth') ?: array();
- $gitlabOauth = $config->get('gitlab-oauth') ?: array();
- $httpBasic = $config->get('http-basic') ?: array();
- foreach ($githubOauth as $domain => $token) {
- if (!preg_match('{^[a-z0-9]+$}', $token)) {
- throw new \UnexpectedValueException('Your github oauth token for '.$domain.' contains invalid characters: "'.$token.'"');
- }
- $this->setAuthentication($domain, $token, 'x-oauth-basic');
- }
- foreach ($gitlabOauth as $domain => $token) {
- $this->setAuthentication($domain, $token, 'oauth2');
- }
- foreach ($httpBasic as $domain => $cred) {
- $this->setAuthentication($domain, $cred['username'], $cred['password']);
- }
- ProcessExecutor::setTimeout((int) $config->get('process-timeout'));
- }
- }
- <?php
- namespace Composer\IO;
- use Symfony\Component\Console\Output\StreamOutput;
- use Symfony\Component\Console\Formatter\OutputFormatterInterface;
- use Symfony\Component\Console\Input\StringInput;
- use Symfony\Component\Console\Helper\HelperSet;
- class BufferIO extends ConsoleIO
- {
- public function __construct(
- $input = '',
- $verbosity = StreamOutput::VERBOSITY_NORMAL,
- OutputFormatterInterface $formatter = null
- ) {
- $input = new StringInput($input);
- $input->setInteractive(false);
- $output = new StreamOutput(fopen('php://memory', 'rw'), $verbosity, $formatter ? $formatter->isDecorated() : false, $formatter);
- parent::__construct($input, $output, new HelperSet(array()));
- }
- public function getOutput()
- {
- fseek($this->output->getStream(), 0);
- $output = stream_get_contents($this->output->getStream());
- $output = preg_replace_callback("{(?<=^|\n|\x08)(.+?)(\x08+)}", function ($matches) {
- $pre = strip_tags($matches[1]);
- if (strlen($pre) === strlen($matches[2])) {
- return '';
- }
- return rtrim($matches[1])."\n";
- }, $output);
- return $output;
- }
- }
- <?php
- namespace Composer\IO;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\ConsoleOutputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Helper\HelperSet;
- use Symfony\Component\Console\Question\ConfirmationQuestion;
- use Symfony\Component\Console\Question\Question;
- class ConsoleIO extends BaseIO
- {
- protected $input;
- protected $output;
- protected $helperSet;
- protected $lastMessage;
- protected $lastMessageErr;
- private $startTime;
- private $verbosityMap;
- public function __construct(InputInterface $input, OutputInterface $output, HelperSet $helperSet)
- {
- $this->input = $input;
- $this->output = $output;
- $this->helperSet = $helperSet;
- $this->verbosityMap = array(
- self::QUIET => OutputInterface::VERBOSITY_QUIET,
- self::NORMAL => OutputInterface::VERBOSITY_NORMAL,
- self::VERBOSE => OutputInterface::VERBOSITY_VERBOSE,
- self::VERY_VERBOSE => OutputInterface::VERBOSITY_VERY_VERBOSE,
- self::DEBUG => OutputInterface::VERBOSITY_DEBUG,
- );
- }
- public function enableDebugging($startTime)
- {
- $this->startTime = $startTime;
- }
- public function isInteractive()
- {
- return $this->input->isInteractive();
- }
- public function isDecorated()
- {
- return $this->output->isDecorated();
- }
- public function isVerbose()
- {
- return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE;
- }
- public function isVeryVerbose()
- {
- return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE;
- }
- public function isDebug()
- {
- return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG;
- }
- public function write($messages, $newline = true, $verbosity = self::NORMAL)
- {
- $this->doWrite($messages, $newline, false, $verbosity);
- }
- public function writeError($messages, $newline = true, $verbosity = self::NORMAL)
- {
- $this->doWrite($messages, $newline, true, $verbosity);
- }
- private function doWrite($messages, $newline, $stderr, $verbosity)
- {
- $sfVerbosity = $this->verbosityMap[$verbosity];
- if ($sfVerbosity > $this->output->getVerbosity()) {
- return;
- }
-
-
- if (OutputInterface::VERBOSITY_QUIET === 0) {
- $sfVerbosity = OutputInterface::OUTPUT_NORMAL;
- }
- if (null !== $this->startTime) {
- $memoryUsage = memory_get_usage() / 1024 / 1024;
- $timeSpent = microtime(true) - $this->startTime;
- $messages = array_map(function ($message) use ($memoryUsage, $timeSpent) {
- return sprintf('[%.1fMB/%.2fs] %s', $memoryUsage, $timeSpent, $message);
- }, (array) $messages);
- }
- if (true === $stderr && $this->output instanceof ConsoleOutputInterface) {
- $this->output->getErrorOutput()->write($messages, $newline, $sfVerbosity);
- $this->lastMessageErr = join($newline ? "\n" : '', (array) $messages);
- return;
- }
- $this->output->write($messages, $newline, $sfVerbosity);
- $this->lastMessage = join($newline ? "\n" : '', (array) $messages);
- }
- public function overwrite($messages, $newline = true, $size = null, $verbosity = self::NORMAL)
- {
- $this->doOverwrite($messages, $newline, $size, false, $verbosity);
- }
- public function overwriteError($messages, $newline = true, $size = null, $verbosity = self::NORMAL)
- {
- $this->doOverwrite($messages, $newline, $size, true, $verbosity);
- }
- private function doOverwrite($messages, $newline, $size, $stderr, $verbosity)
- {
- $messages = join($newline ? "\n" : '', (array) $messages);
- if (!isset($size)) {
- $size = strlen(strip_tags($stderr ? $this->lastMessageErr : $this->lastMessage));
- }
- $this->doWrite(str_repeat("\x08", $size), false, $stderr, $verbosity);
- $this->doWrite($messages, false, $stderr, $verbosity);
- $fill = $size - strlen(strip_tags($messages));
- if ($fill > 0) {
- $this->doWrite(str_repeat(' ', $fill), false, $stderr, $verbosity);
- $this->doWrite(str_repeat("\x08", $fill), false, $stderr, $verbosity);
- }
- if ($newline) {
- $this->doWrite('', true, $stderr, $verbosity);
- }
- if ($stderr) {
- $this->lastMessageErr = $messages;
- } else {
- $this->lastMessage = $messages;
- }
- }
- public function ask($question, $default = null)
- {
- $output = $this->output;
- if ($output instanceof ConsoleOutputInterface) {
- $output = $output->getErrorOutput();
- }
- $helper = $this->helperSet->get('question');
- $question = new Question($question, $default);
- return $helper->ask($this->input, $output, $question);
- }
- public function askConfirmation($question, $default = true)
- {
- $output = $this->output;
- if ($output instanceof ConsoleOutputInterface) {
- $output = $output->getErrorOutput();
- }
- $helper = $this->helperSet->get('question');
- $question = new ConfirmationQuestion($question, $default);
- return $helper->ask($this->input, $output, $question);
- }
- public function askAndValidate($question, $validator, $attempts = null, $default = null)
- {
- $output = $this->output;
- if ($output instanceof ConsoleOutputInterface) {
- $output = $output->getErrorOutput();
- }
- $helper = $this->helperSet->get('question');
- $question = new Question($question, $default);
- $question->setValidator($validator);
- $question->setMaxAttempts($attempts);
- return $helper->ask($this->input, $output, $question);
- }
- public function askAndHideAnswer($question)
- {
- $this->writeError($question, false);
- return \Seld\CliPrompt\CliPrompt::hiddenPrompt(true);
- }
- }
- <?php
- namespace Composer\IO;
- use Composer\Config;
- interface IOInterface
- {
- const QUIET = 1;
- const NORMAL = 2;
- const VERBOSE = 4;
- const VERY_VERBOSE = 8;
- const DEBUG = 16;
- public function isInteractive();
- public function isVerbose();
- public function isVeryVerbose();
- public function isDebug();
- public function isDecorated();
- public function write($messages, $newline = true, $verbosity = self::NORMAL);
- public function writeError($messages, $newline = true, $verbosity = self::NORMAL);
- public function overwrite($messages, $newline = true, $size = null, $verbosity = self::NORMAL);
- public function overwriteError($messages, $newline = true, $size = null, $verbosity = self::NORMAL);
- public function ask($question, $default = null);
- public function askConfirmation($question, $default = true);
- public function askAndValidate($question, $validator, $attempts = null, $default = null);
- public function askAndHideAnswer($question);
- public function getAuthentications();
- public function hasAuthentication($repositoryName);
- public function getAuthentication($repositoryName);
- public function setAuthentication($repositoryName, $username, $password = null);
- public function loadConfiguration(Config $config);
- }
- <?php
- namespace Composer\IO;
- class NullIO extends BaseIO
- {
- public function isInteractive()
- {
- return false;
- }
- public function isVerbose()
- {
- return false;
- }
- public function isVeryVerbose()
- {
- return false;
- }
- public function isDebug()
- {
- return false;
- }
- public function isDecorated()
- {
- return false;
- }
- public function write($messages, $newline = true, $verbosity = self::NORMAL)
- {
- }
- public function writeError($messages, $newline = true, $verbosity = self::NORMAL)
- {
- }
- public function overwrite($messages, $newline = true, $size = 80, $verbosity = self::NORMAL)
- {
- }
- public function overwriteError($messages, $newline = true, $size = 80, $verbosity = self::NORMAL)
- {
- }
- public function ask($question, $default = null)
- {
- return $default;
- }
- public function askConfirmation($question, $default = true)
- {
- return $default;
- }
- public function askAndValidate($question, $validator, $attempts = false, $default = null)
- {
- return $default;
- }
- public function askAndHideAnswer($question)
- {
- return null;
- }
- }
- <?php
- namespace Composer;
- use Composer\Autoload\AutoloadGenerator;
- use Composer\DependencyResolver\DefaultPolicy;
- use Composer\DependencyResolver\Operation\UpdateOperation;
- use Composer\DependencyResolver\Operation\InstallOperation;
- use Composer\DependencyResolver\Operation\UninstallOperation;
- use Composer\DependencyResolver\Operation\OperationInterface;
- use Composer\DependencyResolver\PolicyInterface;
- use Composer\DependencyResolver\Pool;
- use Composer\DependencyResolver\Request;
- use Composer\DependencyResolver\Rule;
- use Composer\DependencyResolver\Solver;
- use Composer\DependencyResolver\SolverProblemsException;
- use Composer\Downloader\DownloadManager;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Installer\InstallationManager;
- use Composer\Installer\InstallerEvents;
- use Composer\Installer\NoopInstaller;
- use Composer\IO\IOInterface;
- use Composer\Json\JsonFile;
- use Composer\Package\AliasPackage;
- use Composer\Package\CompletePackage;
- use Composer\Package\Link;
- use Composer\Semver\Constraint\Constraint;
- use Composer\Package\Locker;
- use Composer\Package\PackageInterface;
- use Composer\Package\RootPackageInterface;
- use Composer\Repository\CompositeRepository;
- use Composer\Repository\InstalledArrayRepository;
- use Composer\Repository\InstalledFilesystemRepository;
- use Composer\Repository\PlatformRepository;
- use Composer\Repository\RepositoryInterface;
- use Composer\Repository\RepositoryManager;
- use Composer\Repository\WritableRepositoryInterface;
- use Composer\Script\ScriptEvents;
- class Installer
- {
- protected $io;
- protected $config;
- protected $package;
- protected $downloadManager;
- protected $repositoryManager;
- protected $locker;
- protected $installationManager;
- protected $eventDispatcher;
- protected $autoloadGenerator;
- protected $preferSource = false;
- protected $preferDist = false;
- protected $optimizeAutoloader = false;
- protected $classMapAuthoritative = false;
- protected $devMode = false;
- protected $dryRun = false;
- protected $verbose = false;
- protected $update = false;
- protected $dumpAutoloader = true;
- protected $runScripts = true;
- protected $ignorePlatformReqs = false;
- protected $preferStable = false;
- protected $preferLowest = false;
- protected $updateWhitelist = null;
- protected $whitelistDependencies = false;
- protected $suggestedPackages;
- protected $additionalInstalledRepository;
- public function __construct(IOInterface $io, Config $config, RootPackageInterface $package, DownloadManager $downloadManager, RepositoryManager $repositoryManager, Locker $locker, InstallationManager $installationManager, EventDispatcher $eventDispatcher, AutoloadGenerator $autoloadGenerator)
- {
- $this->io = $io;
- $this->config = $config;
- $this->package = $package;
- $this->downloadManager = $downloadManager;
- $this->repositoryManager = $repositoryManager;
- $this->locker = $locker;
- $this->installationManager = $installationManager;
- $this->eventDispatcher = $eventDispatcher;
- $this->autoloadGenerator = $autoloadGenerator;
- }
- public function run()
- {
- gc_collect_cycles();
- gc_disable();
- if ($this->dryRun) {
- $this->verbose = true;
- $this->runScripts = false;
- $this->installationManager->addInstaller(new NoopInstaller);
- $this->mockLocalRepositories($this->repositoryManager);
- }
- if ($this->runScripts) {
- $eventName = $this->update ? ScriptEvents::PRE_UPDATE_CMD : ScriptEvents::PRE_INSTALL_CMD;
- $this->eventDispatcher->dispatchScript($eventName, $this->devMode);
- }
- $this->downloadManager->setPreferSource($this->preferSource);
- $this->downloadManager->setPreferDist($this->preferDist);
-
-
- $installedRootPackage = clone $this->package;
- $installedRootPackage->setRequires(array());
- $installedRootPackage->setDevRequires(array());
- $localRepo = $this->repositoryManager->getLocalRepository();
- if (!$this->update && $this->locker->isLocked()) {
- $platformOverrides = $this->locker->getPlatformOverrides();
- } else {
- $platformOverrides = $this->config->get('platform') ?: array();
- }
- $platformRepo = new PlatformRepository(array(), $platformOverrides);
- $repos = array(
- $localRepo,
- new InstalledArrayRepository(array($installedRootPackage)),
- $platformRepo,
- );
- $installedRepo = new CompositeRepository($repos);
- if ($this->additionalInstalledRepository) {
- $installedRepo->addRepository($this->additionalInstalledRepository);
- }
- $aliases = $this->getRootAliases();
- $this->aliasPlatformPackages($platformRepo, $aliases);
- try {
- $this->suggestedPackages = array();
- $res = $this->doInstall($localRepo, $installedRepo, $platformRepo, $aliases, $this->devMode);
- if ($res !== 0) {
- return $res;
- }
- } catch (\Exception $e) {
- if (!$this->dryRun) {
- $this->installationManager->notifyInstalls($this->io);
- }
- throw $e;
- }
- if (!$this->dryRun) {
- $this->installationManager->notifyInstalls($this->io);
- }
- if ($this->devMode) {
- foreach ($this->suggestedPackages as $suggestion) {
- $target = $suggestion['target'];
- foreach ($installedRepo->getPackages() as $package) {
- if (in_array($target, $package->getNames())) {
- continue 2;
- }
- }
- $this->io->writeError($suggestion['source'].' suggests installing '.$suggestion['target'].' ('.$suggestion['reason'].')');
- }
- }
- foreach ($localRepo->getPackages() as $package) {
- if (!$package instanceof CompletePackage || !$package->isAbandoned()) {
- continue;
- }
- $replacement = (is_string($package->getReplacementPackage()))
- ? 'Use ' . $package->getReplacementPackage() . ' instead'
- : 'No replacement was suggested';
- $this->io->writeError(
- sprintf(
- "<warning>Package %s is abandoned, you should avoid using it. %s.</warning>",
- $package->getPrettyName(),
- $replacement
- )
- );
- }
- if (!$this->dryRun) {
- if ($this->update || !$this->locker->isLocked()) {
- $localRepo->reload();
-
- $devPackages = ($this->devMode || !$this->package->getDevRequires()) ? array() : null;
- if ($this->devMode && $this->package->getDevRequires()) {
- $policy = $this->createPolicy();
- $pool = $this->createPool(true);
- $pool->addRepository($installedRepo, $aliases);
- $request = $this->createRequest($this->package, $platformRepo);
- $request->updateAll();
- foreach ($this->package->getRequires() as $link) {
- $request->install($link->getTarget(), $link->getConstraint());
- }
- $this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::PRE_DEPENDENCIES_SOLVING, false, $policy, $pool, $installedRepo, $request);
- $solver = new Solver($policy, $pool, $installedRepo);
- $ops = $solver->solve($request, $this->ignorePlatformReqs);
- $this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::POST_DEPENDENCIES_SOLVING, false, $policy, $pool, $installedRepo, $request, $ops);
- foreach ($ops as $op) {
- if ($op->getJobType() === 'uninstall') {
- $devPackages[] = $op->getPackage();
- }
- }
- }
- $platformReqs = $this->extractPlatformRequirements($this->package->getRequires());
- $platformDevReqs = $this->devMode ? $this->extractPlatformRequirements($this->package->getDevRequires()) : array();
- $updatedLock = $this->locker->setLockData(
- array_diff($localRepo->getCanonicalPackages(), (array) $devPackages),
- $devPackages,
- $platformReqs,
- $platformDevReqs,
- $aliases,
- $this->package->getMinimumStability(),
- $this->package->getStabilityFlags(),
- $this->preferStable || $this->package->getPreferStable(),
- $this->preferLowest,
- $this->config->get('platform') ?: array()
- );
- if ($updatedLock) {
- $this->io->writeError('<info>Writing lock file</info>');
- }
- }
- if ($this->dumpAutoloader) {
- if ($this->optimizeAutoloader) {
- $this->io->writeError('<info>Generating optimized autoload files</info>');
- } else {
- $this->io->writeError('<info>Generating autoload files</info>');
- }
- $this->autoloadGenerator->setDevMode($this->devMode);
- $this->autoloadGenerator->setClassMapAuthoritative($this->classMapAuthoritative);
- $this->autoloadGenerator->setRunScripts($this->runScripts);
- $this->autoloadGenerator->dump($this->config, $localRepo, $this->package, $this->installationManager, 'composer', $this->optimizeAutoloader);
- }
- if ($this->runScripts) {
- $eventName = $this->update ? ScriptEvents::POST_UPDATE_CMD : ScriptEvents::POST_INSTALL_CMD;
- $this->eventDispatcher->dispatchScript($eventName, $this->devMode);
- }
- $vendorDir = $this->config->get('vendor-dir');
- if (is_dir($vendorDir)) {
-
- @touch($vendorDir);
- }
- }
- return 0;
- }
- protected function doInstall($localRepo, $installedRepo, $platformRepo, $aliases, $withDevReqs)
- {
- $lockedRepository = null;
- $repositories = null;
- $installFromLock = !$this->update && $this->locker->isLocked();
-
-
- if ($installFromLock || (!empty($this->updateWhitelist) && $this->locker->isLocked())) {
- try {
- $lockedRepository = $this->locker->getLockedRepository($withDevReqs);
- } catch (\RuntimeException $e) {
- if ($this->package->getDevRequires()) {
- throw $e;
- }
- $lockedRepository = $this->locker->getLockedRepository();
- }
- }
- $this->whitelistUpdateDependencies(
- $localRepo,
- $withDevReqs,
- $this->package->getRequires(),
- $this->package->getDevRequires()
- );
- $this->io->writeError('<info>Loading composer repositories with package information</info>');
- $policy = $this->createPolicy();
- $pool = $this->createPool($withDevReqs, $installFromLock ? $lockedRepository : null);
- $pool->addRepository($installedRepo, $aliases);
- if (!$installFromLock) {
- $repositories = $this->repositoryManager->getRepositories();
- foreach ($repositories as $repository) {
- $pool->addRepository($repository, $aliases);
- }
- }
-
-
- if ($lockedRepository) {
- $pool->addRepository($lockedRepository, $aliases);
- }
- $request = $this->createRequest($this->package, $platformRepo);
- if (!$installFromLock) {
- $removedUnstablePackages = array();
- foreach ($localRepo->getPackages() as $package) {
- if (
- !$pool->isPackageAcceptable($package->getNames(), $package->getStability())
- && $this->installationManager->isPackageInstalled($localRepo, $package)
- ) {
- $removedUnstablePackages[$package->getName()] = true;
- $request->remove($package->getName(), new Constraint('=', $package->getVersion()));
- }
- }
- }
- if ($this->update) {
- $this->io->writeError('<info>Updating dependencies'.($withDevReqs ? ' (including require-dev)' : '').'</info>');
- $request->updateAll();
- if ($withDevReqs) {
- $links = array_merge($this->package->getRequires(), $this->package->getDevRequires());
- } else {
- $links = $this->package->getRequires();
- }
- foreach ($links as $link) {
- $request->install($link->getTarget(), $link->getConstraint());
- }
-
- if ($this->updateWhitelist) {
- $currentPackages = $this->getCurrentPackages($withDevReqs, $installedRepo);
- $candidates = array();
- foreach ($links as $link) {
- $candidates[$link->getTarget()] = true;
- }
- foreach ($localRepo->getPackages() as $package) {
- $candidates[$package->getName()] = true;
- }
- foreach ($candidates as $candidate => $dummy) {
- foreach ($currentPackages as $curPackage) {
- if ($curPackage->getName() === $candidate) {
- if (!$this->isUpdateable($curPackage) && !isset($removedUnstablePackages[$curPackage->getName()])) {
- $constraint = new Constraint('=', $curPackage->getVersion());
- $request->install($curPackage->getName(), $constraint);
- }
- break;
- }
- }
- }
- }
- } elseif ($installFromLock) {
- $this->io->writeError('<info>Installing dependencies'.($withDevReqs ? ' (including require-dev)' : '').' from lock file</info>');
- if (!$this->locker->isFresh()) {
- $this->io->writeError('<warning>Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.</warning>');
- }
- foreach ($lockedRepository->getPackages() as $package) {
- $version = $package->getVersion();
- if (isset($aliases[$package->getName()][$version])) {
- $version = $aliases[$package->getName()][$version]['alias_normalized'];
- }
- $constraint = new Constraint('=', $version);
- $constraint->setPrettyString($package->getPrettyVersion());
- $request->install($package->getName(), $constraint);
- }
- foreach ($this->locker->getPlatformRequirements($withDevReqs) as $link) {
- $request->install($link->getTarget(), $link->getConstraint());
- }
- } else {
- $this->io->writeError('<info>Installing dependencies'.($withDevReqs ? ' (including require-dev)' : '').'</info>');
- if ($withDevReqs) {
- $links = array_merge($this->package->getRequires(), $this->package->getDevRequires());
- } else {
- $links = $this->package->getRequires();
- }
- foreach ($links as $link) {
- $request->install($link->getTarget(), $link->getConstraint());
- }
- }
- $this->processDevPackages($localRepo, $pool, $policy, $repositories, $installedRepo, $lockedRepository, $installFromLock, $withDevReqs, 'force-links');
- $this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::PRE_DEPENDENCIES_SOLVING, $this->devMode, $policy, $pool, $installedRepo, $request);
- $solver = new Solver($policy, $pool, $installedRepo);
- try {
- $operations = $solver->solve($request, $this->ignorePlatformReqs);
- $this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::POST_DEPENDENCIES_SOLVING, $this->devMode, $policy, $pool, $installedRepo, $request, $operations);
- } catch (SolverProblemsException $e) {
- $this->io->writeError('<error>Your requirements could not be resolved to an installable set of packages.</error>');
- $this->io->writeError($e->getMessage());
- return max(1, $e->getCode());
- }
- $this->io->writeError("Analyzed ".count($pool)." packages to resolve dependencies", true, IOInterface::VERBOSE);
- $this->io->writeError("Analyzed ".$solver->getRuleSetSize()." rules to resolve dependencies", true, IOInterface::VERBOSE);
- $operations = $this->processDevPackages($localRepo, $pool, $policy, $repositories, $installedRepo, $lockedRepository, $installFromLock, $withDevReqs, 'force-updates', $operations);
- if (!$operations) {
- $this->io->writeError('Nothing to install or update');
- }
- $operations = $this->movePluginsToFront($operations);
- $operations = $this->moveUninstallsToFront($operations);
- foreach ($operations as $operation) {
- if ('install' === $operation->getJobType()) {
- foreach ($operation->getPackage()->getSuggests() as $target => $reason) {
- $this->suggestedPackages[] = array(
- 'source' => $operation->getPackage()->getPrettyName(),
- 'target' => $target,
- 'reason' => $reason,
- );
- }
- }
- if (!$installFromLock) {
- $package = null;
- if ('update' === $operation->getJobType()) {
- $package = $operation->getTargetPackage();
- } elseif ('install' === $operation->getJobType()) {
- $package = $operation->getPackage();
- }
- if ($package && $package->isDev()) {
- $references = $this->package->getReferences();
- if (isset($references[$package->getName()])) {
- $package->setSourceReference($references[$package->getName()]);
- $package->setDistReference($references[$package->getName()]);
- }
- }
- if ('update' === $operation->getJobType()
- && $operation->getTargetPackage()->isDev()
- && $operation->getTargetPackage()->getVersion() === $operation->getInitialPackage()->getVersion()
- && (!$operation->getTargetPackage()->getSourceReference() || $operation->getTargetPackage()->getSourceReference() === $operation->getInitialPackage()->getSourceReference())
- && (!$operation->getTargetPackage()->getDistReference() || $operation->getTargetPackage()->getDistReference() === $operation->getInitialPackage()->getDistReference())
- ) {
- $this->io->writeError(' - Skipping update of '. $operation->getTargetPackage()->getPrettyName().' to the same reference-locked version', true, IOInterface::DEBUG);
- $this->io->writeError('', true, IOInterface::DEBUG);
- continue;
- }
- }
- $event = 'Composer\Installer\PackageEvents::PRE_PACKAGE_'.strtoupper($operation->getJobType());
- if (defined($event) && $this->runScripts) {
- $this->eventDispatcher->dispatchPackageEvent(constant($event), $this->devMode, $policy, $pool, $installedRepo, $request, $operations, $operation);
- }
- if ($this->dryRun && false === strpos($operation->getJobType(), 'Alias')) {
- $this->io->writeError(' - ' . $operation);
- $this->io->writeError('');
- } elseif ($this->io->isDebug() && false !== strpos($operation->getJobType(), 'Alias')) {
- $this->io->writeError(' - ' . $operation);
- $this->io->writeError('');
- }
- $this->installationManager->execute($localRepo, $operation);
- if ($this->verbose && $this->io->isVeryVerbose() && in_array($operation->getJobType(), array('install', 'update'))) {
- $reason = $operation->getReason();
- if ($reason instanceof Rule) {
- switch ($reason->getReason()) {
- case Rule::RULE_JOB_INSTALL:
- $this->io->writeError(' REASON: Required by root: '.$reason->getPrettyString($pool));
- $this->io->writeError('');
- break;
- case Rule::RULE_PACKAGE_REQUIRES:
- $this->io->writeError(' REASON: '.$reason->getPrettyString($pool));
- $this->io->writeError('');
- break;
- }
- }
- }
- $event = 'Composer\Installer\PackageEvents::POST_PACKAGE_'.strtoupper($operation->getJobType());
- if (defined($event) && $this->runScripts) {
- $this->eventDispatcher->dispatchPackageEvent(constant($event), $this->devMode, $policy, $pool, $installedRepo, $request, $operations, $operation);
- }
- if (!$this->dryRun) {
- $localRepo->write();
- }
- }
- if (!$this->dryRun) {
- $this->processPackageUrls($pool, $policy, $localRepo, $repositories);
- $localRepo->write();
- }
- return 0;
- }
- private function movePluginsToFront(array $operations)
- {
- $installerOps = array();
- foreach ($operations as $idx => $op) {
- if ($op instanceof InstallOperation) {
- $package = $op->getPackage();
- } elseif ($op instanceof UpdateOperation) {
- $package = $op->getTargetPackage();
- } else {
- continue;
- }
- if ($package->getType() === 'composer-plugin' || $package->getType() === 'composer-installer') {
- $requires = array_keys($package->getRequires());
- foreach ($requires as $index => $req) {
- if ($req === 'composer-plugin-api' || preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $req)) {
- unset($requires[$index]);
- }
- }
- if (!count($requires)) {
- $installerOps[] = $op;
- unset($operations[$idx]);
- }
- }
- }
- return array_merge($installerOps, $operations);
- }
- private function moveUninstallsToFront(array $operations)
- {
- $uninstOps = array();
- foreach ($operations as $idx => $op) {
- if ($op instanceof UninstallOperation) {
- $uninstOps[] = $op;
- unset($operations[$idx]);
- }
- }
- return array_merge($uninstOps, $operations);
- }
- private function createPool($withDevReqs, RepositoryInterface $lockedRepository = null)
- {
- if (!$this->update && $this->locker->isLocked()) {
- $minimumStability = $this->locker->getMinimumStability();
- $stabilityFlags = $this->locker->getStabilityFlags();
- $requires = array();
- foreach ($lockedRepository->getPackages() as $package) {
- $constraint = new Constraint('=', $package->getVersion());
- $constraint->setPrettyString($package->getPrettyVersion());
- $requires[$package->getName()] = $constraint;
- }
- } else {
- $minimumStability = $this->package->getMinimumStability();
- $stabilityFlags = $this->package->getStabilityFlags();
- $requires = $this->package->getRequires();
- if ($withDevReqs) {
- $requires = array_merge($requires, $this->package->getDevRequires());
- }
- }
- $rootConstraints = array();
- foreach ($requires as $req => $constraint) {
- if ($this->ignorePlatformReqs && preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $req)) {
- continue;
- }
- if ($constraint instanceof Link) {
- $rootConstraints[$req] = $constraint->getConstraint();
- } else {
- $rootConstraints[$req] = $constraint;
- }
- }
- return new Pool($minimumStability, $stabilityFlags, $rootConstraints);
- }
- private function createPolicy()
- {
- $preferStable = null;
- $preferLowest = null;
- if (!$this->update && $this->locker->isLocked()) {
- $preferStable = $this->locker->getPreferStable();
- $preferLowest = $this->locker->getPreferLowest();
- }
-
- if (null === $preferStable) {
- $preferStable = $this->preferStable || $this->package->getPreferStable();
- }
- if (null === $preferLowest) {
- $preferLowest = $this->preferLowest;
- }
- return new DefaultPolicy($preferStable, $preferLowest);
- }
- private function createRequest(RootPackageInterface $rootPackage, PlatformRepository $platformRepo)
- {
- $request = new Request();
- $constraint = new Constraint('=', $rootPackage->getVersion());
- $constraint->setPrettyString($rootPackage->getPrettyVersion());
- $request->install($rootPackage->getName(), $constraint);
- $fixedPackages = $platformRepo->getPackages();
- if ($this->additionalInstalledRepository) {
- $additionalFixedPackages = $this->additionalInstalledRepository->getPackages();
- $fixedPackages = array_merge($fixedPackages, $additionalFixedPackages);
- }
-
- $provided = $rootPackage->getProvides();
- foreach ($fixedPackages as $package) {
- $constraint = new Constraint('=', $package->getVersion());
- $constraint->setPrettyString($package->getPrettyVersion());
- if ($package->getRepository() !== $platformRepo
- || !isset($provided[$package->getName()])
- || !$provided[$package->getName()]->getConstraint()->matches($constraint)
- ) {
- $request->fix($package->getName(), $constraint);
- }
- }
- return $request;
- }
- private function processDevPackages($localRepo, $pool, $policy, $repositories, $installedRepo, $lockedRepository, $installFromLock, $withDevReqs, $task, array $operations = null)
- {
- if ($task === 'force-updates' && null === $operations) {
- throw new \InvalidArgumentException('Missing operations argument');
- }
- if ($task === 'force-links') {
- $operations = array();
- }
- if (!$installFromLock && $this->updateWhitelist) {
- $currentPackages = $this->getCurrentPackages($withDevReqs, $installedRepo);
- }
- foreach ($localRepo->getCanonicalPackages() as $package) {
- if (!$package->isDev()) {
- continue;
- }
- foreach ($operations as $operation) {
- if (('update' === $operation->getJobType() && $operation->getInitialPackage()->equals($package))
- || ('uninstall' === $operation->getJobType() && $operation->getPackage()->equals($package))
- ) {
- continue 2;
- }
- }
- if ($installFromLock) {
- foreach ($lockedRepository->findPackages($package->getName()) as $lockedPackage) {
- if ($lockedPackage->isDev() && $lockedPackage->getVersion() === $package->getVersion()) {
- if ($task === 'force-links') {
- $package->setRequires($lockedPackage->getRequires());
- $package->setConflicts($lockedPackage->getConflicts());
- $package->setProvides($lockedPackage->getProvides());
- $package->setReplaces($lockedPackage->getReplaces());
- } elseif ($task === 'force-updates') {
- if (($lockedPackage->getSourceReference() && $lockedPackage->getSourceReference() !== $package->getSourceReference())
- || ($lockedPackage->getDistReference() && $lockedPackage->getDistReference() !== $package->getDistReference())
- ) {
- $operations[] = new UpdateOperation($package, $lockedPackage);
- }
- }
- break;
- }
- }
- } else {
- if ($this->update) {
- if ($this->updateWhitelist && !$this->isUpdateable($package)) {
- foreach ($currentPackages as $curPackage) {
- if ($curPackage->isDev() && $curPackage->getName() === $package->getName() && $curPackage->getVersion() === $package->getVersion()) {
- if ($task === 'force-links') {
- $package->setRequires($curPackage->getRequires());
- $package->setConflicts($curPackage->getConflicts());
- $package->setProvides($curPackage->getProvides());
- $package->setReplaces($curPackage->getReplaces());
- } elseif ($task === 'force-updates') {
- if (($curPackage->getSourceReference() && $curPackage->getSourceReference() !== $package->getSourceReference())
- || ($curPackage->getDistReference() && $curPackage->getDistReference() !== $package->getDistReference())
- ) {
- $operations[] = new UpdateOperation($package, $curPackage);
- }
- }
- break;
- }
- }
- continue;
- }
- $matches = $pool->whatProvides($package->getName(), new Constraint('=', $package->getVersion()));
- foreach ($matches as $index => $match) {
- if (!in_array($match->getRepository(), $repositories, true)) {
- unset($matches[$index]);
- continue;
- }
- if ($match->getName() !== $package->getName()) {
- unset($matches[$index]);
- continue;
- }
- $matches[$index] = $match->getId();
- }
- if ($matches && $matches = $policy->selectPreferredPackages($pool, array(), $matches)) {
- $newPackage = $pool->literalToPackage($matches[0]);
- if ($task === 'force-links' && $newPackage) {
- $package->setRequires($newPackage->getRequires());
- $package->setConflicts($newPackage->getConflicts());
- $package->setProvides($newPackage->getProvides());
- $package->setReplaces($newPackage->getReplaces());
- }
- if ($task === 'force-updates' && $newPackage && (
- (($newPackage->getSourceReference() && $newPackage->getSourceReference() !== $package->getSourceReference())
- || ($newPackage->getDistReference() && $newPackage->getDistReference() !== $package->getDistReference())
- )
- )) {
- $operations[] = new UpdateOperation($package, $newPackage);
- }
- }
- }
- if ($task === 'force-updates') {
- $references = $this->package->getReferences();
- if (isset($references[$package->getName()]) && $references[$package->getName()] !== $package->getSourceReference()) {
- $operations[] = new UpdateOperation($package, clone $package);
- }
- }
- }
- }
- return $operations;
- }
- private function getCurrentPackages($withDevReqs, $installedRepo)
- {
- if ($this->locker->isLocked()) {
- try {
- return $this->locker->getLockedRepository($withDevReqs)->getPackages();
- } catch (\RuntimeException $e) {
- return $this->locker->getLockedRepository()->getPackages();
- }
- }
- return $installedRepo->getPackages();
- }
- private function getRootAliases()
- {
- if (!$this->update && $this->locker->isLocked()) {
- $aliases = $this->locker->getAliases();
- } else {
- $aliases = $this->package->getAliases();
- }
- $normalizedAliases = array();
- foreach ($aliases as $alias) {
- $normalizedAliases[$alias['package']][$alias['version']] = array(
- 'alias' => $alias['alias'],
- 'alias_normalized' => $alias['alias_normalized'],
- );
- }
- return $normalizedAliases;
- }
- private function processPackageUrls($pool, $policy, $localRepo, $repositories)
- {
- if (!$this->update) {
- return;
- }
- foreach ($localRepo->getCanonicalPackages() as $package) {
- $matches = $pool->whatProvides($package->getName(), new Constraint('=', $package->getVersion()));
- foreach ($matches as $index => $match) {
- if (!in_array($match->getRepository(), $repositories, true)) {
- unset($matches[$index]);
- continue;
- }
- if ($match->getName() !== $package->getName()) {
- unset($matches[$index]);
- continue;
- }
- $matches[$index] = $match->getId();
- }
- if ($matches && $matches = $policy->selectPreferredPackages($pool, array(), $matches)) {
- $newPackage = $pool->literalToPackage($matches[0]);
- $sourceUrl = $package->getSourceUrl();
- $newSourceUrl = $newPackage->getSourceUrl();
- if ($sourceUrl !== $newSourceUrl) {
- $package->setSourceType($newPackage->getSourceType());
- $package->setSourceUrl($newSourceUrl);
- $package->setSourceReference($newPackage->getSourceReference());
- }
-
- if (preg_match('{^https?://(?:(?:www\.)?bitbucket\.org|(api\.)?github\.com)/}', $newPackage->getDistUrl())) {
- $package->setDistUrl($newPackage->getDistUrl());
- }
- }
- }
- }
- private function aliasPlatformPackages(PlatformRepository $platformRepo, $aliases)
- {
- foreach ($aliases as $package => $versions) {
- foreach ($versions as $version => $alias) {
- $packages = $platformRepo->findPackages($package, $version);
- foreach ($packages as $package) {
- $aliasPackage = new AliasPackage($package, $alias['alias_normalized'], $alias['alias']);
- $aliasPackage->setRootPackageAlias(true);
- $platformRepo->addPackage($aliasPackage);
- }
- }
- }
- }
- private function isUpdateable(PackageInterface $package)
- {
- if (!$this->updateWhitelist) {
- throw new \LogicException('isUpdateable should only be called when a whitelist is present');
- }
- foreach ($this->updateWhitelist as $whiteListedPattern => $void) {
- $patternRegexp = $this->packageNameToRegexp($whiteListedPattern);
- if (preg_match($patternRegexp, $package->getName())) {
- return true;
- }
- }
- return false;
- }
- private function packageNameToRegexp($whiteListedPattern)
- {
- $cleanedWhiteListedPattern = str_replace('\\*', '.*', preg_quote($whiteListedPattern));
- return "{^" . $cleanedWhiteListedPattern . "$}i";
- }
- private function extractPlatformRequirements($links)
- {
- $platformReqs = array();
- foreach ($links as $link) {
- if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $link->getTarget())) {
- $platformReqs[$link->getTarget()] = $link->getPrettyConstraint();
- }
- }
- return $platformReqs;
- }
- private function whitelistUpdateDependencies($localRepo, $devMode, array $rootRequires, array $rootDevRequires)
- {
- if (!$this->updateWhitelist) {
- return;
- }
- $requiredPackageNames = array();
- foreach (array_merge($rootRequires, $rootDevRequires) as $require) {
- $requiredPackageNames[] = $require->getTarget();
- }
- if ($devMode) {
- $rootRequires = array_merge($rootRequires, $rootDevRequires);
- }
- $skipPackages = array();
- foreach ($rootRequires as $require) {
- $skipPackages[$require->getTarget()] = true;
- }
- $pool = new Pool;
- $pool->addRepository($localRepo);
- $seen = array();
- $rootRequiredPackageNames = array_keys($rootRequires);
- foreach ($this->updateWhitelist as $packageName => $void) {
- $packageQueue = new \SplQueue;
- $depPackages = $pool->whatProvides($packageName);
- $nameMatchesRequiredPackage = in_array($packageName, $requiredPackageNames, true);
- if (!$nameMatchesRequiredPackage) {
- $whitelistPatternRegexp = $this->packageNameToRegexp($packageName);
- foreach ($rootRequiredPackageNames as $rootRequiredPackageName) {
- if (preg_match($whitelistPatternRegexp, $rootRequiredPackageName)) {
- $nameMatchesRequiredPackage = true;
- break;
- }
- }
- }
- if (count($depPackages) == 0 && !$nameMatchesRequiredPackage && !in_array($packageName, array('nothing', 'lock'))) {
- $this->io->writeError('<warning>Package "' . $packageName . '" listed for update is not installed. Ignoring.</warning>');
- }
- foreach ($depPackages as $depPackage) {
- $packageQueue->enqueue($depPackage);
- }
- while (!$packageQueue->isEmpty()) {
- $package = $packageQueue->dequeue();
- if (isset($seen[$package->getId()])) {
- continue;
- }
- $seen[$package->getId()] = true;
- $this->updateWhitelist[$package->getName()] = true;
- if (!$this->whitelistDependencies) {
- continue;
- }
- $requires = $package->getRequires();
- foreach ($requires as $require) {
- $requirePackages = $pool->whatProvides($require->getTarget());
- foreach ($requirePackages as $requirePackage) {
- if (isset($skipPackages[$requirePackage->getName()])) {
- $this->io->writeError('<warning>Dependency "' . $requirePackage->getName() . '" is also a root requirement, but is not explicitly whitelisted. Ignoring.</warning>');
- continue;
- }
- $packageQueue->enqueue($requirePackage);
- }
- }
- }
- }
- }
- private function mockLocalRepositories(RepositoryManager $rm)
- {
- $packages = array();
- foreach ($rm->getLocalRepository()->getPackages() as $package) {
- $packages[(string) $package] = clone $package;
- }
- foreach ($packages as $key => $package) {
- if ($package instanceof AliasPackage) {
- $alias = (string) $package->getAliasOf();
- $packages[$key] = new AliasPackage($packages[$alias], $package->getVersion(), $package->getPrettyVersion());
- }
- }
- $rm->setLocalRepository(
- new InstalledArrayRepository($packages)
- );
- }
- public static function create(IOInterface $io, Composer $composer)
- {
- return new static(
- $io,
- $composer->getConfig(),
- $composer->getPackage(),
- $composer->getDownloadManager(),
- $composer->getRepositoryManager(),
- $composer->getLocker(),
- $composer->getInstallationManager(),
- $composer->getEventDispatcher(),
- $composer->getAutoloadGenerator()
- );
- }
- public function setAdditionalInstalledRepository(RepositoryInterface $additionalInstalledRepository)
- {
- $this->additionalInstalledRepository = $additionalInstalledRepository;
- return $this;
- }
- public function setDryRun($dryRun = true)
- {
- $this->dryRun = (boolean) $dryRun;
- return $this;
- }
- public function isDryRun()
- {
- return $this->dryRun;
- }
- public function setPreferSource($preferSource = true)
- {
- $this->preferSource = (boolean) $preferSource;
- return $this;
- }
- public function setPreferDist($preferDist = true)
- {
- $this->preferDist = (boolean) $preferDist;
- return $this;
- }
- public function setOptimizeAutoloader($optimizeAutoloader = false)
- {
- $this->optimizeAutoloader = (boolean) $optimizeAutoloader;
- if (!$this->optimizeAutoloader) {
-
- $this->setClassMapAuthoritative(false);
- }
- return $this;
- }
- public function setClassMapAuthoritative($classMapAuthoritative = false)
- {
- $this->classMapAuthoritative = (boolean) $classMapAuthoritative;
- if ($this->classMapAuthoritative) {
- $this->setOptimizeAutoloader(true);
- }
- return $this;
- }
- public function setUpdate($update = true)
- {
- $this->update = (boolean) $update;
- return $this;
- }
- public function setDevMode($devMode = true)
- {
- $this->devMode = (boolean) $devMode;
- return $this;
- }
- public function setDumpAutoloader($dumpAutoloader = true)
- {
- $this->dumpAutoloader = (boolean) $dumpAutoloader;
- return $this;
- }
- public function setRunScripts($runScripts = true)
- {
- $this->runScripts = (boolean) $runScripts;
- return $this;
- }
- public function setConfig(Config $config)
- {
- $this->config = $config;
- return $this;
- }
- public function setVerbose($verbose = true)
- {
- $this->verbose = (boolean) $verbose;
- return $this;
- }
- public function isVerbose()
- {
- return $this->verbose;
- }
- public function setIgnorePlatformRequirements($ignorePlatformReqs = false)
- {
- $this->ignorePlatformReqs = (boolean) $ignorePlatformReqs;
- return $this;
- }
- public function setUpdateWhitelist(array $packages)
- {
- $this->updateWhitelist = array_flip(array_map('strtolower', $packages));
- return $this;
- }
- public function setWhitelistDependencies($updateDependencies = true)
- {
- $this->whitelistDependencies = (boolean) $updateDependencies;
- return $this;
- }
- public function setPreferStable($preferStable = true)
- {
- $this->preferStable = (boolean) $preferStable;
- return $this;
- }
- public function setPreferLowest($preferLowest = true)
- {
- $this->preferLowest = (boolean) $preferLowest;
- return $this;
- }
- public function disablePlugins()
- {
- $this->installationManager->disablePlugins();
- return $this;
- }
- }
- <?php
- namespace Composer\Installer;
- use Composer\IO\IOInterface;
- use Composer\Package\PackageInterface;
- use Composer\Package\AliasPackage;
- use Composer\Repository\RepositoryInterface;
- use Composer\Repository\InstalledRepositoryInterface;
- use Composer\DependencyResolver\Operation\OperationInterface;
- use Composer\DependencyResolver\Operation\InstallOperation;
- use Composer\DependencyResolver\Operation\UpdateOperation;
- use Composer\DependencyResolver\Operation\UninstallOperation;
- use Composer\DependencyResolver\Operation\MarkAliasInstalledOperation;
- use Composer\DependencyResolver\Operation\MarkAliasUninstalledOperation;
- use Composer\Util\StreamContextFactory;
- class InstallationManager
- {
- private $installers = array();
- private $cache = array();
- private $notifiablePackages = array();
- public function reset()
- {
- $this->notifiablePackages = array();
- }
- public function addInstaller(InstallerInterface $installer)
- {
- array_unshift($this->installers, $installer);
- $this->cache = array();
- }
- public function removeInstaller(InstallerInterface $installer)
- {
- if (false !== ($key = array_search($installer, $this->installers, true))) {
- array_splice($this->installers, $key, 1);
- $this->cache = array();
- }
- }
- public function disablePlugins()
- {
- foreach ($this->installers as $i => $installer) {
- if (!$installer instanceof PluginInstaller) {
- continue;
- }
- unset($this->installers[$i]);
- }
- }
- public function getInstaller($type)
- {
- $type = strtolower($type);
- if (isset($this->cache[$type])) {
- return $this->cache[$type];
- }
- foreach ($this->installers as $installer) {
- if ($installer->supports($type)) {
- return $this->cache[$type] = $installer;
- }
- }
- throw new \InvalidArgumentException('Unknown installer type: '.$type);
- }
- public function isPackageInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- if ($package instanceof AliasPackage) {
- return $repo->hasPackage($package) && $this->isPackageInstalled($repo, $package->getAliasOf());
- }
- return $this->getInstaller($package->getType())->isInstalled($repo, $package);
- }
- public function execute(RepositoryInterface $repo, OperationInterface $operation)
- {
- $method = $operation->getJobType();
- $this->$method($repo, $operation);
- }
- public function install(RepositoryInterface $repo, InstallOperation $operation)
- {
- $package = $operation->getPackage();
- $installer = $this->getInstaller($package->getType());
- $installer->install($repo, $package);
- $this->markForNotification($package);
- }
- public function update(RepositoryInterface $repo, UpdateOperation $operation)
- {
- $initial = $operation->getInitialPackage();
- $target = $operation->getTargetPackage();
- $initialType = $initial->getType();
- $targetType = $target->getType();
- if ($initialType === $targetType) {
- $installer = $this->getInstaller($initialType);
- $installer->update($repo, $initial, $target);
- $this->markForNotification($target);
- } else {
- $this->getInstaller($initialType)->uninstall($repo, $initial);
- $this->getInstaller($targetType)->install($repo, $target);
- }
- }
- public function uninstall(RepositoryInterface $repo, UninstallOperation $operation)
- {
- $package = $operation->getPackage();
- $installer = $this->getInstaller($package->getType());
- $installer->uninstall($repo, $package);
- }
- public function markAliasInstalled(RepositoryInterface $repo, MarkAliasInstalledOperation $operation)
- {
- $package = $operation->getPackage();
- if (!$repo->hasPackage($package)) {
- $repo->addPackage(clone $package);
- }
- }
- public function markAliasUninstalled(RepositoryInterface $repo, MarkAliasUninstalledOperation $operation)
- {
- $package = $operation->getPackage();
- $repo->removePackage($package);
- }
- public function getInstallPath(PackageInterface $package)
- {
- $installer = $this->getInstaller($package->getType());
- return $installer->getInstallPath($package);
- }
- public function notifyInstalls(IOInterface $io)
- {
- foreach ($this->notifiablePackages as $repoUrl => $packages) {
- $repositoryName = parse_url($repoUrl, PHP_URL_HOST);
- if ($io->hasAuthentication($repositoryName)) {
- $auth = $io->getAuthentication($repositoryName);
- $authStr = base64_encode($auth['username'] . ':' . $auth['password']);
- $authHeader = 'Authorization: Basic '.$authStr;
- }
- if (strpos($repoUrl, '%package%')) {
- foreach ($packages as $package) {
- $url = str_replace('%package%', $package->getPrettyName(), $repoUrl);
- $params = array(
- 'version' => $package->getPrettyVersion(),
- 'version_normalized' => $package->getVersion(),
- );
- $opts = array('http' =>
- array(
- 'method' => 'POST',
- 'header' => array('Content-type: application/x-www-form-urlencoded'),
- 'content' => http_build_query($params, '', '&'),
- 'timeout' => 3,
- ),
- );
- if (isset($authHeader)) {
- $opts['http']['header'][] = $authHeader;
- }
- $context = StreamContextFactory::getContext($url, $opts);
- @file_get_contents($url, false, $context);
- }
- continue;
- }
- $postData = array('downloads' => array());
- foreach ($packages as $package) {
- $postData['downloads'][] = array(
- 'name' => $package->getPrettyName(),
- 'version' => $package->getVersion(),
- );
- }
- $opts = array('http' =>
- array(
- 'method' => 'POST',
- 'header' => array('Content-Type: application/json'),
- 'content' => json_encode($postData),
- 'timeout' => 6,
- ),
- );
- if (isset($authHeader)) {
- $opts['http']['header'][] = $authHeader;
- }
- $context = StreamContextFactory::getContext($repoUrl, $opts);
- @file_get_contents($repoUrl, false, $context);
- }
- $this->reset();
- }
- private function markForNotification(PackageInterface $package)
- {
- if ($package->getNotificationUrl()) {
- $this->notifiablePackages[$package->getNotificationUrl()][$package->getName()] = $package;
- }
- }
- }
- <?php
- namespace Composer\Installer;
- use Composer\Composer;
- use Composer\DependencyResolver\PolicyInterface;
- use Composer\DependencyResolver\Operation\OperationInterface;
- use Composer\DependencyResolver\Pool;
- use Composer\DependencyResolver\Request;
- use Composer\EventDispatcher\Event;
- use Composer\IO\IOInterface;
- use Composer\Repository\CompositeRepository;
- class InstallerEvent extends Event
- {
- private $composer;
- private $io;
- private $devMode;
- private $policy;
- private $pool;
- private $installedRepo;
- private $request;
- private $operations;
- public function __construct($eventName, Composer $composer, IOInterface $io, $devMode, PolicyInterface $policy, Pool $pool, CompositeRepository $installedRepo, Request $request, array $operations = array())
- {
- parent::__construct($eventName);
- $this->composer = $composer;
- $this->io = $io;
- $this->devMode = $devMode;
- $this->policy = $policy;
- $this->pool = $pool;
- $this->installedRepo = $installedRepo;
- $this->request = $request;
- $this->operations = $operations;
- }
- public function getComposer()
- {
- return $this->composer;
- }
- public function getIO()
- {
- return $this->io;
- }
- public function isDevMode()
- {
- return $this->devMode;
- }
- public function getPolicy()
- {
- return $this->policy;
- }
- public function getPool()
- {
- return $this->pool;
- }
- public function getInstalledRepo()
- {
- return $this->installedRepo;
- }
- public function getRequest()
- {
- return $this->request;
- }
- public function getOperations()
- {
- return $this->operations;
- }
- }
- <?php
- namespace Composer\Installer;
- class InstallerEvents
- {
- const PRE_DEPENDENCIES_SOLVING = 'pre-dependencies-solving';
- const POST_DEPENDENCIES_SOLVING = 'post-dependencies-solving';
- }
- <?php
- namespace Composer\Installer;
- use Composer\Package\PackageInterface;
- use Composer\Repository\InstalledRepositoryInterface;
- use InvalidArgumentException;
- interface InstallerInterface
- {
- public function supports($packageType);
- public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package);
- public function install(InstalledRepositoryInterface $repo, PackageInterface $package);
- public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target);
- public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package);
- public function getInstallPath(PackageInterface $package);
- }
- <?php
- namespace Composer\Installer;
- use Composer\Composer;
- use Composer\IO\IOInterface;
- use Composer\Repository\InstalledRepositoryInterface;
- use Composer\Package\PackageInterface;
- use Composer\Util\Filesystem;
- use Composer\Util\Platform;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\Silencer;
- class LibraryInstaller implements InstallerInterface
- {
- protected $composer;
- protected $vendorDir;
- protected $binDir;
- protected $downloadManager;
- protected $io;
- protected $type;
- protected $filesystem;
- protected $binCompat;
- public function __construct(IOInterface $io, Composer $composer, $type = 'library', Filesystem $filesystem = null)
- {
- $this->composer = $composer;
- $this->downloadManager = $composer->getDownloadManager();
- $this->io = $io;
- $this->type = $type;
- $this->filesystem = $filesystem ?: new Filesystem();
- $this->vendorDir = rtrim($composer->getConfig()->get('vendor-dir'), '/');
- $this->binDir = rtrim($composer->getConfig()->get('bin-dir'), '/');
- $this->binCompat = $composer->getConfig()->get('bin-compat');
- }
- public function supports($packageType)
- {
- return $packageType === $this->type || null === $this->type;
- }
- public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- return $repo->hasPackage($package) && is_readable($this->getInstallPath($package));
- }
- public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- $this->initializeVendorDir();
- $downloadPath = $this->getInstallPath($package);
- if (!is_readable($downloadPath) && $repo->hasPackage($package)) {
- $this->removeBinaries($package);
- }
- $this->installCode($package);
- $this->installBinaries($package);
- if (!$repo->hasPackage($package)) {
- $repo->addPackage(clone $package);
- }
- }
- public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
- {
- if (!$repo->hasPackage($initial)) {
- throw new \InvalidArgumentException('Package is not installed: '.$initial);
- }
- $this->initializeVendorDir();
- $this->removeBinaries($initial);
- $this->updateCode($initial, $target);
- $this->installBinaries($target);
- $repo->removePackage($initial);
- if (!$repo->hasPackage($target)) {
- $repo->addPackage(clone $target);
- }
- }
- public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- if (!$repo->hasPackage($package)) {
- throw new \InvalidArgumentException('Package is not installed: '.$package);
- }
- $this->removeCode($package);
- $this->removeBinaries($package);
- $repo->removePackage($package);
- $downloadPath = $this->getPackageBasePath($package);
- if (strpos($package->getName(), '/')) {
- $packageVendorDir = dirname($downloadPath);
- if (is_dir($packageVendorDir) && $this->filesystem->isDirEmpty($packageVendorDir)) {
- Silencer::call('rmdir', $packageVendorDir);
- }
- }
- }
- public function getInstallPath(PackageInterface $package)
- {
- $this->initializeVendorDir();
- $basePath = ($this->vendorDir ? $this->vendorDir.'/' : '') . $package->getPrettyName();
- $targetDir = $package->getTargetDir();
- return $basePath . ($targetDir ? '/'.$targetDir : '');
- }
- protected function getPackageBasePath(PackageInterface $package)
- {
- $installPath = $this->getInstallPath($package);
- $targetDir = $package->getTargetDir();
- if ($targetDir) {
- return preg_replace('{/*'.str_replace('/', '/+', preg_quote($targetDir)).'/?$}', '', $installPath);
- }
- return $installPath;
- }
- protected function installCode(PackageInterface $package)
- {
- $downloadPath = $this->getInstallPath($package);
- $this->downloadManager->download($package, $downloadPath);
- }
- protected function updateCode(PackageInterface $initial, PackageInterface $target)
- {
- $initialDownloadPath = $this->getInstallPath($initial);
- $targetDownloadPath = $this->getInstallPath($target);
- if ($targetDownloadPath !== $initialDownloadPath) {
-
- if (substr($initialDownloadPath, 0, strlen($targetDownloadPath)) === $targetDownloadPath
- || substr($targetDownloadPath, 0, strlen($initialDownloadPath)) === $initialDownloadPath
- ) {
- $this->removeCode($initial);
- $this->installCode($target);
- return;
- }
- $this->filesystem->rename($initialDownloadPath, $targetDownloadPath);
- }
- $this->downloadManager->update($initial, $target, $targetDownloadPath);
- }
- protected function removeCode(PackageInterface $package)
- {
- $downloadPath = $this->getPackageBasePath($package);
- $this->downloadManager->remove($package, $downloadPath);
- }
- protected function getBinaries(PackageInterface $package)
- {
- return $package->getBinaries();
- }
- protected function installBinaries(PackageInterface $package)
- {
- $binaries = $this->getBinaries($package);
- if (!$binaries) {
- return;
- }
- foreach ($binaries as $bin) {
- $binPath = $this->getInstallPath($package).'/'.$bin;
- if (!file_exists($binPath)) {
- $this->io->writeError(' <warning>Skipped installation of bin '.$bin.' for package '.$package->getName().': file not found in package</warning>');
- continue;
- }
-
-
-
- $binPath = realpath($binPath);
- $this->initializeBinDir();
- $link = $this->binDir.'/'.basename($bin);
- if (file_exists($link)) {
- if (is_link($link)) {
-
-
- Silencer::call('chmod', $link, 0777 & ~umask());
- }
- $this->io->writeError(' Skipped installation of bin '.$bin.' for package '.$package->getName().': name conflicts with an existing file');
- continue;
- }
- if ($this->binCompat === "auto") {
- if (Platform::isWindows()) {
- $this->installFullBinaries($binPath, $link, $bin, $package);
- } else {
- $this->installSymlinkBinaries($binPath, $link);
- }
- } elseif ($this->binCompat === "full") {
- $this->installFullBinaries($binPath, $link, $bin, $package);
- }
- Silencer::call('chmod', $link, 0777 & ~umask());
- }
- }
- protected function installFullBinaries($binPath, $link, $bin, PackageInterface $package)
- {
- if ('.bat' !== substr($binPath, -4)) {
- $this->installUnixyProxyBinaries($binPath, $link);
- @chmod($link, 0777 & ~umask());
- $link .= '.bat';
- if (file_exists($link)) {
- $this->io->writeError(' Skipped installation of bin '.$bin.'.bat proxy for package '.$package->getName().': a .bat proxy was already installed');
- }
- }
- if (!file_exists($link)) {
- file_put_contents($link, $this->generateWindowsProxyCode($binPath, $link));
- }
- }
- protected function installSymlinkBinaries($binPath, $link)
- {
- if (!$this->filesystem->relativeSymlink($binPath, $link)) {
- $this->installUnixyProxyBinaries($binPath, $link);
- }
- }
- protected function installUnixyProxyBinaries($binPath, $link)
- {
- file_put_contents($link, $this->generateUnixyProxyCode($binPath, $link));
- }
- protected function removeBinaries(PackageInterface $package)
- {
- $binaries = $this->getBinaries($package);
- if (!$binaries) {
- return;
- }
- foreach ($binaries as $bin) {
- $link = $this->binDir.'/'.basename($bin);
- if (is_link($link) || file_exists($link)) {
- $this->filesystem->unlink($link);
- }
- if (file_exists($link.'.bat')) {
- $this->filesystem->unlink($link.'.bat');
- }
- }
- if ((is_dir($this->binDir)) && ($this->filesystem->isDirEmpty($this->binDir))) {
- Silencer::call('rmdir', $this->binDir);
- }
- }
- protected function initializeVendorDir()
- {
- $this->filesystem->ensureDirectoryExists($this->vendorDir);
- $this->vendorDir = realpath($this->vendorDir);
- }
- protected function initializeBinDir()
- {
- $this->filesystem->ensureDirectoryExists($this->binDir);
- $this->binDir = realpath($this->binDir);
- }
- protected function generateWindowsProxyCode($bin, $link)
- {
- $binPath = $this->filesystem->findShortestPath($link, $bin);
- if ('.bat' === substr($bin, -4) || '.exe' === substr($bin, -4)) {
- $caller = 'call';
- } else {
- $handle = fopen($bin, 'r');
- $line = fgets($handle);
- fclose($handle);
- if (preg_match('{^#!/(?:usr/bin/env )?(?:[^/]+/)*(.+)$}m', $line, $match)) {
- $caller = trim($match[1]);
- } else {
- $caller = 'php';
- }
- }
- return "@ECHO OFF\r\n".
- "SET BIN_TARGET=%~dp0/".trim(ProcessExecutor::escape($binPath), '"')."\r\n".
- "{$caller} \"%BIN_TARGET%\" %*\r\n";
- }
- protected function generateUnixyProxyCode($bin, $link)
- {
- $binPath = $this->filesystem->findShortestPath($link, $bin);
- $binDir = ProcessExecutor::escape(dirname($binPath));
- $binFile = basename($binPath);
- $proxyCode = <<<PROXY
- #!/usr/bin/env sh
- dir=$(d=\${0%[/\\\\]*}; cd "\$d"; cd $binDir && pwd)
- # See if we are running in Cygwin by checking for cygpath program
- if command -v 'cygpath' >/dev/null 2>&1; then
- # Cygwin paths start with /cygdrive/ which will break windows PHP,
- # so we need to translate the dir path to windows format. However
- # we could be using cygwin PHP which does not require this, so we
- # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
- if [[ $(which php) == /cygdrive/* ]]; then
- dir=$(cygpath -m "\$dir");
- fi
- fi
- dir=$(echo \$dir | sed 's/ /\ /g')
- "\${dir}/$binFile" "$@"
- PROXY;
- return $proxyCode;
- }
- }
- <?php
- namespace Composer\Installer;
- use Composer\Repository\InstalledRepositoryInterface;
- use Composer\Package\PackageInterface;
- class MetapackageInstaller implements InstallerInterface
- {
- public function supports($packageType)
- {
- return $packageType === 'metapackage';
- }
- public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- return $repo->hasPackage($package);
- }
- public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- $repo->addPackage(clone $package);
- }
- public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
- {
- if (!$repo->hasPackage($initial)) {
- throw new \InvalidArgumentException('Package is not installed: '.$initial);
- }
- $repo->removePackage($initial);
- $repo->addPackage(clone $target);
- }
- public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- if (!$repo->hasPackage($package)) {
- throw new \InvalidArgumentException('Package is not installed: '.$package);
- }
- $repo->removePackage($package);
- }
- public function getInstallPath(PackageInterface $package)
- {
- return '';
- }
- }
- <?php
- namespace Composer\Installer;
- use Composer\Repository\InstalledRepositoryInterface;
- use Composer\Package\PackageInterface;
- class NoopInstaller implements InstallerInterface
- {
- public function supports($packageType)
- {
- return true;
- }
- public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- return $repo->hasPackage($package);
- }
- public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- if (!$repo->hasPackage($package)) {
- $repo->addPackage(clone $package);
- }
- }
- public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
- {
- if (!$repo->hasPackage($initial)) {
- throw new \InvalidArgumentException('Package is not installed: '.$initial);
- }
- $repo->removePackage($initial);
- if (!$repo->hasPackage($target)) {
- $repo->addPackage(clone $target);
- }
- }
- public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- if (!$repo->hasPackage($package)) {
- throw new \InvalidArgumentException('Package is not installed: '.$package);
- }
- $repo->removePackage($package);
- }
- public function getInstallPath(PackageInterface $package)
- {
- $targetDir = $package->getTargetDir();
- return $package->getPrettyName() . ($targetDir ? '/'.$targetDir : '');
- }
- }
- <?php
- namespace Composer\Installer;
- use Composer\Composer;
- use Composer\IO\IOInterface;
- use Composer\DependencyResolver\Operation\OperationInterface;
- use Composer\DependencyResolver\PolicyInterface;
- use Composer\DependencyResolver\Pool;
- use Composer\DependencyResolver\Request;
- use Composer\Repository\CompositeRepository;
- class PackageEvent extends InstallerEvent
- {
- private $operation;
- public function __construct($eventName, Composer $composer, IOInterface $io, $devMode, PolicyInterface $policy, Pool $pool, CompositeRepository $installedRepo, Request $request, array $operations, OperationInterface $operation)
- {
- parent::__construct($eventName, $composer, $io, $devMode, $policy, $pool, $installedRepo, $request, $operations);
- $this->operation = $operation;
- }
- public function getOperation()
- {
- return $this->operation;
- }
- }
- <?php
- namespace Composer\Installer;
- class PackageEvents
- {
- const PRE_PACKAGE_INSTALL = 'pre-package-install';
- const POST_PACKAGE_INSTALL = 'post-package-install';
- const PRE_PACKAGE_UPDATE = 'pre-package-update';
- const POST_PACKAGE_UPDATE = 'post-package-update';
- const PRE_PACKAGE_UNINSTALL = 'pre-package-uninstall';
- const POST_PACKAGE_UNINSTALL = 'post-package-uninstall';
- }
- <?php
- namespace Composer\Installer;
- use Composer\IO\IOInterface;
- use Composer\Composer;
- use Composer\Downloader\PearPackageExtractor;
- use Composer\Repository\InstalledRepositoryInterface;
- use Composer\Package\PackageInterface;
- use Composer\Util\Platform;
- use Composer\Util\ProcessExecutor;
- class PearInstaller extends LibraryInstaller
- {
- public function __construct(IOInterface $io, Composer $composer, $type = 'pear-library')
- {
- parent::__construct($io, $composer, $type);
- }
- public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
- {
- $this->uninstall($repo, $initial);
- $this->install($repo, $target);
- }
- protected function installCode(PackageInterface $package)
- {
- parent::installCode($package);
- parent::initializeBinDir();
- $isWindows = Platform::isWindows();
- $php_bin = $this->binDir . ($isWindows ? '/composer-php.bat' : '/composer-php');
- if (!$isWindows) {
- $php_bin = '/usr/bin/env ' . $php_bin;
- }
- $installPath = $this->getInstallPath($package);
- $vars = array(
- 'os' => $isWindows ? 'windows' : 'linux',
- 'php_bin' => $php_bin,
- 'pear_php' => $installPath,
- 'php_dir' => $installPath,
- 'bin_dir' => $installPath . '/bin',
- 'data_dir' => $installPath . '/data',
- 'version' => $package->getPrettyVersion(),
- );
- $packageArchive = $this->getInstallPath($package).'/'.pathinfo($package->getDistUrl(), PATHINFO_BASENAME);
- $pearExtractor = new PearPackageExtractor($packageArchive);
- $pearExtractor->extractTo($this->getInstallPath($package), array('php' => '/', 'script' => '/bin', 'data' => '/data'), $vars);
- $this->io->writeError(' Cleaning up', true, IOInterface::VERBOSE);
- $this->filesystem->unlink($packageArchive);
- }
- protected function getBinaries(PackageInterface $package)
- {
- $binariesPath = $this->getInstallPath($package) . '/bin/';
- $binaries = array();
- if (file_exists($binariesPath)) {
- foreach (new \FilesystemIterator($binariesPath, \FilesystemIterator::KEY_AS_FILENAME | \FilesystemIterator::CURRENT_AS_FILEINFO) as $fileName => $value) {
- if (!$value->isDir()) {
- $binaries[] = 'bin/'.$fileName;
- }
- }
- }
- return $binaries;
- }
- protected function initializeBinDir()
- {
- parent::initializeBinDir();
- file_put_contents($this->binDir.'/composer-php', $this->generateUnixyPhpProxyCode());
- @chmod($this->binDir.'/composer-php', 0777);
- file_put_contents($this->binDir.'/composer-php.bat', $this->generateWindowsPhpProxyCode());
- @chmod($this->binDir.'/composer-php.bat', 0777);
- }
- protected function generateWindowsProxyCode($bin, $link)
- {
- $binPath = $this->filesystem->findShortestPath($link, $bin);
- if ('.bat' === substr($bin, -4)) {
- $caller = 'call';
- } else {
- $handle = fopen($bin, 'r');
- $line = fgets($handle);
- fclose($handle);
- if (preg_match('{^#!/(?:usr/bin/env )?(?:[^/]+/)*(.+)$}m', $line, $match)) {
- $caller = trim($match[1]);
- } else {
- $caller = 'php';
- }
- if ($caller === 'php') {
- return "@echo off\r\n".
- "pushd .\r\n".
- "cd %~dp0\r\n".
- "set PHP_PROXY=%CD%\\composer-php.bat\r\n".
- "cd ".ProcessExecutor::escape(dirname($binPath))."\r\n".
- "set BIN_TARGET=%CD%\\".basename($binPath)."\r\n".
- "popd\r\n".
- "%PHP_PROXY% \"%BIN_TARGET%\" %*\r\n";
- }
- }
- return "@echo off\r\n".
- "pushd .\r\n".
- "cd %~dp0\r\n".
- "cd ".ProcessExecutor::escape(dirname($binPath))."\r\n".
- "set BIN_TARGET=%CD%\\".basename($binPath)."\r\n".
- "popd\r\n".
- $caller." \"%BIN_TARGET%\" %*\r\n";
- }
- private function generateWindowsPhpProxyCode()
- {
- $binToVendor = $this->filesystem->findShortestPath($this->binDir, $this->vendorDir, true);
- return
- "@echo off\r\n" .
- "setlocal enabledelayedexpansion\r\n" .
- "set BIN_DIR=%~dp0\r\n" .
- "set VENDOR_DIR=%BIN_DIR%\\".$binToVendor."\r\n" .
- "set DIRS=.\r\n" .
- "FOR /D %%V IN (%VENDOR_DIR%\\*) DO (\r\n" .
- " FOR /D %%P IN (%%V\\*) DO (\r\n" .
- " set DIRS=!DIRS!;%%~fP\r\n" .
- " )\r\n" .
- ")\r\n" .
- "php.exe -d include_path=!DIRS! %*\r\n";
- }
- private function generateUnixyPhpProxyCode()
- {
- $binToVendor = $this->filesystem->findShortestPath($this->binDir, $this->vendorDir, true);
- return
- "#!/usr/bin/env sh\n".
- "SRC_DIR=`pwd`\n".
- "BIN_DIR=`dirname $0`\n".
- "VENDOR_DIR=\$BIN_DIR/".escapeshellarg($binToVendor)."\n".
- "DIRS=\"\"\n".
- "for vendor in \$VENDOR_DIR/*; do\n".
- " if [ -d \"\$vendor\" ]; then\n".
- " for package in \$vendor/*; do\n".
- " if [ -d \"\$package\" ]; then\n".
- " DIRS=\"\${DIRS}:\${package}\"\n".
- " fi\n".
- " done\n".
- " fi\n".
- "done\n".
- "php -d include_path=\".\$DIRS\" $@\n";
- }
- }
- <?php
- namespace Composer\Installer;
- use Composer\Composer;
- use Composer\IO\IOInterface;
- use Composer\Repository\InstalledRepositoryInterface;
- use Composer\Package\PackageInterface;
- class PluginInstaller extends LibraryInstaller
- {
- private $installationManager;
- public function __construct(IOInterface $io, Composer $composer, $type = 'library')
- {
- parent::__construct($io, $composer, 'composer-plugin');
- $this->installationManager = $composer->getInstallationManager();
- }
- public function supports($packageType)
- {
- return $packageType === 'composer-plugin' || $packageType === 'composer-installer';
- }
- public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- $extra = $package->getExtra();
- if (empty($extra['class'])) {
- throw new \UnexpectedValueException('Error while installing '.$package->getPrettyName().', composer-plugin packages should have a class defined in their extra key to be usable.');
- }
- parent::install($repo, $package);
- $this->composer->getPluginManager()->registerPackage($package, true);
- }
- public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
- {
- $extra = $target->getExtra();
- if (empty($extra['class'])) {
- throw new \UnexpectedValueException('Error while installing '.$target->getPrettyName().', composer-plugin packages should have a class defined in their extra key to be usable.');
- }
- parent::update($repo, $initial, $target);
- $this->composer->getPluginManager()->registerPackage($target, true);
- }
- }
- <?php
- namespace Composer\Installer;
- use Composer\Package\PackageInterface;
- use Composer\Downloader\DownloadManager;
- use Composer\Repository\InstalledRepositoryInterface;
- use Composer\Util\Filesystem;
- class ProjectInstaller implements InstallerInterface
- {
- private $installPath;
- private $downloadManager;
- private $filesystem;
- public function __construct($installPath, DownloadManager $dm)
- {
- $this->installPath = rtrim(strtr($installPath, '\\', '/'), '/').'/';
- $this->downloadManager = $dm;
- $this->filesystem = new Filesystem;
- }
- public function supports($packageType)
- {
- return true;
- }
- public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- return false;
- }
- public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- $installPath = $this->installPath;
- if (file_exists($installPath) && !$this->filesystem->isDirEmpty($installPath)) {
- throw new \InvalidArgumentException("Project directory $installPath is not empty.");
- }
- if (!is_dir($installPath)) {
- mkdir($installPath, 0777, true);
- }
- $this->downloadManager->download($package, $installPath);
- }
- public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
- {
- throw new \InvalidArgumentException("not supported");
- }
- public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- throw new \InvalidArgumentException("not supported");
- }
- public function getInstallPath(PackageInterface $package)
- {
- return $this->installPath;
- }
- }
- <?php
- namespace Composer\Json;
- use JsonSchema\Validator;
- use Seld\JsonLint\JsonParser;
- use Seld\JsonLint\ParsingException;
- use Composer\Util\RemoteFilesystem;
- use Composer\IO\IOInterface;
- use Composer\Downloader\TransportException;
- class JsonFile
- {
- const LAX_SCHEMA = 1;
- const STRICT_SCHEMA = 2;
- const JSON_UNESCAPED_SLASHES = 64;
- const JSON_PRETTY_PRINT = 128;
- const JSON_UNESCAPED_UNICODE = 256;
- private $path;
- private $rfs;
- private $io;
- public function __construct($path, RemoteFilesystem $rfs = null, IOInterface $io = null)
- {
- $this->path = $path;
- if (null === $rfs && preg_match('{^https?://}i', $path)) {
- throw new \InvalidArgumentException('http urls require a RemoteFilesystem instance to be passed');
- }
- $this->rfs = $rfs;
- $this->io = $io;
- }
- public function getPath()
- {
- return $this->path;
- }
- public function exists()
- {
- return is_file($this->path);
- }
- public function read()
- {
- try {
- if ($this->rfs) {
- $json = $this->rfs->getContents($this->path, $this->path, false);
- } else {
- if ($this->io && $this->io->isDebug()) {
- $this->io->writeError('Reading ' . $this->path);
- }
- $json = file_get_contents($this->path);
- }
- } catch (TransportException $e) {
- throw new \RuntimeException($e->getMessage(), 0, $e);
- } catch (\Exception $e) {
- throw new \RuntimeException('Could not read '.$this->path."\n\n".$e->getMessage());
- }
- return static::parseJson($json, $this->path);
- }
- public function write(array $hash, $options = 448)
- {
- $dir = dirname($this->path);
- if (!is_dir($dir)) {
- if (file_exists($dir)) {
- throw new \UnexpectedValueException(
- $dir.' exists and is not a directory.'
- );
- }
- if (!@mkdir($dir, 0777, true)) {
- throw new \UnexpectedValueException(
- $dir.' does not exist and could not be created.'
- );
- }
- }
- $retries = 3;
- while ($retries--) {
- try {
- file_put_contents($this->path, static::encode($hash, $options). ($options & self::JSON_PRETTY_PRINT ? "\n" : ''));
- break;
- } catch (\Exception $e) {
- if ($retries) {
- usleep(500000);
- continue;
- }
- throw $e;
- }
- }
- }
- public function validateSchema($schema = self::STRICT_SCHEMA)
- {
- $content = file_get_contents($this->path);
- $data = json_decode($content);
- if (null === $data && 'null' !== $content) {
- self::validateSyntax($content, $this->path);
- }
- $schemaFile = __DIR__ . '/../../../res/composer-schema.json';
- $schemaData = json_decode(file_get_contents($schemaFile));
- if ($schema === self::LAX_SCHEMA) {
- $schemaData->additionalProperties = true;
- $schemaData->required = array();
- }
- $validator = new Validator();
- $validator->check($data, $schemaData);
- if (!$validator->isValid()) {
- $errors = array();
- foreach ((array) $validator->getErrors() as $error) {
- $errors[] = ($error['property'] ? $error['property'].' : ' : '').$error['message'];
- }
- throw new JsonValidationException('"'.$this->path.'" does not match the expected JSON schema', $errors);
- }
- return true;
- }
- public static function encode($data, $options = 448)
- {
- if (PHP_VERSION_ID >= 50400) {
- $json = json_encode($data, $options);
- if (false === $json) {
- self::throwEncodeError(json_last_error());
- }
- if (PHP_VERSION_ID < 50428 || (PHP_VERSION_ID >= 50500 && PHP_VERSION_ID < 50512) || (defined('JSON_C_VERSION') && version_compare(phpversion('json'), '1.3.6', '<'))) {
- $json = preg_replace('/\[\s+\]/', '[]', $json);
- $json = preg_replace('/\{\s+\}/', '{}', $json);
- }
- return $json;
- }
- $json = json_encode($data);
- if (false === $json) {
- self::throwEncodeError(json_last_error());
- }
- $prettyPrint = (bool) ($options & self::JSON_PRETTY_PRINT);
- $unescapeUnicode = (bool) ($options & self::JSON_UNESCAPED_UNICODE);
- $unescapeSlashes = (bool) ($options & self::JSON_UNESCAPED_SLASHES);
- if (!$prettyPrint && !$unescapeUnicode && !$unescapeSlashes) {
- return $json;
- }
- $result = JsonFormatter::format($json, $unescapeUnicode, $unescapeSlashes);
- return $result;
- }
- private static function throwEncodeError($code)
- {
- switch ($code) {
- case JSON_ERROR_DEPTH:
- $msg = 'Maximum stack depth exceeded';
- break;
- case JSON_ERROR_STATE_MISMATCH:
- $msg = 'Underflow or the modes mismatch';
- break;
- case JSON_ERROR_CTRL_CHAR:
- $msg = 'Unexpected control character found';
- break;
- case JSON_ERROR_UTF8:
- $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded';
- break;
- default:
- $msg = 'Unknown error';
- }
- throw new \RuntimeException('JSON encoding failed: '.$msg);
- }
- public static function parseJson($json, $file = null)
- {
- if (null === $json) {
- return;
- }
- $data = json_decode($json, true);
- if (null === $data && JSON_ERROR_NONE !== json_last_error()) {
- self::validateSyntax($json, $file);
- }
- return $data;
- }
- protected static function validateSyntax($json, $file = null)
- {
- $parser = new JsonParser();
- $result = $parser->lint($json);
- if (null === $result) {
- if (defined('JSON_ERROR_UTF8') && JSON_ERROR_UTF8 === json_last_error()) {
- throw new \UnexpectedValueException('"'.$file.'" is not UTF-8, could not parse as JSON');
- }
- return true;
- }
- throw new ParsingException('"'.$file.'" does not contain valid JSON'."\n".$result->getMessage(), $result->getDetails());
- }
- }
- <?php
- namespace Composer\Json;
- class JsonFormatter
- {
- public static function format($json, $unescapeUnicode, $unescapeSlashes)
- {
- $result = '';
- $pos = 0;
- $strLen = strlen($json);
- $indentStr = ' ';
- $newLine = "\n";
- $outOfQuotes = true;
- $buffer = '';
- $noescape = true;
- for ($i = 0; $i < $strLen; $i++) {
- $char = substr($json, $i, 1);
- if ('"' === $char && $noescape) {
- $outOfQuotes = !$outOfQuotes;
- }
- if (!$outOfQuotes) {
- $buffer .= $char;
- $noescape = '\\' === $char ? !$noescape : true;
- continue;
- } elseif ('' !== $buffer) {
- if ($unescapeSlashes) {
- $buffer = str_replace('\\/', '/', $buffer);
- }
- if ($unescapeUnicode && function_exists('mb_convert_encoding')) {
- $buffer = preg_replace_callback('/(\\\\+)u([0-9a-f]{4})/i', function ($match) {
- $l = strlen($match[1]);
- if ($l % 2) {
- return str_repeat('\\', $l - 1) . mb_convert_encoding(
- pack('H*', $match[2]),
- 'UTF-8',
- 'UCS-2BE'
- );
- }
- return $match[0];
- }, $buffer);
- }
- $result .= $buffer.$char;
- $buffer = '';
- continue;
- }
- if (':' === $char) {
- $char .= ' ';
- } elseif (('}' === $char || ']' === $char)) {
- $pos--;
- $prevChar = substr($json, $i - 1, 1);
- if ('{' !== $prevChar && '[' !== $prevChar) {
-
- $result .= $newLine;
- for ($j = 0; $j < $pos; $j++) {
- $result .= $indentStr;
- }
- } else {
- $result = rtrim($result);
- }
- }
- $result .= $char;
-
- if (',' === $char || '{' === $char || '[' === $char) {
- $result .= $newLine;
- if ('{' === $char || '[' === $char) {
- $pos++;
- }
- for ($j = 0; $j < $pos; $j++) {
- $result .= $indentStr;
- }
- }
- }
- return $result;
- }
- }
- <?php
- namespace Composer\Json;
- use Composer\Repository\PlatformRepository;
- class JsonManipulator
- {
- private static $RECURSE_BLOCKS;
- private static $RECURSE_ARRAYS;
- private static $JSON_VALUE;
- private static $JSON_STRING;
- private $contents;
- private $newline;
- private $indent;
- public function __construct($contents)
- {
- if (!self::$RECURSE_BLOCKS) {
- self::$RECURSE_BLOCKS = '(?:[^{}]*|\{(?:[^{}]*|\{(?:[^{}]*|\{(?:[^{}]*|\{[^{}]*\})*\})*\})*\})*';
- self::$RECURSE_ARRAYS = '(?:[^\]]*|\[(?:[^\]]*|\[(?:[^\]]*|\[(?:[^\]]*|\[[^\]]*\])*\])*\])*\]|'.self::$RECURSE_BLOCKS.')*';
- self::$JSON_STRING = '"(?:[^\0-\x09\x0a-\x1f\\\\"]+|\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4})*"';
- self::$JSON_VALUE = '(?:[0-9.]+|null|true|false|'.self::$JSON_STRING.'|\['.self::$RECURSE_ARRAYS.'\]|\{'.self::$RECURSE_BLOCKS.'\})';
- }
- $contents = trim($contents);
- if ($contents === '') {
- $contents = '{}';
- }
- if (!$this->pregMatch('#^\{(.*)\}$#s', $contents)) {
- throw new \InvalidArgumentException('The json file must be an object ({})');
- }
- $this->newline = false !== strpos($contents, "\r\n") ? "\r\n" : "\n";
- $this->contents = $contents === '{}' ? '{' . $this->newline . '}' : $contents;
- $this->detectIndenting();
- }
- public function getContents()
- {
- return $this->contents . $this->newline;
- }
- public function addLink($type, $package, $constraint, $sortPackages = false)
- {
- $decoded = JsonFile::parseJson($this->contents);
- if (!isset($decoded[$type])) {
- return $this->addMainKey($type, array($package => $constraint));
- }
- $regex = '{^(\s*\{\s*(?:'.self::$JSON_STRING.'\s*:\s*'.self::$JSON_VALUE.'\s*,\s*)*?)'.
- '('.preg_quote(JsonFile::encode($type)).'\s*:\s*)('.self::$JSON_VALUE.')(.*)}s';
- if (!$this->pregMatch($regex, $this->contents, $matches)) {
- return false;
- }
- $links = $matches[3];
- if (isset($decoded[$type][$package])) {
- $packageRegex = str_replace('/', '\\\\?/', preg_quote($package));
- $links = preg_replace('{"'.$packageRegex.'"(\s*:\s*)'.self::$JSON_STRING.'}i', addcslashes(JsonFile::encode($package).'${1}"'.$constraint.'"', '\\'), $links);
- } else {
- if ($this->pregMatch('#^\s*\{\s*\S+.*?(\s*\}\s*)$#s', $links, $match)) {
- $links = preg_replace(
- '{'.preg_quote($match[1]).'$}',
- addcslashes(',' . $this->newline . $this->indent . $this->indent . JsonFile::encode($package).': '.JsonFile::encode($constraint) . $match[1], '\\'),
- $links
- );
- } else {
- $links = '{' . $this->newline .
- $this->indent . $this->indent . JsonFile::encode($package).': '.JsonFile::encode($constraint) . $this->newline .
- $this->indent . '}';
- }
- }
- if (true === $sortPackages) {
- $requirements = json_decode($links, true);
- $this->sortPackages($requirements);
- $links = $this->format($requirements);
- }
- $this->contents = $matches[1] . $matches[2] . $links . $matches[4];
- return true;
- }
- private function sortPackages(array &$packages = array())
- {
- $prefix = function ($requirement) {
- if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $requirement)) {
- return preg_replace(
- array(
- '/^php/',
- '/^hhvm/',
- '/^ext/',
- '/^lib/',
- '/^\D/',
- ),
- array(
- '0-$0',
- '1-$0',
- '2-$0',
- '3-$0',
- '4-$0',
- ),
- $requirement
- );
- }
- return '5-'.$requirement;
- };
- uksort($packages, function ($a, $b) use ($prefix) {
- return strnatcmp($prefix($a), $prefix($b));
- });
- }
- public function addRepository($name, $config)
- {
- return $this->addSubNode('repositories', $name, $config);
- }
- public function removeRepository($name)
- {
- return $this->removeSubNode('repositories', $name);
- }
- public function addConfigSetting($name, $value)
- {
- return $this->addSubNode('config', $name, $value);
- }
- public function removeConfigSetting($name)
- {
- return $this->removeSubNode('config', $name);
- }
- public function addSubNode($mainNode, $name, $value)
- {
- $decoded = JsonFile::parseJson($this->contents);
- $subName = null;
- if (in_array($mainNode, array('config', 'repositories')) && false !== strpos($name, '.')) {
- list($name, $subName) = explode('.', $name, 2);
- }
- if (!isset($decoded[$mainNode])) {
- if ($subName !== null) {
- $this->addMainKey($mainNode, array($name => array($subName => $value)));
- } else {
- $this->addMainKey($mainNode, array($name => $value));
- }
- return true;
- }
- $nodeRegex = '{^(\s*\{\s*(?:'.self::$JSON_STRING.'\s*:\s*'.self::$JSON_VALUE.'\s*,\s*)*?)'.
- '('.preg_quote(JsonFile::encode($mainNode)).'\s*:\s*\{)('.self::$RECURSE_BLOCKS.')(\})(.*)}s';
- try {
- if (!$this->pregMatch($nodeRegex, $this->contents, $match)) {
- return false;
- }
- } catch (\RuntimeException $e) {
- if ($e->getCode() === PREG_BACKTRACK_LIMIT_ERROR) {
- return false;
- }
- throw $e;
- }
- $children = $match[3];
- if (!@json_decode('{'.$children.'}')) {
- return false;
- }
- $that = $this;
- if ($this->pregMatch('{("'.preg_quote($name).'"\s*:\s*)('.self::$JSON_VALUE.')(,?)}', $children, $matches)) {
- $children = preg_replace_callback('{("'.preg_quote($name).'"\s*:\s*)('.self::$JSON_VALUE.')(,?)}', function ($matches) use ($name, $subName, $value, $that) {
- if ($subName !== null) {
- $curVal = json_decode($matches[2], true);
- $curVal[$subName] = $value;
- $value = $curVal;
- }
- return $matches[1] . $that->format($value, 1) . $matches[3];
- }, $children);
- } elseif ($this->pregMatch('#[^\s](\s*)$#', $children, $match)) {
- if ($subName !== null) {
- $value = array($subName => $value);
- }
- $children = preg_replace(
- '#'.$match[1].'$#',
- addcslashes(',' . $this->newline . $this->indent . $this->indent . JsonFile::encode($name).': '.$this->format($value, 1) . $match[1], '\\'),
- $children
- );
- } else {
- if ($subName !== null) {
- $value = array($subName => $value);
- }
- $children = $this->newline . $this->indent . $this->indent . JsonFile::encode($name).': '.$this->format($value, 1) . $children;
- }
- $this->contents = preg_replace($nodeRegex, addcslashes('${1}${2}'.$children.'${4}${5}', '\\'), $this->contents);
- return true;
- }
- public function removeSubNode($mainNode, $name)
- {
- $decoded = JsonFile::parseJson($this->contents);
- if (empty($decoded[$mainNode])) {
- return true;
- }
- $nodeRegex = '{^(\s*\{\s*(?:'.self::$JSON_STRING.'\s*:\s*'.self::$JSON_VALUE.'\s*,\s*)*?)'.
- '('.preg_quote(JsonFile::encode($mainNode)).'\s*:\s*\{)('.self::$RECURSE_BLOCKS.')(\})(.*)}s';
- try {
- if (!$this->pregMatch($nodeRegex, $this->contents, $match)) {
- return false;
- }
- } catch (\RuntimeException $e) {
- if ($e->getCode() === PREG_BACKTRACK_LIMIT_ERROR) {
- return false;
- }
- throw $e;
- }
- $children = $match[3];
- if (!@json_decode('{'.$children.'}', true)) {
- return false;
- }
- $subName = null;
- if (in_array($mainNode, array('config', 'repositories')) && false !== strpos($name, '.')) {
- list($name, $subName) = explode('.', $name, 2);
- }
- if (!isset($decoded[$mainNode][$name]) || ($subName && !isset($decoded[$mainNode][$name][$subName]))) {
- return true;
- }
- if ($this->pregMatch('{"'.preg_quote($name).'"\s*:}i', $children)) {
- if (preg_match_all('{"'.preg_quote($name).'"\s*:\s*(?:'.self::$JSON_VALUE.')}', $children, $matches)) {
- $bestMatch = '';
- foreach ($matches[0] as $match) {
- if (strlen($bestMatch) < strlen($match)) {
- $bestMatch = $match;
- }
- }
- $childrenClean = preg_replace('{,\s*'.preg_quote($bestMatch).'}i', '', $children, -1, $count);
- if (1 !== $count) {
- $childrenClean = preg_replace('{'.preg_quote($bestMatch).'\s*,?\s*}i', '', $childrenClean, -1, $count);
- if (1 !== $count) {
- return false;
- }
- }
- }
- } else {
- $childrenClean = $children;
- }
- if (!trim($childrenClean)) {
- $this->contents = preg_replace($nodeRegex, '$1$2'.$this->newline.$this->indent.'$4$5', $this->contents);
- if ($subName !== null) {
- $curVal = json_decode('{'.$children.'}', true);
- unset($curVal[$name][$subName]);
- $this->addSubNode($mainNode, $name, $curVal[$name]);
- }
- return true;
- }
- $that = $this;
- $this->contents = preg_replace_callback($nodeRegex, function ($matches) use ($that, $name, $subName, $childrenClean) {
- if ($subName !== null) {
- $curVal = json_decode('{'.$matches[3].'}', true);
- unset($curVal[$name][$subName]);
- $childrenClean = substr($that->format($curVal, 0), 1, -1);
- }
- return $matches[1] . $matches[2] . $childrenClean . $matches[4] . $matches[5];
- }, $this->contents);
- return true;
- }
- public function addMainKey($key, $content)
- {
- $decoded = JsonFile::parseJson($this->contents);
- $content = $this->format($content);
- $regex = '{^(\s*\{\s*(?:'.self::$JSON_STRING.'\s*:\s*'.self::$JSON_VALUE.'\s*,\s*)*?)'.
- '('.preg_quote(JsonFile::encode($key)).'\s*:\s*'.self::$JSON_VALUE.')(.*)}s';
- if (isset($decoded[$key]) && $this->pregMatch($regex, $this->contents, $matches)) {
- if (!@json_decode('{'.$matches[2].'}')) {
- return false;
- }
- $this->contents = $matches[1] . JsonFile::encode($key).': '.$content . $matches[3];
- return true;
- }
- if ($this->pregMatch('#[^{\s](\s*)\}$#', $this->contents, $match)) {
- $this->contents = preg_replace(
- '#'.$match[1].'\}$#',
- addcslashes(',' . $this->newline . $this->indent . JsonFile::encode($key). ': '. $content . $this->newline . '}', '\\'),
- $this->contents
- );
- return true;
- }
- $this->contents = preg_replace(
- '#\}$#',
- addcslashes($this->indent . JsonFile::encode($key). ': '.$content . $this->newline . '}', '\\'),
- $this->contents
- );
- return true;
- }
- public function format($data, $depth = 0)
- {
- if (is_array($data)) {
- reset($data);
- if (is_numeric(key($data))) {
- foreach ($data as $key => $val) {
- $data[$key] = $this->format($val, $depth + 1);
- }
- return '['.implode(', ', $data).']';
- }
- $out = '{' . $this->newline;
- $elems = array();
- foreach ($data as $key => $val) {
- $elems[] = str_repeat($this->indent, $depth + 2) . JsonFile::encode($key). ': '.$this->format($val, $depth + 1);
- }
- return $out . implode(','.$this->newline, $elems) . $this->newline . str_repeat($this->indent, $depth + 1) . '}';
- }
- return JsonFile::encode($data);
- }
- protected function detectIndenting()
- {
- if ($this->pregMatch('{^([ \t]+)"}m', $this->contents, $match)) {
- $this->indent = $match[1];
- } else {
- $this->indent = ' ';
- }
- }
- protected function pregMatch($re, $str, &$matches = array())
- {
- $count = preg_match($re, $str, $matches);
- if ($count === false) {
- switch (preg_last_error()) {
- case PREG_NO_ERROR:
- throw new \RuntimeException('Failed to execute regex: PREG_NO_ERROR', PREG_NO_ERROR);
- case PREG_INTERNAL_ERROR:
- throw new \RuntimeException('Failed to execute regex: PREG_INTERNAL_ERROR', PREG_INTERNAL_ERROR);
- case PREG_BACKTRACK_LIMIT_ERROR:
- throw new \RuntimeException('Failed to execute regex: PREG_BACKTRACK_LIMIT_ERROR', PREG_BACKTRACK_LIMIT_ERROR);
- case PREG_RECURSION_LIMIT_ERROR:
- throw new \RuntimeException('Failed to execute regex: PREG_RECURSION_LIMIT_ERROR', PREG_RECURSION_LIMIT_ERROR);
- case PREG_BAD_UTF8_ERROR:
- throw new \RuntimeException('Failed to execute regex: PREG_BAD_UTF8_ERROR', PREG_BAD_UTF8_ERROR);
- case PREG_BAD_UTF8_OFFSET_ERROR:
- throw new \RuntimeException('Failed to execute regex: PREG_BAD_UTF8_OFFSET_ERROR', PREG_BAD_UTF8_OFFSET_ERROR);
- default:
- throw new \RuntimeException('Failed to execute regex: Unknown error');
- }
- }
- return $count;
- }
- }
- <?php
- namespace Composer\Json;
- use Exception;
- class JsonValidationException extends Exception
- {
- protected $errors;
- public function __construct($message, $errors = array(), Exception $previous = null)
- {
- $this->errors = $errors;
- parent::__construct($message, 0, $previous);
- }
- public function getErrors()
- {
- return $this->errors;
- }
- }
- <?php
- namespace Composer\Package;
- use Composer\Semver\Constraint\Constraint;
- use Composer\Package\Version\VersionParser;
- class AliasPackage extends BasePackage implements CompletePackageInterface
- {
- protected $version;
- protected $prettyVersion;
- protected $dev;
- protected $aliasOf;
- protected $rootPackageAlias = false;
- protected $stability;
- protected $requires;
- protected $devRequires;
- protected $conflicts;
- protected $provides;
- protected $replaces;
- public function __construct(PackageInterface $aliasOf, $version, $prettyVersion)
- {
- parent::__construct($aliasOf->getName());
- $this->version = $version;
- $this->prettyVersion = $prettyVersion;
- $this->aliasOf = $aliasOf;
- $this->stability = VersionParser::parseStability($version);
- $this->dev = $this->stability === 'dev';
- foreach (array('requires', 'devRequires', 'conflicts', 'provides', 'replaces') as $type) {
- $links = $aliasOf->{'get' . ucfirst($type)}();
- $this->$type = $this->replaceSelfVersionDependencies($links, $type);
- }
- }
- public function getAliasOf()
- {
- return $this->aliasOf;
- }
- public function getVersion()
- {
- return $this->version;
- }
- public function getStability()
- {
- return $this->stability;
- }
- public function getPrettyVersion()
- {
- return $this->prettyVersion;
- }
- public function isDev()
- {
- return $this->dev;
- }
- public function getRequires()
- {
- return $this->requires;
- }
- public function getConflicts()
- {
- return $this->conflicts;
- }
- public function getProvides()
- {
- return $this->provides;
- }
- public function getReplaces()
- {
- return $this->replaces;
- }
- public function getDevRequires()
- {
- return $this->devRequires;
- }
- public function setRootPackageAlias($value)
- {
- return $this->rootPackageAlias = $value;
- }
- public function isRootPackageAlias()
- {
- return $this->rootPackageAlias;
- }
- protected function replaceSelfVersionDependencies(array $links, $linkType)
- {
- if (in_array($linkType, array('conflicts', 'provides', 'replaces'), true)) {
- $newLinks = array();
- foreach ($links as $link) {
- if ('self.version' === $link->getPrettyConstraint()) {
- $newLinks[] = new Link($link->getSource(), $link->getTarget(), new Constraint('=', $this->version), $linkType, $this->prettyVersion);
- }
- }
- $links = array_merge($links, $newLinks);
- } else {
- foreach ($links as $index => $link) {
- if ('self.version' === $link->getPrettyConstraint()) {
- $links[$index] = new Link($link->getSource(), $link->getTarget(), new Constraint('=', $this->version), $linkType, $this->prettyVersion);
- }
- }
- }
- return $links;
- }
- public function getType()
- {
- return $this->aliasOf->getType();
- }
- public function getTargetDir()
- {
- return $this->aliasOf->getTargetDir();
- }
- public function getExtra()
- {
- return $this->aliasOf->getExtra();
- }
- public function setInstallationSource($type)
- {
- $this->aliasOf->setInstallationSource($type);
- }
- public function getInstallationSource()
- {
- return $this->aliasOf->getInstallationSource();
- }
- public function getSourceType()
- {
- return $this->aliasOf->getSourceType();
- }
- public function getSourceUrl()
- {
- return $this->aliasOf->getSourceUrl();
- }
- public function getSourceUrls()
- {
- return $this->aliasOf->getSourceUrls();
- }
- public function getSourceReference()
- {
- return $this->aliasOf->getSourceReference();
- }
- public function setSourceReference($reference)
- {
- return $this->aliasOf->setSourceReference($reference);
- }
- public function setSourceMirrors($mirrors)
- {
- return $this->aliasOf->setSourceMirrors($mirrors);
- }
- public function getSourceMirrors()
- {
- return $this->aliasOf->getSourceMirrors();
- }
- public function getDistType()
- {
- return $this->aliasOf->getDistType();
- }
- public function getDistUrl()
- {
- return $this->aliasOf->getDistUrl();
- }
- public function getDistUrls()
- {
- return $this->aliasOf->getDistUrls();
- }
- public function getDistReference()
- {
- return $this->aliasOf->getDistReference();
- }
- public function setDistReference($reference)
- {
- return $this->aliasOf->setDistReference($reference);
- }
- public function getDistSha1Checksum()
- {
- return $this->aliasOf->getDistSha1Checksum();
- }
- public function setTransportOptions(array $options)
- {
- return $this->aliasOf->setTransportOptions($options);
- }
- public function getTransportOptions()
- {
- return $this->aliasOf->getTransportOptions();
- }
- public function setDistMirrors($mirrors)
- {
- return $this->aliasOf->setDistMirrors($mirrors);
- }
- public function getDistMirrors()
- {
- return $this->aliasOf->getDistMirrors();
- }
- public function getScripts()
- {
- return $this->aliasOf->getScripts();
- }
- public function getLicense()
- {
- return $this->aliasOf->getLicense();
- }
- public function getAutoload()
- {
- return $this->aliasOf->getAutoload();
- }
- public function getDevAutoload()
- {
- return $this->aliasOf->getDevAutoload();
- }
- public function getIncludePaths()
- {
- return $this->aliasOf->getIncludePaths();
- }
- public function getRepositories()
- {
- return $this->aliasOf->getRepositories();
- }
- public function getReleaseDate()
- {
- return $this->aliasOf->getReleaseDate();
- }
- public function getBinaries()
- {
- return $this->aliasOf->getBinaries();
- }
- public function getKeywords()
- {
- return $this->aliasOf->getKeywords();
- }
- public function getDescription()
- {
- return $this->aliasOf->getDescription();
- }
- public function getHomepage()
- {
- return $this->aliasOf->getHomepage();
- }
- public function getSuggests()
- {
- return $this->aliasOf->getSuggests();
- }
- public function getAuthors()
- {
- return $this->aliasOf->getAuthors();
- }
- public function getSupport()
- {
- return $this->aliasOf->getSupport();
- }
- public function getNotificationUrl()
- {
- return $this->aliasOf->getNotificationUrl();
- }
- public function getArchiveExcludes()
- {
- return $this->aliasOf->getArchiveExcludes();
- }
- public function isAbandoned()
- {
- return $this->aliasOf->isAbandoned();
- }
- public function getReplacementPackage()
- {
- return $this->aliasOf->getReplacementPackage();
- }
- public function __toString()
- {
- return parent::__toString().' (alias of '.$this->aliasOf->getVersion().')';
- }
- }
- <?php
- namespace Composer\Package\Archiver;
- use Composer\Util\Filesystem;
- use Symfony\Component\Finder\Finder;
- class ArchivableFilesFinder extends \FilterIterator
- {
- protected $finder;
- public function __construct($sources, array $excludes)
- {
- $fs = new Filesystem();
- $sources = $fs->normalizePath($sources);
- $filters = array(
- new HgExcludeFilter($sources),
- new GitExcludeFilter($sources),
- new ComposerExcludeFilter($sources, $excludes),
- );
- $this->finder = new Finder();
- $filter = function (\SplFileInfo $file) use ($sources, $filters, $fs) {
- if ($file->isLink() && strpos($file->getLinkTarget(), $sources) !== 0) {
- return false;
- }
- $relativePath = preg_replace(
- '#^'.preg_quote($sources, '#').'#',
- '',
- $fs->normalizePath($file->getRealPath())
- );
- $exclude = false;
- foreach ($filters as $filter) {
- $exclude = $filter->filter($relativePath, $exclude);
- }
- return !$exclude;
- };
- if (method_exists($filter, 'bindTo')) {
- $filter = $filter->bindTo(null);
- }
- $this->finder
- ->in($sources)
- ->filter($filter)
- ->ignoreVCS(true)
- ->ignoreDotFiles(false);
- parent::__construct($this->finder->getIterator());
- }
- public function accept()
- {
- return !$this->getInnerIterator()->current()->isDir();
- }
- }
- <?php
- namespace Composer\Package\Archiver;
- use Composer\Downloader\DownloadManager;
- use Composer\Package\PackageInterface;
- use Composer\Package\RootPackageInterface;
- use Composer\Util\Filesystem;
- use Composer\Json\JsonFile;
- class ArchiveManager
- {
- protected $downloadManager;
- protected $archivers = array();
- protected $overwriteFiles = true;
- public function __construct(DownloadManager $downloadManager)
- {
- $this->downloadManager = $downloadManager;
- }
- public function addArchiver(ArchiverInterface $archiver)
- {
- $this->archivers[] = $archiver;
- }
- public function setOverwriteFiles($overwriteFiles)
- {
- $this->overwriteFiles = $overwriteFiles;
- return $this;
- }
- public function getPackageFilename(PackageInterface $package)
- {
- $nameParts = array(preg_replace('#[^a-z0-9-_]#i', '-', $package->getName()));
- if (preg_match('{^[a-f0-9]{40}$}', $package->getDistReference())) {
- $nameParts = array_merge($nameParts, array($package->getDistReference(), $package->getDistType()));
- } else {
- $nameParts = array_merge($nameParts, array($package->getPrettyVersion(), $package->getDistReference()));
- }
- if ($package->getSourceReference()) {
- $nameParts[] = substr(sha1($package->getSourceReference()), 0, 6);
- }
- $name = implode('-', array_filter($nameParts, function ($p) {
- return !empty($p);
- }));
- return str_replace('/', '-', $name);
- }
- public function archive(PackageInterface $package, $format, $targetDir, $fileName = null)
- {
- if (empty($format)) {
- throw new \InvalidArgumentException('Format must be specified');
- }
- $usableArchiver = null;
- foreach ($this->archivers as $archiver) {
- if ($archiver->supports($format, $package->getSourceType())) {
- $usableArchiver = $archiver;
- break;
- }
- }
- if (null === $usableArchiver) {
- throw new \RuntimeException(sprintf('No archiver found to support %s format', $format));
- }
- $filesystem = new Filesystem();
- if (null === $fileName) {
- $packageName = $this->getPackageFilename($package);
- } else {
- $packageName = $fileName;
- }
- $filesystem->ensureDirectoryExists($targetDir);
- $target = realpath($targetDir).'/'.$packageName.'.'.$format;
- $filesystem->ensureDirectoryExists(dirname($target));
- if (!$this->overwriteFiles && file_exists($target)) {
- return $target;
- }
- if ($package instanceof RootPackageInterface) {
- $sourcePath = realpath('.');
- } else {
- $sourcePath = sys_get_temp_dir().'/composer_archive'.uniqid();
- $filesystem->ensureDirectoryExists($sourcePath);
- $this->downloadManager->download($package, $sourcePath);
- if (file_exists($composerJsonPath = $sourcePath.'/composer.json')) {
- $jsonFile = new JsonFile($composerJsonPath);
- $jsonData = $jsonFile->read();
- if (!empty($jsonData['archive']['exclude'])) {
- $package->setArchiveExcludes($jsonData['archive']['exclude']);
- }
- }
- }
- $tempTarget = sys_get_temp_dir().'/composer_archive'.uniqid().'.'.$format;
- $filesystem->ensureDirectoryExists(dirname($tempTarget));
- $archivePath = $usableArchiver->archive($sourcePath, $tempTarget, $format, $package->getArchiveExcludes());
- rename($archivePath, $target);
- if (!$package instanceof RootPackageInterface) {
- $filesystem->removeDirectory($sourcePath);
- }
- $filesystem->remove($tempTarget);
- return $target;
- }
- }
- <?php
- namespace Composer\Package\Archiver;
- interface ArchiverInterface
- {
- public function archive($sources, $target, $format, array $excludes = array());
- public function supports($format, $sourceType);
- }
- <?php
- namespace Composer\Package\Archiver;
- use Symfony\Component\Finder;
- abstract class BaseExcludeFilter
- {
- protected $sourcePath;
- protected $excludePatterns;
- public function __construct($sourcePath)
- {
- $this->sourcePath = $sourcePath;
- $this->excludePatterns = array();
- }
- public function filter($relativePath, $exclude)
- {
- foreach ($this->excludePatterns as $patternData) {
- list($pattern, $negate, $stripLeadingSlash) = $patternData;
- if ($stripLeadingSlash) {
- $path = substr($relativePath, 1);
- } else {
- $path = $relativePath;
- }
- if (preg_match($pattern, $path)) {
- $exclude = !$negate;
- }
- }
- return $exclude;
- }
- protected function parseLines(array $lines, $lineParser)
- {
- return array_filter(
- array_map(
- function ($line) use ($lineParser) {
- $line = trim($line);
- if (!$line || 0 === strpos($line, '#')) {
- return;
- }
- return call_user_func($lineParser, $line);
- },
- $lines
- ),
- function ($pattern) {
- return $pattern !== null;
- }
- );
- }
- protected function generatePatterns($rules)
- {
- $patterns = array();
- foreach ($rules as $rule) {
- $patterns[] = $this->generatePattern($rule);
- }
- return $patterns;
- }
- protected function generatePattern($rule)
- {
- $negate = false;
- $pattern = '{';
- if (strlen($rule) && $rule[0] === '!') {
- $negate = true;
- $rule = substr($rule, 1);
- }
- if (strlen($rule) && $rule[0] === '/') {
- $pattern .= '^/';
- $rule = substr($rule, 1);
- } elseif (strlen($rule) - 1 === strpos($rule, '/')) {
- $pattern .= '/';
- $rule = substr($rule, 0, -1);
- } elseif (false === strpos($rule, '/')) {
- $pattern .= '/';
- }
- $pattern .= substr(Finder\Glob::toRegex($rule), 2, -2) . '(?=$|/)';
- return array($pattern . '}', $negate, false);
- }
- }
- <?php
- namespace Composer\Package\Archiver;
- class ComposerExcludeFilter extends BaseExcludeFilter
- {
- public function __construct($sourcePath, array $excludeRules)
- {
- parent::__construct($sourcePath);
- $this->excludePatterns = $this->generatePatterns($excludeRules);
- }
- }
- <?php
- namespace Composer\Package\Archiver;
- class GitExcludeFilter extends BaseExcludeFilter
- {
- public function __construct($sourcePath)
- {
- parent::__construct($sourcePath);
- if (file_exists($sourcePath.'/.gitignore')) {
- $this->excludePatterns = $this->parseLines(
- file($sourcePath.'/.gitignore'),
- array($this, 'parseGitIgnoreLine')
- );
- }
- if (file_exists($sourcePath.'/.gitattributes')) {
- $this->excludePatterns = array_merge(
- $this->excludePatterns,
- $this->parseLines(
- file($sourcePath.'/.gitattributes'),
- array($this, 'parseGitAttributesLine')
- ));
- }
- }
- public function parseGitIgnoreLine($line)
- {
- return $this->generatePattern($line);
- }
- public function parseGitAttributesLine($line)
- {
- $parts = preg_split('#\s+#', $line);
- if (count($parts) != 2) {
- return null;
- }
- if ($parts[1] === 'export-ignore') {
- return $this->generatePattern($parts[0]);
- }
- }
- }
- <?php
- namespace Composer\Package\Archiver;
- use Symfony\Component\Finder;
- class HgExcludeFilter extends BaseExcludeFilter
- {
- const HG_IGNORE_REGEX = 1;
- const HG_IGNORE_GLOB = 2;
- protected $patternMode;
- public function __construct($sourcePath)
- {
- parent::__construct($sourcePath);
- $this->patternMode = self::HG_IGNORE_REGEX;
- if (file_exists($sourcePath.'/.hgignore')) {
- $this->excludePatterns = $this->parseLines(
- file($sourcePath.'/.hgignore'),
- array($this, 'parseHgIgnoreLine')
- );
- }
- }
- public function parseHgIgnoreLine($line)
- {
- if (preg_match('#^syntax\s*:\s*(glob|regexp)$#', $line, $matches)) {
- if ($matches[1] === 'glob') {
- $this->patternMode = self::HG_IGNORE_GLOB;
- } else {
- $this->patternMode = self::HG_IGNORE_REGEX;
- }
- return null;
- }
- if ($this->patternMode == self::HG_IGNORE_GLOB) {
- return $this->patternFromGlob($line);
- } else {
- return $this->patternFromRegex($line);
- }
- }
- protected function patternFromGlob($line)
- {
- $pattern = '#'.substr(Finder\Glob::toRegex($line), 2, -1).'#';
- $pattern = str_replace('[^/]*', '.*', $pattern);
- return array($pattern, false, true);
- }
- public function patternFromRegex($line)
- {
- $pattern = '#'.preg_replace('/((?:\\\\\\\\)*)(\\\\?)#/', '\1\2\2\\#', $line).'#';
- return array($pattern, false, true);
- }
- }
- <?php
- namespace Composer\Package\Archiver;
- class PharArchiver implements ArchiverInterface
- {
- protected static $formats = array(
- 'zip' => \Phar::ZIP,
- 'tar' => \Phar::TAR,
- 'tar.gz' => \Phar::TAR,
- 'tar.bz2' => \Phar::TAR
- );
- protected static $compressFormats = array(
- 'tar.gz' => \Phar::GZ,
- 'tar.bz2' => \Phar::BZ2
- );
- public function archive($sources, $target, $format, array $excludes = array())
- {
- $sources = realpath($sources);
- if (file_exists($target)) {
- unlink($target);
- }
- try {
- $filename = substr($target, 0, strrpos($target, $format) - 1);
- if (isset(static::$compressFormats[$format])) {
- $target = $filename . '.tar';
- }
- $phar = new \PharData($target, null, null, static::$formats[$format]);
- $files = new ArchivableFilesFinder($sources, $excludes);
- $phar->buildFromIterator($files, $sources);
- if (isset(static::$compressFormats[$format])) {
- if (!$phar->canCompress(static::$compressFormats[$format])) {
- throw new \RuntimeException(sprintf('Can not compress to %s format', $format));
- }
- unlink($target);
- $phar->compress(static::$compressFormats[$format]);
- $target = $filename . '.' . $format;
- }
- return $target;
- } catch (\UnexpectedValueException $e) {
- $message = sprintf("Could not create archive '%s' from '%s': %s",
- $target,
- $sources,
- $e->getMessage()
- );
- throw new \RuntimeException($message, $e->getCode(), $e);
- }
- }
- public function supports($format, $sourceType)
- {
- return isset(static::$formats[$format]);
- }
- }
- <?php
- namespace Composer\Package\Archiver;
- use ZipArchive;
- class ZipArchiver implements ArchiverInterface
- {
- protected static $formats = array(
- 'zip' => 1
- );
- public function archive($sources, $target, $format, array $excludes = array())
- {
- $sources = realpath($sources);
- $zip = new ZipArchive();
- $res = $zip->open($target, ZipArchive::CREATE);
- if ($res === true) {
- $files = new ArchivableFilesFinder($sources, $excludes);
- foreach($files as $file) {
- $filepath = $file->getPath()."/".$file->getFilename();
- $localname = str_replace($sources."/", '', $filepath);
- $zip->addFile($filepath, $localname);
- }
- if ($zip->close()) {
- return $target;
- }
- }
- $message = sprintf("Could not create archive '%s' from '%s': %s",
- $target,
- $sources,
- $zip->getStatusString()
- );
- throw new \RuntimeException($message);
- }
- public function supports($format, $sourceType)
- {
- return isset(static::$formats[$format]) && $this->compressionAvailable();
- }
- private function compressionAvailable() {
- return class_exists('ZipArchive');
- }
- }
- <?php
- namespace Composer\Package;
- use Composer\Repository\RepositoryInterface;
- use Composer\Repository\PlatformRepository;
- abstract class BasePackage implements PackageInterface
- {
- public static $supportedLinkTypes = array(
- 'require' => array('description' => 'requires', 'method' => 'requires'),
- 'conflict' => array('description' => 'conflicts', 'method' => 'conflicts'),
- 'provide' => array('description' => 'provides', 'method' => 'provides'),
- 'replace' => array('description' => 'replaces', 'method' => 'replaces'),
- 'require-dev' => array('description' => 'requires (for development)', 'method' => 'devRequires'),
- );
- const STABILITY_STABLE = 0;
- const STABILITY_RC = 5;
- const STABILITY_BETA = 10;
- const STABILITY_ALPHA = 15;
- const STABILITY_DEV = 20;
- public static $stabilities = array(
- 'stable' => self::STABILITY_STABLE,
- 'RC' => self::STABILITY_RC,
- 'beta' => self::STABILITY_BETA,
- 'alpha' => self::STABILITY_ALPHA,
- 'dev' => self::STABILITY_DEV,
- );
- public $id;
- protected $name;
- protected $prettyName;
- protected $repository;
- protected $transportOptions;
- public function __construct($name)
- {
- $this->prettyName = $name;
- $this->name = strtolower($name);
- $this->id = -1;
- $this->transportOptions = array();
- }
- public function getName()
- {
- return $this->name;
- }
- public function getPrettyName()
- {
- return $this->prettyName;
- }
- public function getNames()
- {
- $names = array(
- $this->getName() => true,
- );
- foreach ($this->getProvides() as $link) {
- $names[$link->getTarget()] = true;
- }
- foreach ($this->getReplaces() as $link) {
- $names[$link->getTarget()] = true;
- }
- return array_keys($names);
- }
- public function setId($id)
- {
- $this->id = $id;
- }
- public function getId()
- {
- return $this->id;
- }
- public function setRepository(RepositoryInterface $repository)
- {
- if ($this->repository && $repository !== $this->repository) {
- throw new \LogicException('A package can only be added to one repository');
- }
- $this->repository = $repository;
- }
- public function getRepository()
- {
- return $this->repository;
- }
- public function getTransportOptions()
- {
- return $this->transportOptions;
- }
- public function setTransportOptions(array $options)
- {
- $this->transportOptions = $options;
- }
- public function isPlatform()
- {
- return $this->getRepository() instanceof PlatformRepository;
- }
- public function getUniqueName()
- {
- return $this->getName().'-'.$this->getVersion();
- }
- public function equals(PackageInterface $package)
- {
- $self = $this;
- if ($this instanceof AliasPackage) {
- $self = $this->getAliasOf();
- }
- if ($package instanceof AliasPackage) {
- $package = $package->getAliasOf();
- }
- return $package === $self;
- }
- public function __toString()
- {
- return $this->getUniqueName();
- }
- public function getPrettyString()
- {
- return $this->getPrettyName().' '.$this->getPrettyVersion();
- }
- public function getFullPrettyVersion($truncate = true)
- {
- if (!$this->isDev() || !in_array($this->getSourceType(), array('hg', 'git'))) {
- return $this->getPrettyVersion();
- }
- if ($truncate && strlen($this->getSourceReference()) === 40) {
- return $this->getPrettyVersion() . ' ' . substr($this->getSourceReference(), 0, 7);
- }
- return $this->getPrettyVersion() . ' ' . $this->getSourceReference();
- }
- public function getStabilityPriority()
- {
- return self::$stabilities[$this->getStability()];
- }
- public function __clone()
- {
- $this->repository = null;
- $this->id = -1;
- }
- }
- <?php
- namespace Composer\Package;
- class CompletePackage extends Package implements CompletePackageInterface
- {
- protected $repositories;
- protected $license = array();
- protected $keywords;
- protected $authors;
- protected $description;
- protected $homepage;
- protected $scripts = array();
- protected $support = array();
- protected $abandoned = false;
- public function setScripts(array $scripts)
- {
- $this->scripts = $scripts;
- }
- public function getScripts()
- {
- return $this->scripts;
- }
- public function setRepositories($repositories)
- {
- $this->repositories = $repositories;
- }
- public function getRepositories()
- {
- return $this->repositories;
- }
- public function setLicense(array $license)
- {
- $this->license = $license;
- }
- public function getLicense()
- {
- return $this->license;
- }
- public function setKeywords(array $keywords)
- {
- $this->keywords = $keywords;
- }
- public function getKeywords()
- {
- return $this->keywords;
- }
- public function setAuthors(array $authors)
- {
- $this->authors = $authors;
- }
- public function getAuthors()
- {
- return $this->authors;
- }
- public function setDescription($description)
- {
- $this->description = $description;
- }
- public function getDescription()
- {
- return $this->description;
- }
- public function setHomepage($homepage)
- {
- $this->homepage = $homepage;
- }
- public function getHomepage()
- {
- return $this->homepage;
- }
- public function setSupport(array $support)
- {
- $this->support = $support;
- }
- public function getSupport()
- {
- return $this->support;
- }
- public function isAbandoned()
- {
- return (boolean) $this->abandoned;
- }
- public function setAbandoned($abandoned)
- {
- $this->abandoned = $abandoned;
- }
- public function getReplacementPackage()
- {
- return is_string($this->abandoned) ? $this->abandoned : null;
- }
- }
- <?php
- namespace Composer\Package;
- interface CompletePackageInterface extends PackageInterface
- {
- public function getScripts();
- public function getRepositories();
- public function getLicense();
- public function getKeywords();
- public function getDescription();
- public function getHomepage();
- public function getAuthors();
- public function getSupport();
- public function isAbandoned();
- public function getReplacementPackage();
- }
- <?php
- namespace Composer\Package\Dumper;
- use Composer\Package\BasePackage;
- use Composer\Package\PackageInterface;
- use Composer\Package\CompletePackageInterface;
- use Composer\Package\RootPackageInterface;
- class ArrayDumper
- {
- public function dump(PackageInterface $package)
- {
- $keys = array(
- 'binaries' => 'bin',
- 'type',
- 'extra',
- 'installationSource' => 'installation-source',
- 'autoload',
- 'devAutoload' => 'autoload-dev',
- 'notificationUrl' => 'notification-url',
- 'includePaths' => 'include-path',
- );
- $data = array();
- $data['name'] = $package->getPrettyName();
- $data['version'] = $package->getPrettyVersion();
- $data['version_normalized'] = $package->getVersion();
- if ($package->getTargetDir()) {
- $data['target-dir'] = $package->getTargetDir();
- }
- if ($package->getSourceType()) {
- $data['source']['type'] = $package->getSourceType();
- $data['source']['url'] = $package->getSourceUrl();
- $data['source']['reference'] = $package->getSourceReference();
- if ($mirrors = $package->getSourceMirrors()) {
- $data['source']['mirrors'] = $mirrors;
- }
- }
- if ($package->getDistType()) {
- $data['dist']['type'] = $package->getDistType();
- $data['dist']['url'] = $package->getDistUrl();
- $data['dist']['reference'] = $package->getDistReference();
- $data['dist']['shasum'] = $package->getDistSha1Checksum();
- if ($mirrors = $package->getDistMirrors()) {
- $data['dist']['mirrors'] = $mirrors;
- }
- }
- if ($package->getArchiveExcludes()) {
- $data['archive']['exclude'] = $package->getArchiveExcludes();
- }
- foreach (BasePackage::$supportedLinkTypes as $type => $opts) {
- if ($links = $package->{'get'.ucfirst($opts['method'])}()) {
- foreach ($links as $link) {
- $data[$type][$link->getTarget()] = $link->getPrettyConstraint();
- }
- ksort($data[$type]);
- }
- }
- if ($packages = $package->getSuggests()) {
- ksort($packages);
- $data['suggest'] = $packages;
- }
- if ($package->getReleaseDate()) {
- $data['time'] = $package->getReleaseDate()->format('Y-m-d H:i:s');
- }
- $data = $this->dumpValues($package, $keys, $data);
- if ($package instanceof CompletePackageInterface) {
- $keys = array(
- 'scripts',
- 'license',
- 'authors',
- 'description',
- 'homepage',
- 'keywords',
- 'repositories',
- 'support',
- );
- $data = $this->dumpValues($package, $keys, $data);
- if (isset($data['keywords']) && is_array($data['keywords'])) {
- sort($data['keywords']);
- }
- if ($package->isAbandoned()) {
- $data['abandoned'] = $package->getReplacementPackage() ?: true;
- }
- }
- if ($package instanceof RootPackageInterface) {
- $minimumStability = $package->getMinimumStability();
- if ($minimumStability) {
- $data['minimum-stability'] = $minimumStability;
- }
- }
- if (count($package->getTransportOptions()) > 0) {
- $data['transport-options'] = $package->getTransportOptions();
- }
- return $data;
- }
- private function dumpValues(PackageInterface $package, array $keys, array $data)
- {
- foreach ($keys as $method => $key) {
- if (is_numeric($method)) {
- $method = $key;
- }
- $getter = 'get'.ucfirst($method);
- $value = $package->$getter();
- if (null !== $value && !(is_array($value) && 0 === count($value))) {
- $data[$key] = $value;
- }
- }
- return $data;
- }
- }
- <?php
- namespace Composer\Package;
- use Composer\Semver\Constraint\ConstraintInterface;
- class Link
- {
- protected $source;
- protected $target;
- protected $constraint;
- protected $description;
- protected $prettyConstraint;
- public function __construct($source, $target, ConstraintInterface $constraint = null, $description = 'relates to', $prettyConstraint = null)
- {
- $this->source = strtolower($source);
- $this->target = strtolower($target);
- $this->constraint = $constraint;
- $this->description = $description;
- $this->prettyConstraint = $prettyConstraint;
- }
- public function getDescription()
- {
- return $this->description;
- }
- public function getSource()
- {
- return $this->source;
- }
- public function getTarget()
- {
- return $this->target;
- }
- public function getConstraint()
- {
- return $this->constraint;
- }
- public function getPrettyConstraint()
- {
- if (null === $this->prettyConstraint) {
- throw new \UnexpectedValueException(sprintf('Link %s has been misconfigured and had no prettyConstraint given.', $this));
- }
- return $this->prettyConstraint;
- }
- public function __toString()
- {
- return $this->source.' '.$this->description.' '.$this->target.' ('.$this->constraint.')';
- }
- public function getPrettyString(PackageInterface $sourcePackage)
- {
- return $sourcePackage->getPrettyString().' '.$this->description.' '.$this->target.' '.$this->constraint->getPrettyString().'';
- }
- }
- <?php
- namespace Composer\Package\LinkConstraint;
- use Composer\Semver\Constraint\EmptyConstraint as SemverEmptyConstraint;
- trigger_error('The ' . __NAMESPACE__ . '\EmptyConstraint class is deprecated, use Composer\Semver\Constraint\EmptyConstraint instead.', E_USER_DEPRECATED);
- class EmptyConstraint extends SemverEmptyConstraint implements LinkConstraintInterface
- {
- }
- <?php
- namespace Composer\Package\LinkConstraint;
- use Composer\Semver\Constraint\ConstraintInterface;
- trigger_error('The ' . __NAMESPACE__ . '\LinkConstraintInterface interface is deprecated, use Composer\Semver\Constraint\ConstraintInterface instead.', E_USER_DEPRECATED);
- interface LinkConstraintInterface extends ConstraintInterface
- {
- }
- <?php
- namespace Composer\Package\LinkConstraint;
- use Composer\Semver\Constraint\MultiConstraint as SemverMultiConstraint;
- trigger_error('The ' . __NAMESPACE__ . '\MultiConstraint class is deprecated, use Composer\Semver\Constraint\MultiConstraint instead.', E_USER_DEPRECATED);
- class MultiConstraint extends SemverMultiConstraint implements LinkConstraintInterface
- {
- }
- <?php
- namespace Composer\Package\LinkConstraint;
- use Composer\Semver\Constraint\AbstractConstraint;
- trigger_error('The ' . __NAMESPACE__ . '\SpecificConstraint abstract class is deprecated, there is no replacement for it.', E_USER_DEPRECATED);
- abstract class SpecificConstraint extends AbstractConstraint implements LinkConstraintInterface
- {
- }
- <?php
- namespace Composer\Package\LinkConstraint;
- use Composer\Semver\Constraint\Constraint;
- trigger_error('The ' . __NAMESPACE__ . '\VersionConstraint class is deprecated, use Composer\Semver\Constraint\Constraint instead.', E_USER_DEPRECATED);
- class VersionConstraint extends Constraint implements LinkConstraintInterface
- {
- }
- <?php
- namespace Composer\Package\Loader;
- use Composer\Package;
- use Composer\Package\AliasPackage;
- use Composer\Package\Link;
- use Composer\Package\RootAliasPackage;
- use Composer\Package\RootPackageInterface;
- use Composer\Package\Version\VersionParser;
- use Composer\Semver\VersionParser as SemverVersionParser;
- class ArrayLoader implements LoaderInterface
- {
- protected $versionParser;
- protected $loadOptions;
- public function __construct(SemverVersionParser $parser = null, $loadOptions = false)
- {
- if (!$parser) {
- $parser = new VersionParser;
- }
- $this->versionParser = $parser;
- $this->loadOptions = $loadOptions;
- }
- public function load(array $config, $class = 'Composer\Package\CompletePackage')
- {
- if (!isset($config['name'])) {
- throw new \UnexpectedValueException('Unknown package has no name defined ('.json_encode($config).').');
- }
- if (!isset($config['version'])) {
- throw new \UnexpectedValueException('Package '.$config['name'].' has no version defined.');
- }
- if (isset($config['version_normalized'])) {
- $version = $config['version_normalized'];
- } else {
- $version = $this->versionParser->normalize($config['version']);
- }
- $package = new $class($config['name'], $version, $config['version']);
- $package->setType(isset($config['type']) ? strtolower($config['type']) : 'library');
- if (isset($config['target-dir'])) {
- $package->setTargetDir($config['target-dir']);
- }
- if (isset($config['extra']) && is_array($config['extra'])) {
- $package->setExtra($config['extra']);
- }
- if (isset($config['bin'])) {
- if (!is_array($config['bin'])) {
- throw new \UnexpectedValueException('Package '.$config['name'].'\'s bin key should be an array, '.gettype($config['bin']).' given.');
- }
- foreach ($config['bin'] as $key => $bin) {
- $config['bin'][$key] = ltrim($bin, '/');
- }
- $package->setBinaries($config['bin']);
- }
- if (isset($config['installation-source'])) {
- $package->setInstallationSource($config['installation-source']);
- }
- if (isset($config['source'])) {
- if (!isset($config['source']['type']) || !isset($config['source']['url']) || !isset($config['source']['reference'])) {
- throw new \UnexpectedValueException(sprintf(
- "Package %s's source key should be specified as {\"type\": ..., \"url\": ..., \"reference\": ...},\n%s given.",
- $config['name'],
- json_encode($config['source'])
- ));
- }
- $package->setSourceType($config['source']['type']);
- $package->setSourceUrl($config['source']['url']);
- $package->setSourceReference($config['source']['reference']);
- if (isset($config['source']['mirrors'])) {
- $package->setSourceMirrors($config['source']['mirrors']);
- }
- }
- if (isset($config['dist'])) {
- if (!isset($config['dist']['type'])
- || !isset($config['dist']['url'])) {
- throw new \UnexpectedValueException(sprintf(
- "Package %s's dist key should be specified as ".
- "{\"type\": ..., \"url\": ..., \"reference\": ..., \"shasum\": ...},\n%s given.",
- $config['name'],
- json_encode($config['dist'])
- ));
- }
- $package->setDistType($config['dist']['type']);
- $package->setDistUrl($config['dist']['url']);
- $package->setDistReference(isset($config['dist']['reference']) ? $config['dist']['reference'] : null);
- $package->setDistSha1Checksum(isset($config['dist']['shasum']) ? $config['dist']['shasum'] : null);
- if (isset($config['dist']['mirrors'])) {
- $package->setDistMirrors($config['dist']['mirrors']);
- }
- }
- foreach (Package\BasePackage::$supportedLinkTypes as $type => $opts) {
- if (isset($config[$type])) {
- $method = 'set'.ucfirst($opts['method']);
- $package->{$method}(
- $this->parseLinks(
- $package->getName(),
- $package->getPrettyVersion(),
- $opts['description'],
- $config[$type]
- )
- );
- }
- }
- if (isset($config['suggest']) && is_array($config['suggest'])) {
- foreach ($config['suggest'] as $target => $reason) {
- if ('self.version' === trim($reason)) {
- $config['suggest'][$target] = $package->getPrettyVersion();
- }
- }
- $package->setSuggests($config['suggest']);
- }
- if (isset($config['autoload'])) {
- $package->setAutoload($config['autoload']);
- }
- if (isset($config['autoload-dev'])) {
- $package->setDevAutoload($config['autoload-dev']);
- }
- if (isset($config['include-path'])) {
- $package->setIncludePaths($config['include-path']);
- }
- if (!empty($config['time'])) {
- $time = preg_match('/^\d++$/D', $config['time']) ? '@'.$config['time'] : $config['time'];
- try {
- $date = new \DateTime($time, new \DateTimeZone('UTC'));
- $package->setReleaseDate($date);
- } catch (\Exception $e) {
- }
- }
- if (!empty($config['notification-url'])) {
- $package->setNotificationUrl($config['notification-url']);
- }
- if (!empty($config['archive']['exclude'])) {
- $package->setArchiveExcludes($config['archive']['exclude']);
- }
- if ($package instanceof Package\CompletePackageInterface) {
- if (isset($config['scripts']) && is_array($config['scripts'])) {
- foreach ($config['scripts'] as $event => $listeners) {
- $config['scripts'][$event] = (array) $listeners;
- }
- $package->setScripts($config['scripts']);
- }
- if (!empty($config['description']) && is_string($config['description'])) {
- $package->setDescription($config['description']);
- }
- if (!empty($config['homepage']) && is_string($config['homepage'])) {
- $package->setHomepage($config['homepage']);
- }
- if (!empty($config['keywords']) && is_array($config['keywords'])) {
- $package->setKeywords($config['keywords']);
- }
- if (!empty($config['license'])) {
- $package->setLicense(is_array($config['license']) ? $config['license'] : array($config['license']));
- }
- if (!empty($config['authors']) && is_array($config['authors'])) {
- $package->setAuthors($config['authors']);
- }
- if (isset($config['support'])) {
- $package->setSupport($config['support']);
- }
- if (isset($config['abandoned'])) {
- $package->setAbandoned($config['abandoned']);
- }
- }
- if ($aliasNormalized = $this->getBranchAlias($config)) {
- if ($package instanceof RootPackageInterface) {
- $package = new RootAliasPackage($package, $aliasNormalized, preg_replace('{(\.9{7})+}', '.x', $aliasNormalized));
- } else {
- $package = new AliasPackage($package, $aliasNormalized, preg_replace('{(\.9{7})+}', '.x', $aliasNormalized));
- }
- }
- if ($this->loadOptions && isset($config['transport-options'])) {
- $package->setTransportOptions($config['transport-options']);
- }
- return $package;
- }
- public function parseLinks($source, $sourceVersion, $description, $links)
- {
- $res = array();
- foreach ($links as $target => $constraint) {
- if ('self.version' === $constraint) {
- $parsedConstraint = $this->versionParser->parseConstraints($sourceVersion);
- } else {
- $parsedConstraint = $this->versionParser->parseConstraints($constraint);
- }
- $res[strtolower($target)] = new Link($source, $target, $parsedConstraint, $description, $constraint);
- }
- return $res;
- }
- public function getBranchAlias(array $config)
- {
- if (('dev-' !== substr($config['version'], 0, 4) && '-dev' !== substr($config['version'], -4))
- || !isset($config['extra']['branch-alias'])
- || !is_array($config['extra']['branch-alias'])
- ) {
- return;
- }
- foreach ($config['extra']['branch-alias'] as $sourceBranch => $targetBranch) {
- if ('-dev' !== substr($targetBranch, -4)) {
- continue;
- }
- $validatedTargetBranch = $this->versionParser->normalizeBranch(substr($targetBranch, 0, -4));
- if ('-dev' !== substr($validatedTargetBranch, -4)) {
- continue;
- }
- if (strtolower($config['version']) !== strtolower($sourceBranch)) {
- continue;
- }
- if (($sourcePrefix = $this->versionParser->parseNumericAliasPrefix($sourceBranch))
- && ($targetPrefix = $this->versionParser->parseNumericAliasPrefix($targetBranch))
- && (stripos($targetPrefix, $sourcePrefix) !== 0)
- ) {
- continue;
- }
- return $validatedTargetBranch;
- }
- }
- }
- <?php
- namespace Composer\Package\Loader;
- class InvalidPackageException extends \Exception
- {
- private $errors;
- private $warnings;
- private $data;
- public function __construct(array $errors, array $warnings, array $data)
- {
- $this->errors = $errors;
- $this->warnings = $warnings;
- $this->data = $data;
- parent::__construct("Invalid package information: \n".implode("\n", array_merge($errors, $warnings)));
- }
- public function getData()
- {
- return $this->data;
- }
- public function getErrors()
- {
- return $this->errors;
- }
- public function getWarnings()
- {
- return $this->warnings;
- }
- }
- <?php
- namespace Composer\Package\Loader;
- use Composer\Json\JsonFile;
- class JsonLoader
- {
- private $loader;
- public function __construct(LoaderInterface $loader)
- {
- $this->loader = $loader;
- }
- public function load($json)
- {
- if ($json instanceof JsonFile) {
- $config = $json->read();
- } elseif (file_exists($json)) {
- $config = JsonFile::parseJson(file_get_contents($json), $json);
- } elseif (is_string($json)) {
- $config = JsonFile::parseJson($json);
- }
- return $this->loader->load($config);
- }
- }
- <?php
- namespace Composer\Package\Loader;
- interface LoaderInterface
- {
- public function load(array $package, $class = 'Composer\Package\CompletePackage');
- }
- <?php
- namespace Composer\Package\Loader;
- use Composer\Package\BasePackage;
- use Composer\Package\PackageInterface;
- use Composer\Package\AliasPackage;
- use Composer\Config;
- use Composer\Factory;
- use Composer\Package\Version\VersionGuesser;
- use Composer\Package\Version\VersionParser;
- use Composer\Repository\RepositoryManager;
- use Composer\Util\ProcessExecutor;
- class RootPackageLoader extends ArrayLoader
- {
- private $manager;
- private $config;
- private $versionGuesser;
- public function __construct(RepositoryManager $manager, Config $config, VersionParser $parser = null, VersionGuesser $versionGuesser = null)
- {
- parent::__construct($parser);
- $this->manager = $manager;
- $this->config = $config;
- $this->versionGuesser = $versionGuesser ?: new VersionGuesser($config, new ProcessExecutor(), $this->versionParser);
- }
- public function load(array $config, $class = 'Composer\Package\RootPackage', $cwd = null)
- {
- if (!isset($config['name'])) {
- $config['name'] = '__root__';
- }
- $autoVersioned = false;
- if (!isset($config['version'])) {
- if (getenv('COMPOSER_ROOT_VERSION')) {
- $version = getenv('COMPOSER_ROOT_VERSION');
- } else {
- $version = $this->versionGuesser->guessVersion($config, $cwd ?: getcwd());
- }
- if (!$version) {
- $version = '1.0.0';
- $autoVersioned = true;
- }
- $config['version'] = $version;
- }
- $realPackage = $package = parent::load($config, $class);
- if ($realPackage instanceof AliasPackage) {
- $realPackage = $package->getAliasOf();
- }
- if ($autoVersioned) {
- $realPackage->replaceVersion($realPackage->getVersion(), 'No version set (parsed as 1.0.0)');
- }
- if (isset($config['minimum-stability'])) {
- $realPackage->setMinimumStability(VersionParser::normalizeStability($config['minimum-stability']));
- }
- $aliases = array();
- $stabilityFlags = array();
- $references = array();
- foreach (array('require', 'require-dev') as $linkType) {
- if (isset($config[$linkType])) {
- $linkInfo = BasePackage::$supportedLinkTypes[$linkType];
- $method = 'get'.ucfirst($linkInfo['method']);
- $links = array();
- foreach ($realPackage->$method() as $link) {
- $links[$link->getTarget()] = $link->getConstraint()->getPrettyString();
- }
- $aliases = $this->extractAliases($links, $aliases);
- $stabilityFlags = $this->extractStabilityFlags($links, $stabilityFlags, $realPackage->getMinimumStability());
- $references = $this->extractReferences($links, $references);
- }
- }
- if (isset($links[$config['name']])) {
- throw new \InvalidArgumentException(sprintf('Root package \'%s\' cannot require itself in its composer.json' . PHP_EOL .
- 'Did you accidentally name your root package after an external package?', $config['name']));
- }
- $realPackage->setAliases($aliases);
- $realPackage->setStabilityFlags($stabilityFlags);
- $realPackage->setReferences($references);
- if (isset($config['prefer-stable'])) {
- $realPackage->setPreferStable((bool) $config['prefer-stable']);
- }
- $repos = Factory::createDefaultRepositories(null, $this->config, $this->manager);
- foreach ($repos as $repo) {
- $this->manager->addRepository($repo);
- }
- $realPackage->setRepositories($this->config->getRepositories());
- return $package;
- }
- private function extractAliases(array $requires, array $aliases)
- {
- foreach ($requires as $reqName => $reqVersion) {
- if (preg_match('{^([^,\s#]+)(?:#[^ ]+)? +as +([^,\s]+)$}', $reqVersion, $match)) {
- $aliases[] = array(
- 'package' => strtolower($reqName),
- 'version' => $this->versionParser->normalize($match[1], $reqVersion),
- 'alias' => $match[2],
- 'alias_normalized' => $this->versionParser->normalize($match[2], $reqVersion),
- );
- }
- }
- return $aliases;
- }
- private function extractStabilityFlags(array $requires, array $stabilityFlags, $minimumStability)
- {
- $stabilities = BasePackage::$stabilities;
- $minimumStability = $stabilities[$minimumStability];
- foreach ($requires as $reqName => $reqVersion) {
- $constraints = array();
- $orSplit = preg_split('{\s*\|\|?\s*}', trim($reqVersion));
- foreach ($orSplit as $constraint) {
- $andSplit = preg_split('{(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)}', $constraint);
- foreach ($andSplit as $constraint) {
- $constraints[] = $constraint;
- }
- }
- $match = false;
- foreach ($constraints as $constraint) {
- if (preg_match('{^[^@]*?@('.implode('|', array_keys($stabilities)).')$}i', $constraint, $match)) {
- $name = strtolower($reqName);
- $stability = $stabilities[VersionParser::normalizeStability($match[1])];
- if (isset($stabilityFlags[$name]) && $stabilityFlags[$name] > $stability) {
- continue;
- }
- $stabilityFlags[$name] = $stability;
- $match = true;
- }
- }
- if ($match) {
- continue;
- }
-
- $reqVersion = preg_replace('{^([^,\s@]+) as .+$}', '$1', $reqVersion);
- if (preg_match('{^[^,\s@]+$}', $reqVersion) && 'stable' !== ($stabilityName = VersionParser::parseStability($reqVersion))) {
- $name = strtolower($reqName);
- $stability = $stabilities[$stabilityName];
- if ((isset($stabilityFlags[$name]) && $stabilityFlags[$name] > $stability) || ($minimumStability > $stability)) {
- continue;
- }
- $stabilityFlags[$name] = $stability;
- }
- }
- return $stabilityFlags;
- }
- private function extractReferences(array $requires, array $references)
- {
- foreach ($requires as $reqName => $reqVersion) {
- $reqVersion = preg_replace('{^([^,\s@]+) as .+$}', '$1', $reqVersion);
- if (preg_match('{^[^,\s@]+?#([a-f0-9]+)$}', $reqVersion, $match) && 'dev' === ($stabilityName = VersionParser::parseStability($reqVersion))) {
- $name = strtolower($reqName);
- $references[$name] = $match[1];
- }
- }
- return $references;
- }
- }
- <?php
- namespace Composer\Package\Loader;
- use Composer\Package;
- use Composer\Package\BasePackage;
- use Composer\Semver\Constraint\Constraint;
- use Composer\Package\Version\VersionParser;
- use Composer\Repository\PlatformRepository;
- class ValidatingArrayLoader implements LoaderInterface
- {
- const CHECK_ALL = 1;
- const CHECK_UNBOUND_CONSTRAINTS = 1;
- private $loader;
- private $versionParser;
- private $errors;
- private $warnings;
- private $config;
- private $strictName;
- private $flags;
- public function __construct(LoaderInterface $loader, $strictName = true, VersionParser $parser = null, $flags = 0)
- {
- $this->loader = $loader;
- $this->versionParser = $parser ?: new VersionParser();
- $this->strictName = $strictName;
- $this->flags = $flags;
- }
- public function load(array $config, $class = 'Composer\Package\CompletePackage')
- {
- $this->errors = array();
- $this->warnings = array();
- $this->config = $config;
- if ($this->strictName) {
- $this->validateRegex('name', '[A-Za-z0-9][A-Za-z0-9_.-]*/[A-Za-z0-9][A-Za-z0-9_.-]*', true);
- } else {
- $this->validateString('name', true);
- }
- if (!empty($this->config['version'])) {
- try {
- $this->versionParser->normalize($this->config['version']);
- } catch (\Exception $e) {
- $this->errors[] = 'version : invalid value ('.$this->config['version'].'): '.$e->getMessage();
- unset($this->config['version']);
- }
- }
- $this->validateRegex('type', '[A-Za-z0-9-]+');
- $this->validateString('target-dir');
- $this->validateArray('extra');
- $this->validateFlatArray('bin');
- $this->validateArray('scripts');
- $this->validateString('description');
- $this->validateUrl('homepage');
- $this->validateFlatArray('keywords', '[\p{N}\p{L} ._-]+');
- if (isset($this->config['license'])) {
- if (is_string($this->config['license'])) {
- $this->validateRegex('license', '[A-Za-z0-9+. ()-]+');
- } else {
- $this->validateFlatArray('license', '[A-Za-z0-9+. ()-]+');
- }
- }
- $this->validateString('time');
- if (!empty($this->config['time'])) {
- try {
- $date = new \DateTime($this->config['time'], new \DateTimeZone('UTC'));
- } catch (\Exception $e) {
- $this->errors[] = 'time : invalid value ('.$this->config['time'].'): '.$e->getMessage();
- unset($this->config['time']);
- }
- }
- if ($this->validateArray('authors') && !empty($this->config['authors'])) {
- foreach ($this->config['authors'] as $key => $author) {
- if (!is_array($author)) {
- $this->errors[] = 'authors.'.$key.' : should be an array, '.gettype($author).' given';
- unset($this->config['authors'][$key]);
- continue;
- }
- foreach (array('homepage', 'email', 'name', 'role') as $authorData) {
- if (isset($author[$authorData]) && !is_string($author[$authorData])) {
- $this->errors[] = 'authors.'.$key.'.'.$authorData.' : invalid value, must be a string';
- unset($this->config['authors'][$key][$authorData]);
- }
- }
- if (isset($author['homepage']) && !$this->filterUrl($author['homepage'])) {
- $this->warnings[] = 'authors.'.$key.'.homepage : invalid value ('.$author['homepage'].'), must be an http/https URL';
- unset($this->config['authors'][$key]['homepage']);
- }
- if (isset($author['email']) && !filter_var($author['email'], FILTER_VALIDATE_EMAIL)) {
- $this->warnings[] = 'authors.'.$key.'.email : invalid value ('.$author['email'].'), must be a valid email address';
- unset($this->config['authors'][$key]['email']);
- }
- if (empty($this->config['authors'][$key])) {
- unset($this->config['authors'][$key]);
- }
- }
- if (empty($this->config['authors'])) {
- unset($this->config['authors']);
- }
- }
- if ($this->validateArray('support') && !empty($this->config['support'])) {
- foreach (array('issues', 'forum', 'wiki', 'source', 'email', 'irc', 'docs') as $key) {
- if (isset($this->config['support'][$key]) && !is_string($this->config['support'][$key])) {
- $this->errors[] = 'support.'.$key.' : invalid value, must be a string';
- unset($this->config['support'][$key]);
- }
- }
- if (isset($this->config['support']['email']) && !filter_var($this->config['support']['email'], FILTER_VALIDATE_EMAIL)) {
- $this->warnings[] = 'support.email : invalid value ('.$this->config['support']['email'].'), must be a valid email address';
- unset($this->config['support']['email']);
- }
- if (isset($this->config['support']['irc']) && !$this->filterUrl($this->config['support']['irc'], array('irc'))) {
- $this->warnings[] = 'support.irc : invalid value ('.$this->config['support']['irc'].'), must be a irc://<server>/<channel> URL';
- unset($this->config['support']['irc']);
- }
- foreach (array('issues', 'forum', 'wiki', 'source', 'docs') as $key) {
- if (isset($this->config['support'][$key]) && !$this->filterUrl($this->config['support'][$key])) {
- $this->warnings[] = 'support.'.$key.' : invalid value ('.$this->config['support'][$key].'), must be an http/https URL';
- unset($this->config['support'][$key]);
- }
- }
- if (empty($this->config['support'])) {
- unset($this->config['support']);
- }
- }
- $unboundConstraint = new Constraint('=', $this->versionParser->normalize('dev-master'));
- foreach (array_keys(BasePackage::$supportedLinkTypes) as $linkType) {
- if ($this->validateArray($linkType) && isset($this->config[$linkType])) {
- foreach ($this->config[$linkType] as $package => $constraint) {
- if (!preg_match('{^[A-Za-z0-9_./-]+$}', $package)) {
- $this->warnings[] = $linkType.'.'.$package.' : invalid key, package names must be strings containing only [A-Za-z0-9_./-]';
- }
- if (!is_string($constraint)) {
- $this->errors[] = $linkType.'.'.$package.' : invalid value, must be a string containing a version constraint';
- unset($this->config[$linkType][$package]);
- } elseif ('self.version' !== $constraint) {
- try {
- $linkConstraint = $this->versionParser->parseConstraints($constraint);
- } catch (\Exception $e) {
- $this->errors[] = $linkType.'.'.$package.' : invalid version constraint ('.$e->getMessage().')';
- unset($this->config[$linkType][$package]);
- continue;
- }
- if (
- ($this->flags & self::CHECK_UNBOUND_CONSTRAINTS)
- && 'require' === $linkType
- && $linkConstraint->matches($unboundConstraint)
- && !preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $package)
- ) {
- $this->warnings[] = $linkType.'.'.$package.' : unbound version constraints ('.$constraint.') should be avoided';
- }
- }
- }
- }
- }
- if ($this->validateArray('suggest') && !empty($this->config['suggest'])) {
- foreach ($this->config['suggest'] as $package => $description) {
- if (!is_string($description)) {
- $this->errors[] = 'suggest.'.$package.' : invalid value, must be a string describing why the package is suggested';
- unset($this->config['suggest'][$package]);
- }
- }
- }
- if ($this->validateString('minimum-stability') && !empty($this->config['minimum-stability'])) {
- if (!isset(BasePackage::$stabilities[$this->config['minimum-stability']])) {
- $this->errors[] = 'minimum-stability : invalid value ('.$this->config['minimum-stability'].'), must be one of '.implode(', ', array_keys(BasePackage::$stabilities));
- unset($this->config['minimum-stability']);
- }
- }
- if ($this->validateArray('autoload') && !empty($this->config['autoload'])) {
- $types = array('psr-0', 'psr-4', 'classmap', 'files', 'exclude-from-classmap');
- foreach ($this->config['autoload'] as $type => $typeConfig) {
- if (!in_array($type, $types)) {
- $this->errors[] = 'autoload : invalid value ('.$type.'), must be one of '.implode(', ', $types);
- unset($this->config['autoload'][$type]);
- }
- if ($type === 'psr-4') {
- foreach ($typeConfig as $namespace => $dirs) {
- if ($namespace !== '' && '\\' !== substr($namespace, -1)) {
- $this->errors[] = 'autoload.psr-4 : invalid value ('.$namespace.'), namespaces must end with a namespace separator, should be '.$namespace.'\\\\';
- }
- }
- }
- }
- }
- if (!empty($this->config['autoload']['psr-4']) && !empty($this->config['target-dir'])) {
- $this->errors[] = 'target-dir : this can not be used together with the autoload.psr-4 setting, remove target-dir to upgrade to psr-4';
-
- unset($this->config['autoload']['psr-4']);
- }
-
-
- $this->validateFlatArray('include-path');
- $this->validateArray('transport-options');
- if (isset($this->config['extra']['branch-alias'])) {
- if (!is_array($this->config['extra']['branch-alias'])) {
- $this->errors[] = 'extra.branch-alias : must be an array of versions => aliases';
- } else {
- foreach ($this->config['extra']['branch-alias'] as $sourceBranch => $targetBranch) {
- if ('-dev' !== substr($targetBranch, -4)) {
- $this->warnings[] = 'extra.branch-alias.'.$sourceBranch.' : the target branch ('.$targetBranch.') must end in -dev';
- unset($this->config['extra']['branch-alias'][$sourceBranch]);
- continue;
- }
- $validatedTargetBranch = $this->versionParser->normalizeBranch(substr($targetBranch, 0, -4));
- if ('-dev' !== substr($validatedTargetBranch, -4)) {
- $this->warnings[] = 'extra.branch-alias.'.$sourceBranch.' : the target branch ('.$targetBranch.') must be a parseable number like 2.0-dev';
- unset($this->config['extra']['branch-alias'][$sourceBranch]);
- continue;
- }
- if (($sourcePrefix = $this->versionParser->parseNumericAliasPrefix($sourceBranch))
- && ($targetPrefix = $this->versionParser->parseNumericAliasPrefix($targetBranch))
- && (stripos($targetPrefix, $sourcePrefix) !== 0)
- ) {
- $this->warnings[] = 'extra.branch-alias.'.$sourceBranch.' : the target branch ('.$targetBranch.') is not a valid numeric alias for this version';
- unset($this->config['extra']['branch-alias'][$sourceBranch]);
- }
- }
- }
- }
- if ($this->errors) {
- throw new InvalidPackageException($this->errors, $this->warnings, $config);
- }
- $package = $this->loader->load($this->config, $class);
- $this->config = null;
- return $package;
- }
- public function getWarnings()
- {
- return $this->warnings;
- }
- public function getErrors()
- {
- return $this->errors;
- }
- private function validateRegex($property, $regex, $mandatory = false)
- {
- if (!$this->validateString($property, $mandatory)) {
- return false;
- }
- if (!preg_match('{^'.$regex.'$}u', $this->config[$property])) {
- $message = $property.' : invalid value ('.$this->config[$property].'), must match '.$regex;
- if ($mandatory) {
- $this->errors[] = $message;
- } else {
- $this->warnings[] = $message;
- }
- unset($this->config[$property]);
- return false;
- }
- return true;
- }
- private function validateString($property, $mandatory = false)
- {
- if (isset($this->config[$property]) && !is_string($this->config[$property])) {
- $this->errors[] = $property.' : should be a string, '.gettype($this->config[$property]).' given';
- unset($this->config[$property]);
- return false;
- }
- if (!isset($this->config[$property]) || trim($this->config[$property]) === '') {
- if ($mandatory) {
- $this->errors[] = $property.' : must be present';
- }
- unset($this->config[$property]);
- return false;
- }
- return true;
- }
- private function validateArray($property, $mandatory = false)
- {
- if (isset($this->config[$property]) && !is_array($this->config[$property])) {
- $this->errors[] = $property.' : should be an array, '.gettype($this->config[$property]).' given';
- unset($this->config[$property]);
- return false;
- }
- if (!isset($this->config[$property]) || !count($this->config[$property])) {
- if ($mandatory) {
- $this->errors[] = $property.' : must be present and contain at least one element';
- }
- unset($this->config[$property]);
- return false;
- }
- return true;
- }
- private function validateFlatArray($property, $regex = null, $mandatory = false)
- {
- if (!$this->validateArray($property, $mandatory)) {
- return false;
- }
- $pass = true;
- foreach ($this->config[$property] as $key => $value) {
- if (!is_string($value) && !is_numeric($value)) {
- $this->errors[] = $property.'.'.$key.' : must be a string or int, '.gettype($value).' given';
- unset($this->config[$property][$key]);
- $pass = false;
- continue;
- }
- if ($regex && !preg_match('{^'.$regex.'$}u', $value)) {
- $this->warnings[] = $property.'.'.$key.' : invalid value ('.$value.'), must match '.$regex;
- unset($this->config[$property][$key]);
- $pass = false;
- }
- }
- return $pass;
- }
- private function validateUrl($property, $mandatory = false)
- {
- if (!$this->validateString($property, $mandatory)) {
- return false;
- }
- if (!$this->filterUrl($this->config[$property])) {
- $this->warnings[] = $property.' : invalid value ('.$this->config[$property].'), must be an http/https URL';
- unset($this->config[$property]);
- return false;
- }
- return true;
- }
- private function filterUrl($value, array $schemes = array('http', 'https'))
- {
- if ($value === '') {
- return true;
- }
- $bits = parse_url($value);
- if (empty($bits['scheme']) || empty($bits['host'])) {
- return false;
- }
- if (!in_array($bits['scheme'], $schemes, true)) {
- return false;
- }
- return true;
- }
- }
- <?php
- namespace Composer\Package;
- use Composer\Json\JsonFile;
- use Composer\Installer\InstallationManager;
- use Composer\Repository\RepositoryManager;
- use Composer\Util\ProcessExecutor;
- use Composer\Repository\ArrayRepository;
- use Composer\Package\Dumper\ArrayDumper;
- use Composer\Package\Loader\ArrayLoader;
- use Composer\Util\Git as GitUtil;
- use Composer\IO\IOInterface;
- use Seld\JsonLint\ParsingException;
- class Locker
- {
- private $lockFile;
- private $repositoryManager;
- private $installationManager;
- private $hash;
- private $contentHash;
- private $loader;
- private $dumper;
- private $process;
- private $lockDataCache;
- public function __construct(IOInterface $io, JsonFile $lockFile, RepositoryManager $repositoryManager, InstallationManager $installationManager, $composerFileContents)
- {
- $this->lockFile = $lockFile;
- $this->repositoryManager = $repositoryManager;
- $this->installationManager = $installationManager;
- $this->hash = md5($composerFileContents);
- $this->contentHash = self::getContentHash($composerFileContents);
- $this->loader = new ArrayLoader(null, true);
- $this->dumper = new ArrayDumper();
- $this->process = new ProcessExecutor($io);
- }
- public static function getContentHash($composerFileContents)
- {
- $content = json_decode($composerFileContents, true);
- $relevantKeys = array(
- 'name',
- 'version',
- 'require',
- 'require-dev',
- 'conflict',
- 'replace',
- 'provide',
- 'minimum-stability',
- 'prefer-stable',
- 'repositories',
- 'extra',
- );
- $relevantContent = array();
- foreach (array_intersect($relevantKeys, array_keys($content)) as $key) {
- $relevantContent[$key] = $content[$key];
- }
- if (isset($content['config']['platform'])) {
- $relevantContent['config']['platform'] = $content['config']['platform'];
- }
- ksort($relevantContent);
- return md5(json_encode($relevantContent));
- }
- public function isLocked()
- {
- if (!$this->lockFile->exists()) {
- return false;
- }
- $data = $this->getLockData();
- return isset($data['packages']);
- }
- public function isFresh()
- {
- $lock = $this->lockFile->read();
- if (!empty($lock['content-hash'])) {
- return $this->contentHash === $lock['content-hash'];
- }
- return $this->hash === $lock['hash'];
- }
- public function getLockedRepository($withDevReqs = false)
- {
- $lockData = $this->getLockData();
- $packages = new ArrayRepository();
- $lockedPackages = $lockData['packages'];
- if ($withDevReqs) {
- if (isset($lockData['packages-dev'])) {
- $lockedPackages = array_merge($lockedPackages, $lockData['packages-dev']);
- } else {
- throw new \RuntimeException('The lock file does not contain require-dev information, run install with the --no-dev option or run update to install those packages.');
- }
- }
- if (empty($lockedPackages)) {
- return $packages;
- }
- if (isset($lockedPackages[0]['name'])) {
- foreach ($lockedPackages as $info) {
- $packages->addPackage($this->loader->load($info));
- }
- return $packages;
- }
- throw new \RuntimeException('Your composer.lock was created before 2012-09-15, and is not supported anymore. Run "composer update" to generate a new one.');
- }
- public function getPlatformRequirements($withDevReqs = false)
- {
- $lockData = $this->getLockData();
- $requirements = array();
- if (!empty($lockData['platform'])) {
- $requirements = $this->loader->parseLinks(
- '__ROOT__',
- '1.0.0',
- 'requires',
- isset($lockData['platform']) ? $lockData['platform'] : array()
- );
- }
- if ($withDevReqs && !empty($lockData['platform-dev'])) {
- $devRequirements = $this->loader->parseLinks(
- '__ROOT__',
- '1.0.0',
- 'requires',
- isset($lockData['platform-dev']) ? $lockData['platform-dev'] : array()
- );
- $requirements = array_merge($requirements, $devRequirements);
- }
- return $requirements;
- }
- public function getMinimumStability()
- {
- $lockData = $this->getLockData();
- return isset($lockData['minimum-stability']) ? $lockData['minimum-stability'] : 'stable';
- }
- public function getStabilityFlags()
- {
- $lockData = $this->getLockData();
- return isset($lockData['stability-flags']) ? $lockData['stability-flags'] : array();
- }
- public function getPreferStable()
- {
- $lockData = $this->getLockData();
-
- return isset($lockData['prefer-stable']) ? $lockData['prefer-stable'] : null;
- }
- public function getPreferLowest()
- {
- $lockData = $this->getLockData();
-
- return isset($lockData['prefer-lowest']) ? $lockData['prefer-lowest'] : null;
- }
- public function getPlatformOverrides()
- {
- $lockData = $this->getLockData();
- return isset($lockData['platform-overrides']) ? $lockData['platform-overrides'] : array();
- }
- public function getAliases()
- {
- $lockData = $this->getLockData();
- return isset($lockData['aliases']) ? $lockData['aliases'] : array();
- }
- public function getLockData()
- {
- if (null !== $this->lockDataCache) {
- return $this->lockDataCache;
- }
- if (!$this->lockFile->exists()) {
- throw new \LogicException('No lockfile found. Unable to read locked packages');
- }
- return $this->lockDataCache = $this->lockFile->read();
- }
- public function setLockData(array $packages, $devPackages, array $platformReqs, $platformDevReqs, array $aliases, $minimumStability, array $stabilityFlags, $preferStable, $preferLowest, array $platformOverrides)
- {
- $lock = array(
- '_readme' => array('This file locks the dependencies of your project to a known state',
- 'Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file',
- 'This file is @gener'.'ated automatically', ),
- 'hash' => $this->hash,
- 'content-hash' => $this->contentHash,
- 'packages' => null,
- 'packages-dev' => null,
- 'aliases' => array(),
- 'minimum-stability' => $minimumStability,
- 'stability-flags' => $stabilityFlags,
- 'prefer-stable' => $preferStable,
- 'prefer-lowest' => $preferLowest,
- );
- foreach ($aliases as $package => $versions) {
- foreach ($versions as $version => $alias) {
- $lock['aliases'][] = array(
- 'alias' => $alias['alias'],
- 'alias_normalized' => $alias['alias_normalized'],
- 'version' => $version,
- 'package' => $package,
- );
- }
- }
- $lock['packages'] = $this->lockPackages($packages);
- if (null !== $devPackages) {
- $lock['packages-dev'] = $this->lockPackages($devPackages);
- }
- $lock['platform'] = $platformReqs;
- $lock['platform-dev'] = $platformDevReqs;
- if ($platformOverrides) {
- $lock['platform-overrides'] = $platformOverrides;
- }
- if (empty($lock['packages']) && empty($lock['packages-dev']) && empty($lock['platform']) && empty($lock['platform-dev'])) {
- if ($this->lockFile->exists()) {
- unlink($this->lockFile->getPath());
- }
- return false;
- }
- try {
- $isLocked = $this->isLocked();
- } catch (ParsingException $e) {
- $isLocked = false;
- }
- if (!$isLocked || $lock !== $this->getLockData()) {
- $this->lockFile->write($lock);
- $this->lockDataCache = null;
- return true;
- }
- return false;
- }
- private function lockPackages(array $packages)
- {
- $locked = array();
- foreach ($packages as $package) {
- if ($package instanceof AliasPackage) {
- continue;
- }
- $name = $package->getPrettyName();
- $version = $package->getPrettyVersion();
- if (!$name || !$version) {
- throw new \LogicException(sprintf(
- 'Package "%s" has no version or name and can not be locked', $package
- ));
- }
- $spec = $this->dumper->dump($package);
- unset($spec['version_normalized']);
- $time = isset($spec['time']) ? $spec['time'] : null;
- unset($spec['time']);
- if ($package->isDev() && $package->getInstallationSource() === 'source') {
- $time = $this->getPackageTime($package) ?: $time;
- }
- if (null !== $time) {
- $spec['time'] = $time;
- }
- unset($spec['installation-source']);
- $locked[] = $spec;
- }
- usort($locked, function ($a, $b) {
- $comparison = strcmp($a['name'], $b['name']);
- if (0 !== $comparison) {
- return $comparison;
- }
- return strcmp($a['version'], $b['version']);
- });
- return $locked;
- }
- private function getPackageTime(PackageInterface $package)
- {
- if (!function_exists('proc_open')) {
- return null;
- }
- $path = realpath($this->installationManager->getInstallPath($package));
- $sourceType = $package->getSourceType();
- $datetime = null;
- if ($path && in_array($sourceType, array('git', 'hg'))) {
- $sourceRef = $package->getSourceReference() ?: $package->getDistReference();
- switch ($sourceType) {
- case 'git':
- GitUtil::cleanEnv();
- if (0 === $this->process->execute('git log -n1 --pretty=%ct '.ProcessExecutor::escape($sourceRef), $output, $path) && preg_match('{^\s*\d+\s*$}', $output)) {
- $datetime = new \DateTime('@'.trim($output), new \DateTimeZone('UTC'));
- }
- break;
- case 'hg':
- if (0 === $this->process->execute('hg log --template "{date|hgdate}" -r '.ProcessExecutor::escape($sourceRef), $output, $path) && preg_match('{^\s*(\d+)\s*}', $output, $match)) {
- $datetime = new \DateTime('@'.$match[1], new \DateTimeZone('UTC'));
- }
- break;
- }
- }
- return $datetime ? $datetime->format('Y-m-d H:i:s') : null;
- }
- }
- <?php
- namespace Composer\Package;
- use Composer\Package\Version\VersionParser;
- use Composer\Util\ComposerMirror;
- class Package extends BasePackage
- {
- protected $type;
- protected $targetDir;
- protected $installationSource;
- protected $sourceType;
- protected $sourceUrl;
- protected $sourceReference;
- protected $sourceMirrors;
- protected $distType;
- protected $distUrl;
- protected $distReference;
- protected $distSha1Checksum;
- protected $distMirrors;
- protected $version;
- protected $prettyVersion;
- protected $releaseDate;
- protected $extra = array();
- protected $binaries = array();
- protected $dev;
- protected $stability;
- protected $notificationUrl;
- protected $requires = array();
- protected $conflicts = array();
- protected $provides = array();
- protected $replaces = array();
- protected $devRequires = array();
- protected $suggests = array();
- protected $autoload = array();
- protected $devAutoload = array();
- protected $includePaths = array();
- protected $archiveExcludes = array();
- public function __construct($name, $version, $prettyVersion)
- {
- parent::__construct($name);
- $this->version = $version;
- $this->prettyVersion = $prettyVersion;
- $this->stability = VersionParser::parseStability($version);
- $this->dev = $this->stability === 'dev';
- }
- public function isDev()
- {
- return $this->dev;
- }
- public function setType($type)
- {
- $this->type = $type;
- }
- public function getType()
- {
- return $this->type ?: 'library';
- }
- public function getStability()
- {
- return $this->stability;
- }
- public function setTargetDir($targetDir)
- {
- $this->targetDir = $targetDir;
- }
- public function getTargetDir()
- {
- if (null === $this->targetDir) {
- return;
- }
- return ltrim(preg_replace('{ (?:^|[\\\\/]+) \.\.? (?:[\\\\/]+|$) (?:\.\.? (?:[\\\\/]+|$) )*}x', '/', $this->targetDir), '/');
- }
- public function setExtra(array $extra)
- {
- $this->extra = $extra;
- }
- public function getExtra()
- {
- return $this->extra;
- }
- public function setBinaries(array $binaries)
- {
- $this->binaries = $binaries;
- }
- public function getBinaries()
- {
- return $this->binaries;
- }
- public function setInstallationSource($type)
- {
- $this->installationSource = $type;
- }
- public function getInstallationSource()
- {
- return $this->installationSource;
- }
- public function setSourceType($type)
- {
- $this->sourceType = $type;
- }
- public function getSourceType()
- {
- return $this->sourceType;
- }
- public function setSourceUrl($url)
- {
- $this->sourceUrl = $url;
- }
- public function getSourceUrl()
- {
- return $this->sourceUrl;
- }
- public function setSourceReference($reference)
- {
- $this->sourceReference = $reference;
- }
- public function getSourceReference()
- {
- return $this->sourceReference;
- }
- public function setSourceMirrors($mirrors)
- {
- $this->sourceMirrors = $mirrors;
- }
- public function getSourceMirrors()
- {
- return $this->sourceMirrors;
- }
- public function getSourceUrls()
- {
- return $this->getUrls($this->sourceUrl, $this->sourceMirrors, $this->sourceReference, $this->sourceType, 'source');
- }
- public function setDistType($type)
- {
- $this->distType = $type;
- }
- public function getDistType()
- {
- return $this->distType;
- }
- public function setDistUrl($url)
- {
- $this->distUrl = $url;
- }
- public function getDistUrl()
- {
- return $this->distUrl;
- }
- public function setDistReference($reference)
- {
- $this->distReference = $reference;
- }
- public function getDistReference()
- {
- return $this->distReference;
- }
- public function setDistSha1Checksum($sha1checksum)
- {
- $this->distSha1Checksum = $sha1checksum;
- }
- public function getDistSha1Checksum()
- {
- return $this->distSha1Checksum;
- }
- public function setDistMirrors($mirrors)
- {
- $this->distMirrors = $mirrors;
- }
- public function getDistMirrors()
- {
- return $this->distMirrors;
- }
- public function getDistUrls()
- {
- return $this->getUrls($this->distUrl, $this->distMirrors, $this->distReference, $this->distType, 'dist');
- }
- public function getVersion()
- {
- return $this->version;
- }
- public function getPrettyVersion()
- {
- return $this->prettyVersion;
- }
- public function setReleaseDate(\DateTime $releaseDate)
- {
- $this->releaseDate = $releaseDate;
- }
- public function getReleaseDate()
- {
- return $this->releaseDate;
- }
- public function setRequires(array $requires)
- {
- $this->requires = $requires;
- }
- public function getRequires()
- {
- return $this->requires;
- }
- public function setConflicts(array $conflicts)
- {
- $this->conflicts = $conflicts;
- }
- public function getConflicts()
- {
- return $this->conflicts;
- }
- public function setProvides(array $provides)
- {
- $this->provides = $provides;
- }
- public function getProvides()
- {
- return $this->provides;
- }
- public function setReplaces(array $replaces)
- {
- $this->replaces = $replaces;
- }
- public function getReplaces()
- {
- return $this->replaces;
- }
- public function setDevRequires(array $devRequires)
- {
- $this->devRequires = $devRequires;
- }
- public function getDevRequires()
- {
- return $this->devRequires;
- }
- public function setSuggests(array $suggests)
- {
- $this->suggests = $suggests;
- }
- public function getSuggests()
- {
- return $this->suggests;
- }
- public function setAutoload(array $autoload)
- {
- $this->autoload = $autoload;
- }
- public function getAutoload()
- {
- return $this->autoload;
- }
- public function setDevAutoload(array $devAutoload)
- {
- $this->devAutoload = $devAutoload;
- }
- public function getDevAutoload()
- {
- return $this->devAutoload;
- }
- public function setIncludePaths(array $includePaths)
- {
- $this->includePaths = $includePaths;
- }
- public function getIncludePaths()
- {
- return $this->includePaths;
- }
- public function setNotificationUrl($notificationUrl)
- {
- $this->notificationUrl = $notificationUrl;
- }
- public function getNotificationUrl()
- {
- return $this->notificationUrl;
- }
- public function setArchiveExcludes(array $excludes)
- {
- $this->archiveExcludes = $excludes;
- }
- public function getArchiveExcludes()
- {
- return $this->archiveExcludes;
- }
- public function replaceVersion($version, $prettyVersion)
- {
- $this->version = $version;
- $this->prettyVersion = $prettyVersion;
- $this->stability = VersionParser::parseStability($version);
- $this->dev = $this->stability === 'dev';
- }
- protected function getUrls($url, $mirrors, $ref, $type, $urlType)
- {
- if (!$url) {
- return array();
- }
- $urls = array($url);
- if ($mirrors) {
- foreach ($mirrors as $mirror) {
- if ($urlType === 'dist') {
- $mirrorUrl = ComposerMirror::processUrl($mirror['url'], $this->name, $this->version, $ref, $type);
- } elseif ($urlType === 'source' && $type === 'git') {
- $mirrorUrl = ComposerMirror::processGitUrl($mirror['url'], $this->name, $url, $type);
- } elseif ($urlType === 'source' && $type === 'hg') {
- $mirrorUrl = ComposerMirror::processHgUrl($mirror['url'], $this->name, $url, $type);
- }
- if (!in_array($mirrorUrl, $urls)) {
- $func = $mirror['preferred'] ? 'array_unshift' : 'array_push';
- $func($urls, $mirrorUrl);
- }
- }
- }
- return $urls;
- }
- }
- <?php
- namespace Composer\Package;
- use Composer\Repository\RepositoryInterface;
- interface PackageInterface
- {
- public function getName();
- public function getPrettyName();
- public function getNames();
- public function setId($id);
- public function getId();
- public function isDev();
- public function getType();
- public function getTargetDir();
- public function getExtra();
- public function setInstallationSource($type);
- public function getInstallationSource();
- public function getSourceType();
- public function getSourceUrl();
- public function getSourceUrls();
- public function getSourceReference();
- public function getSourceMirrors();
- public function getDistType();
- public function getDistUrl();
- public function getDistUrls();
- public function getDistReference();
- public function getDistSha1Checksum();
- public function getDistMirrors();
- public function getVersion();
- public function getPrettyVersion();
- public function getFullPrettyVersion($truncate = true);
- public function getReleaseDate();
- public function getStability();
- public function getRequires();
- public function getConflicts();
- public function getProvides();
- public function getReplaces();
- public function getDevRequires();
- public function getSuggests();
- public function getAutoload();
- public function getDevAutoload();
- public function getIncludePaths();
- public function setRepository(RepositoryInterface $repository);
- public function getRepository();
- public function getBinaries();
- public function getUniqueName();
- public function getNotificationUrl();
- public function __toString();
- public function getPrettyString();
- public function getArchiveExcludes();
- public function getTransportOptions();
- }
- <?php
- namespace Composer\Package;
- class RootAliasPackage extends AliasPackage implements RootPackageInterface
- {
- public function __construct(RootPackageInterface $aliasOf, $version, $prettyVersion)
- {
- parent::__construct($aliasOf, $version, $prettyVersion);
- }
- public function getAliases()
- {
- return $this->aliasOf->getAliases();
- }
- public function getMinimumStability()
- {
- return $this->aliasOf->getMinimumStability();
- }
- public function getStabilityFlags()
- {
- return $this->aliasOf->getStabilityFlags();
- }
- public function getReferences()
- {
- return $this->aliasOf->getReferences();
- }
- public function getPreferStable()
- {
- return $this->aliasOf->getPreferStable();
- }
- public function setRequires(array $require)
- {
- $this->requires = $this->replaceSelfVersionDependencies($require, 'requires');
- $this->aliasOf->setRequires($require);
- }
- public function setDevRequires(array $devRequire)
- {
- $this->devRequires = $this->replaceSelfVersionDependencies($devRequire, 'devRequires');
- $this->aliasOf->setDevRequires($devRequire);
- }
- public function setConflicts(array $conflicts)
- {
- $this->conflicts = $this->replaceSelfVersionDependencies($conflicts, 'conflicts');
- $this->aliasOf->setConflicts($conflicts);
- }
- public function setProvides(array $provides)
- {
- $this->provides = $this->replaceSelfVersionDependencies($provides, 'provides');
- $this->aliasOf->setProvides($provides);
- }
- public function setReplaces(array $replaces)
- {
- $this->replaces = $this->replaceSelfVersionDependencies($replaces, 'replaces');
- $this->aliasOf->setReplaces($replaces);
- }
- public function setRepositories($repositories)
- {
- $this->aliasOf->setRepositories($repositories);
- }
- public function setAutoload(array $autoload)
- {
- $this->aliasOf->setAutoload($autoload);
- }
- public function setDevAutoload(array $devAutoload)
- {
- $this->aliasOf->setDevAutoload($devAutoload);
- }
- public function setStabilityFlags(array $stabilityFlags)
- {
- $this->aliasOf->setStabilityFlags($stabilityFlags);
- }
- public function setSuggests(array $suggests)
- {
- $this->aliasOf->setSuggests($suggests);
- }
- public function setExtra(array $extra)
- {
- $this->aliasOf->setExtra($extra);
- }
- public function __clone()
- {
- parent::__clone();
- $this->aliasOf = clone $this->aliasOf;
- }
- }
- <?php
- namespace Composer\Package;
- class RootPackage extends CompletePackage implements RootPackageInterface
- {
- protected $minimumStability = 'stable';
- protected $preferStable = false;
- protected $stabilityFlags = array();
- protected $references = array();
- protected $aliases = array();
- public function setMinimumStability($minimumStability)
- {
- $this->minimumStability = $minimumStability;
- }
- public function getMinimumStability()
- {
- return $this->minimumStability;
- }
- public function setStabilityFlags(array $stabilityFlags)
- {
- $this->stabilityFlags = $stabilityFlags;
- }
- public function getStabilityFlags()
- {
- return $this->stabilityFlags;
- }
- public function setPreferStable($preferStable)
- {
- $this->preferStable = $preferStable;
- }
- public function getPreferStable()
- {
- return $this->preferStable;
- }
- public function setReferences(array $references)
- {
- $this->references = $references;
- }
- public function getReferences()
- {
- return $this->references;
- }
- public function setAliases(array $aliases)
- {
- $this->aliases = $aliases;
- }
- public function getAliases()
- {
- return $this->aliases;
- }
- }
- <?php
- namespace Composer\Package;
- interface RootPackageInterface extends CompletePackageInterface
- {
- public function getAliases();
- public function getMinimumStability();
- public function getStabilityFlags();
- public function getReferences();
- public function getPreferStable();
- public function setRequires(array $requires);
- public function setDevRequires(array $devRequires);
- public function setConflicts(array $conflicts);
- public function setProvides(array $provides);
- public function setReplaces(array $replaces);
- public function setRepositories($repositories);
- public function setAutoload(array $autoload);
- public function setDevAutoload(array $devAutoload);
- public function setStabilityFlags(array $stabilityFlags);
- public function setSuggests(array $suggests);
- public function setExtra(array $extra);
- }
- <?php
- namespace Composer\Package\Version;
- use Composer\Config;
- use Composer\Repository\Vcs\HgDriver;
- use Composer\IO\NullIO;
- use Composer\Semver\VersionParser as SemverVersionParser;
- use Composer\Util\Git as GitUtil;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\Svn as SvnUtil;
- class VersionGuesser
- {
- private $config;
- private $process;
- private $versionParser;
- public function __construct(Config $config, ProcessExecutor $process, SemverVersionParser $versionParser)
- {
- $this->config = $config;
- $this->process = $process;
- $this->versionParser = $versionParser;
- }
- public function guessVersion(array $packageConfig, $path)
- {
- if (function_exists('proc_open')) {
- $version = $this->guessGitVersion($packageConfig, $path);
- if (null !== $version) {
- return $version;
- }
- $version = $this->guessHgVersion($packageConfig, $path);
- if (null !== $version) {
- return $version;
- }
- return $this->guessSvnVersion($packageConfig, $path);
- }
- }
- private function guessGitVersion(array $packageConfig, $path)
- {
- GitUtil::cleanEnv();
- if (0 === $this->process->execute('git describe --exact-match --tags', $output, $path)) {
- try {
- return $this->versionParser->normalize(trim($output));
- } catch (\Exception $e) {
- }
- }
- if (0 === $this->process->execute('git branch --no-color --no-abbrev -v', $output, $path)) {
- $branches = array();
- $isFeatureBranch = false;
- $version = null;
- foreach ($this->process->splitLines($output) as $branch) {
- if ($branch && preg_match('{^(?:\* ) *(\(no branch\)|\(detached from \S+\)|\S+) *([a-f0-9]+) .*$}', $branch, $match)) {
- if ($match[1] === '(no branch)' || substr($match[1], 0, 10) === '(detached ') {
- $version = 'dev-'.$match[2];
- $isFeatureBranch = true;
- } else {
- $version = $this->versionParser->normalizeBranch($match[1]);
- $isFeatureBranch = 0 === strpos($version, 'dev-');
- if ('9999999-dev' === $version) {
- $version = 'dev-'.$match[1];
- }
- }
- }
- if ($branch && !preg_match('{^ *[^/]+/HEAD }', $branch)) {
- if (preg_match('{^(?:\* )? *(\S+) *([a-f0-9]+) .*$}', $branch, $match)) {
- $branches[] = $match[1];
- }
- }
- }
- if (!$isFeatureBranch) {
- return $version;
- }
- $version = $this->guessFeatureVersion($packageConfig, $version, $branches, 'git rev-list %candidate%..%branch%', $path);
- return $version;
- }
- }
- private function guessHgVersion(array $packageConfig, $path)
- {
- if (0 === $this->process->execute('hg branch', $output, $path)) {
- $branch = trim($output);
- $version = $this->versionParser->normalizeBranch($branch);
- $isFeatureBranch = 0 === strpos($version, 'dev-');
- if ('9999999-dev' === $version) {
- $version = 'dev-'.$branch;
- }
- if (!$isFeatureBranch) {
- return $version;
- }
- $driver = new HgDriver(array('url' => $path), new NullIO(), $this->config, $this->process);
- $branches = array_keys($driver->getBranches());
- $version = $this->guessFeatureVersion($packageConfig, $version, $branches, 'hg log -r "not ancestors(\'%candidate%\') and ancestors(\'%branch%\')" --template "{node}\\n"', $path);
- return $version;
- }
- }
- private function guessFeatureVersion(array $packageConfig, $version, array $branches, $scmCmdline, $path)
- {
-
- if ((isset($packageConfig['extra']['branch-alias']) && !isset($packageConfig['extra']['branch-alias'][$version]))
- || strpos(json_encode($packageConfig), '"self.version"')
- ) {
- $branch = preg_replace('{^dev-}', '', $version);
- $length = PHP_INT_MAX;
- $nonFeatureBranches = '';
- if (!empty($packageConfig['non-feature-branches'])) {
- $nonFeatureBranches = implode('|', $packageConfig['non-feature-branches']);
- }
- foreach ($branches as $candidate) {
- if ($candidate === $branch && preg_match('{^(' . $nonFeatureBranches . ')$}', $candidate)) {
- return $version;
- }
- if ($candidate === $branch || !preg_match('{^(master|trunk|default|develop|\d+\..+)$}', $candidate, $match)) {
- continue;
- }
- $cmdLine = str_replace(array('%candidate%', '%branch%'), array($candidate, $branch), $scmCmdline);
- if (0 !== $this->process->execute($cmdLine, $output, $path)) {
- continue;
- }
- if (strlen($output) < $length) {
- $length = strlen($output);
- $version = $this->versionParser->normalizeBranch($candidate);
- if ('9999999-dev' === $version) {
- $version = 'dev-'.$match[1];
- }
- }
- }
- }
- return $version;
- }
- private function guessSvnVersion(array $packageConfig, $path)
- {
- SvnUtil::cleanEnv();
- if (0 === $this->process->execute('svn info --xml', $output, $path)) {
- $trunkPath = isset($packageConfig['trunk-path']) ? preg_quote($packageConfig['trunk-path'], '#') : 'trunk';
- $branchesPath = isset($packageConfig['branches-path']) ? preg_quote($packageConfig['branches-path'], '#') : 'branches';
- $tagsPath = isset($packageConfig['tags-path']) ? preg_quote($packageConfig['tags-path'], '#') : 'tags';
- $urlPattern = '#<url>.*/('.$trunkPath.'|('.$branchesPath.'|'. $tagsPath .')/(.*))</url>#';
- if (preg_match($urlPattern, $output, $matches)) {
- if (isset($matches[2]) && ($branchesPath === $matches[2] || $tagsPath === $matches[2])) {
- $version = $this->versionParser->normalizeBranch($matches[3]);
- if ('9999999-dev' === $version) {
- $version = 'dev-'.$matches[3];
- }
- return $version;
- }
- return $this->versionParser->normalize(trim($matches[1]));
- }
- }
- }
- }
- <?php
- namespace Composer\Package\Version;
- use Composer\Semver\VersionParser as SemverVersionParser;
- class VersionParser extends SemverVersionParser
- {
- private static $constraints = array();
- public function parseConstraints($constraints)
- {
- if (!isset(self::$constraints[$constraints])) {
- self::$constraints[$constraints] = parent::parseConstraints($constraints);
- }
- return self::$constraints[$constraints];
- }
- public function parseNameVersionPairs(array $pairs)
- {
- $pairs = array_values($pairs);
- $result = array();
- for ($i = 0, $count = count($pairs); $i < $count; $i++) {
- $pair = preg_replace('{^([^=: ]+)[=: ](.*)$}', '$1 $2', trim($pairs[$i]));
- if (false === strpos($pair, ' ') && isset($pairs[$i + 1]) && false === strpos($pairs[$i + 1], '/')) {
- $pair .= ' '.$pairs[$i + 1];
- $i++;
- }
- if (strpos($pair, ' ')) {
- list($name, $version) = explode(" ", $pair, 2);
- $result[] = array('name' => $name, 'version' => $version);
- } else {
- $result[] = array('name' => $pair);
- }
- }
- return $result;
- }
- }
- <?php
- namespace Composer\Package\Version;
- use Composer\DependencyResolver\Pool;
- use Composer\Package\BasePackage;
- use Composer\Package\PackageInterface;
- use Composer\Package\Loader\ArrayLoader;
- use Composer\Package\Dumper\ArrayDumper;
- use Composer\Semver\Semver;
- use Composer\Semver\Constraint\Constraint;
- class VersionSelector
- {
- private $pool;
- private $parser;
- public function __construct(Pool $pool)
- {
- $this->pool = $pool;
- }
- public function findBestCandidate($packageName, $targetPackageVersion = null, $targetPhpVersion = null, $preferredStability = 'stable')
- {
- $constraint = $targetPackageVersion ? $this->getParser()->parseConstraints($targetPackageVersion) : null;
- $candidates = $this->pool->whatProvides(strtolower($packageName), $constraint, true);
- if ($targetPhpVersion) {
- $phpConstraint = new Constraint('==', $this->getParser()->normalize($targetPhpVersion));
- $candidates = array_filter($candidates, function ($pkg) use ($phpConstraint) {
- $reqs = $pkg->getRequires();
- return !isset($reqs['php']) || $reqs['php']->getConstraint()->matches($phpConstraint);
- });
- }
- if (!$candidates) {
- return false;
- }
- $package = reset($candidates);
- $minPriority = BasePackage::$stabilities[$preferredStability];
- foreach ($candidates as $candidate) {
- $candidatePriority = $candidate->getStabilityPriority();
- $currentPriority = $package->getStabilityPriority();
- if ($minPriority < $candidatePriority && $currentPriority < $candidatePriority) {
- continue;
- }
- if ($minPriority >= $candidatePriority && $minPriority < $currentPriority) {
- $package = $candidate;
- continue;
- }
- if (version_compare($package->getVersion(), $candidate->getVersion(), '<')) {
- $package = $candidate;
- }
- }
- return $package;
- }
- public function findRecommendedRequireVersion(PackageInterface $package)
- {
- $version = $package->getVersion();
- if (!$package->isDev()) {
- return $this->transformVersion($version, $package->getPrettyVersion(), $package->getStability());
- }
- $loader = new ArrayLoader($this->getParser());
- $dumper = new ArrayDumper();
- $extra = $loader->getBranchAlias($dumper->dump($package));
- if ($extra) {
- $extra = preg_replace('{^(\d+\.\d+\.\d+)(\.9999999)-dev$}', '$1.0', $extra, -1, $count);
- if ($count) {
- $extra = str_replace('.9999999', '.0', $extra);
- return $this->transformVersion($extra, $extra, 'dev');
- }
- }
- return $package->getPrettyVersion();
- }
- private function transformVersion($version, $prettyVersion, $stability)
- {
-
- $semanticVersionParts = explode('.', $version);
- if (count($semanticVersionParts) == 4 && preg_match('{^0\D?}', $semanticVersionParts[3])) {
- if ($semanticVersionParts[0] === '0') {
- unset($semanticVersionParts[3]);
- } else {
- unset($semanticVersionParts[2], $semanticVersionParts[3]);
- }
- $version = implode('.', $semanticVersionParts);
- } else {
- return $prettyVersion;
- }
- if ($stability != 'stable') {
- $version .= '@'.$stability;
- }
- return '^' . $version;
- }
- private function getParser()
- {
- if ($this->parser === null) {
- $this->parser = new VersionParser();
- }
- return $this->parser;
- }
- }
- <?php
- namespace Composer\Plugin\Capability;
- interface Capability
- {
- }
- <?php
- namespace Composer\Plugin;
- interface Capable
- {
- public function getCapabilities();
- }
- <?php
- namespace Composer\Plugin;
- use Composer\EventDispatcher\Event;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class CommandEvent extends Event
- {
- private $commandName;
- private $input;
- private $output;
- public function __construct($name, $commandName, $input, $output, array $args = array(), array $flags = array())
- {
- parent::__construct($name, $args, $flags);
- $this->commandName = $commandName;
- $this->input = $input;
- $this->output = $output;
- }
- public function getInput()
- {
- return $this->input;
- }
- public function getOutput()
- {
- return $this->output;
- }
- public function getCommandName()
- {
- return $this->commandName;
- }
- }
- <?php
- namespace Composer\Plugin;
- class PluginEvents
- {
- const COMMAND = 'command';
- const PRE_FILE_DOWNLOAD = 'pre-file-download';
- }
- <?php
- namespace Composer\Plugin;
- use Composer\Composer;
- use Composer\IO\IOInterface;
- interface PluginInterface
- {
- const PLUGIN_API_VERSION = '1.0.0';
- public function activate(Composer $composer, IOInterface $io);
- }
- <?php
- namespace Composer\Plugin;
- use Composer\Composer;
- use Composer\EventDispatcher\EventSubscriberInterface;
- use Composer\IO\IOInterface;
- use Composer\Package\Package;
- use Composer\Package\Version\VersionParser;
- use Composer\Repository\RepositoryInterface;
- use Composer\Package\AliasPackage;
- use Composer\Package\PackageInterface;
- use Composer\Package\Link;
- use Composer\Semver\Constraint\Constraint;
- use Composer\DependencyResolver\Pool;
- use Composer\Plugin\Capability\Capability;
- class PluginManager
- {
- protected $composer;
- protected $io;
- protected $globalComposer;
- protected $versionParser;
- protected $disablePlugins = false;
- protected $plugins = array();
- protected $registeredPlugins = array();
- private static $classCounter = 0;
- public function __construct(IOInterface $io, Composer $composer, Composer $globalComposer = null, $disablePlugins = false)
- {
- $this->io = $io;
- $this->composer = $composer;
- $this->globalComposer = $globalComposer;
- $this->versionParser = new VersionParser();
- $this->disablePlugins = $disablePlugins;
- }
- public function loadInstalledPlugins()
- {
- if ($this->disablePlugins) {
- return;
- }
- $repo = $this->composer->getRepositoryManager()->getLocalRepository();
- $globalRepo = $this->globalComposer ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null;
- if ($repo) {
- $this->loadRepository($repo);
- }
- if ($globalRepo) {
- $this->loadRepository($globalRepo);
- }
- }
- public function getPlugins()
- {
- return $this->plugins;
- }
- public function registerPackage(PackageInterface $package, $failOnMissingClasses = false)
- {
- if ($this->disablePlugins) {
- return;
- }
- if ($package->getType() === 'composer-plugin') {
- $requiresComposer = null;
- foreach ($package->getRequires() as $link) {
- if ('composer-plugin-api' === $link->getTarget()) {
- $requiresComposer = $link->getConstraint();
- break;
- }
- }
- if (!$requiresComposer) {
- throw new \RuntimeException("Plugin ".$package->getName()." is missing a require statement for a version of the composer-plugin-api package.");
- }
- $currentPluginApiVersion = $this->getPluginApiVersion();
- $currentPluginApiConstraint = new Constraint('==', $this->versionParser->normalize($currentPluginApiVersion));
- if ($requiresComposer->getPrettyString() === '1.0.0' && $this->getPluginApiVersion() === '1.0.0') {
- $this->io->writeError('<warning>The "' . $package->getName() . '" plugin requires composer-plugin-api 1.0.0, this *WILL* break in the future and it should be fixed ASAP (require ^1.0 for example).</warning>');
- } elseif (!$requiresComposer->matches($currentPluginApiConstraint)) {
- $this->io->writeError('<warning>The "' . $package->getName() . '" plugin was skipped because it requires a Plugin API version ("' . $requiresComposer->getPrettyString() . '") that does not match your Composer installation ("' . $currentPluginApiVersion . '"). You may need to run composer update with the "--no-plugins" option.</warning>');
- return;
- }
- }
- $oldInstallerPlugin = ($package->getType() === 'composer-installer');
- if (in_array($package->getName(), $this->registeredPlugins)) {
- return;
- }
- $extra = $package->getExtra();
- if (empty($extra['class'])) {
- throw new \UnexpectedValueException('Error while installing '.$package->getPrettyName().', composer-plugin packages should have a class defined in their extra key to be usable.');
- }
- $classes = is_array($extra['class']) ? $extra['class'] : array($extra['class']);
- $localRepo = $this->composer->getRepositoryManager()->getLocalRepository();
- $globalRepo = $this->globalComposer ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null;
- $pool = new Pool('dev');
- $pool->addRepository($localRepo);
- if ($globalRepo) {
- $pool->addRepository($globalRepo);
- }
- $autoloadPackages = array($package->getName() => $package);
- $autoloadPackages = $this->collectDependencies($pool, $autoloadPackages, $package);
- $generator = $this->composer->getAutoloadGenerator();
- $autoloads = array();
- foreach ($autoloadPackages as $autoloadPackage) {
- $downloadPath = $this->getInstallPath($autoloadPackage, ($globalRepo && $globalRepo->hasPackage($autoloadPackage)));
- $autoloads[] = array($autoloadPackage, $downloadPath);
- }
- $map = $generator->parseAutoloads($autoloads, new Package('dummy', '1.0.0.0', '1.0.0'));
- $classLoader = $generator->createLoader($map);
- $classLoader->register();
- foreach ($classes as $class) {
- if (class_exists($class, false)) {
- $code = file_get_contents($classLoader->findFile($class));
- $code = preg_replace('{^((?:final\s+)?(?:\s*))class\s+(\S+)}mi', '$1class $2_composer_tmp'.self::$classCounter, $code);
- eval('?>'.$code);
- $class .= '_composer_tmp'.self::$classCounter;
- self::$classCounter++;
- }
- if ($oldInstallerPlugin) {
- $installer = new $class($this->io, $this->composer);
- $this->composer->getInstallationManager()->addInstaller($installer);
- } elseif (class_exists($class)) {
- $plugin = new $class();
- $this->addPlugin($plugin);
- $this->registeredPlugins[] = $package->getName();
- } elseif ($failOnMissingClasses) {
- throw new \UnexpectedValueException('Plugin '.$package->getName().' could not be initialized, class not found: '.$class);
- }
- }
- }
- protected function getPluginApiVersion()
- {
- return PluginInterface::PLUGIN_API_VERSION;
- }
- private function addPlugin(PluginInterface $plugin)
- {
- $this->io->writeError('Loading plugin '.get_class($plugin), true, IOInterface::DEBUG);
- $this->plugins[] = $plugin;
- $plugin->activate($this->composer, $this->io);
- if ($plugin instanceof EventSubscriberInterface) {
- $this->composer->getEventDispatcher()->addSubscriber($plugin);
- }
- }
- private function loadRepository(RepositoryInterface $repo)
- {
- foreach ($repo->getPackages() as $package) {
- if ($package instanceof AliasPackage) {
- continue;
- }
- if ('composer-plugin' === $package->getType()) {
- $this->registerPackage($package);
- } elseif ('composer-installer' === $package->getType()) {
- $this->registerPackage($package);
- }
- }
- }
- private function collectDependencies(Pool $pool, array $collected, PackageInterface $package)
- {
- $requires = array_merge(
- $package->getRequires(),
- $package->getDevRequires()
- );
- foreach ($requires as $requireLink) {
- $requiredPackage = $this->lookupInstalledPackage($pool, $requireLink);
- if ($requiredPackage && !isset($collected[$requiredPackage->getName()])) {
- $collected[$requiredPackage->getName()] = $requiredPackage;
- $collected = $this->collectDependencies($pool, $collected, $requiredPackage);
- }
- }
- return $collected;
- }
- private function lookupInstalledPackage(Pool $pool, Link $link)
- {
- $packages = $pool->whatProvides($link->getTarget(), $link->getConstraint());
- return (!empty($packages)) ? $packages[0] : null;
- }
- private function getInstallPath(PackageInterface $package, $global = false)
- {
- if (!$global) {
- return $this->composer->getInstallationManager()->getInstallPath($package);
- }
- return $this->globalComposer->getInstallationManager()->getInstallPath($package);
- }
- protected function getCapabilityImplementationClassName(PluginInterface $plugin, $capability)
- {
- if (!($plugin instanceof Capable)) {
- return null;
- }
- $capabilities = (array) $plugin->getCapabilities();
- if (!empty($capabilities[$capability]) && is_string($capabilities[$capability]) && trim($capabilities[$capability])) {
- return trim($capabilities[$capability]);
- }
- if (
- array_key_exists($capability, $capabilities)
- && (empty($capabilities[$capability]) || !is_string($capabilities[$capability]) || !trim($capabilities[$capability]))
- ) {
- throw new \UnexpectedValueException('Plugin '.get_class($plugin).' provided invalid capability class name(s), got '.var_export($capabilities[$capability], 1));
- }
- }
- public function getPluginCapability(PluginInterface $plugin, $capabilityClassName, array $ctorArgs = array())
- {
- if ($capabilityClass = $this->getCapabilityImplementationClassName($plugin, $capabilityClassName)) {
- if (!class_exists($capabilityClass)) {
- throw new \RuntimeException("Cannot instantiate Capability, as class $capabilityClass from plugin ".get_class($plugin)." does not exist.");
- }
- $capabilityObj = new $capabilityClass($ctorArgs);
- if (!$capabilityObj instanceof Capability || !$capabilityObj instanceof $capabilityClassName) {
- throw new \RuntimeException(
- 'Class ' . $capabilityClass . ' must implement both Composer\Plugin\Capability\Capability and '. $capabilityClassName . '.'
- );
- }
- return $capabilityObj;
- }
- }
- }
- <?php
- namespace Composer\Plugin;
- use Composer\EventDispatcher\Event;
- use Composer\Util\RemoteFilesystem;
- class PreFileDownloadEvent extends Event
- {
- private $rfs;
- private $processedUrl;
- public function __construct($name, RemoteFilesystem $rfs, $processedUrl)
- {
- parent::__construct($name);
- $this->rfs = $rfs;
- $this->processedUrl = $processedUrl;
- }
- public function getRemoteFilesystem()
- {
- return $this->rfs;
- }
- public function setRemoteFilesystem(RemoteFilesystem $rfs)
- {
- $this->rfs = $rfs;
- }
- public function getProcessedUrl()
- {
- return $this->processedUrl;
- }
- }
- <?php
- namespace Composer\Repository;
- use Composer\Package\AliasPackage;
- use Composer\Package\PackageInterface;
- use Composer\Package\CompletePackageInterface;
- use Composer\Package\Version\VersionParser;
- use Composer\Semver\Constraint\ConstraintInterface;
- use Composer\Semver\Constraint\Constraint;
- class ArrayRepository extends BaseRepository
- {
- protected $packages;
- public function __construct(array $packages = array())
- {
- foreach ($packages as $package) {
- $this->addPackage($package);
- }
- }
- public function findPackage($name, $constraint)
- {
- $name = strtolower($name);
- if (!$constraint instanceof ConstraintInterface) {
- $versionParser = new VersionParser();
- $constraint = $versionParser->parseConstraints($constraint);
- }
- foreach ($this->getPackages() as $package) {
- if ($name === $package->getName()) {
- $pkgConstraint = new Constraint('==', $package->getVersion());
- if ($constraint->matches($pkgConstraint)) {
- return $package;
- }
- }
- }
- }
- public function findPackages($name, $constraint = null)
- {
- $name = strtolower($name);
- $packages = array();
- if (null !== $constraint && !$constraint instanceof ConstraintInterface) {
- $versionParser = new VersionParser();
- $constraint = $versionParser->parseConstraints($constraint);
- }
- foreach ($this->getPackages() as $package) {
- if ($name === $package->getName()) {
- $pkgConstraint = new Constraint('==', $package->getVersion());
- if (null === $constraint || $constraint->matches($pkgConstraint)) {
- $packages[] = $package;
- }
- }
- }
- return $packages;
- }
- public function search($query, $mode = 0)
- {
- $regex = '{(?:'.implode('|', preg_split('{\s+}', $query)).')}i';
- $matches = array();
- foreach ($this->getPackages() as $package) {
- $name = $package->getName();
- if (isset($matches[$name])) {
- continue;
- }
- if (preg_match($regex, $name)
- || ($mode === self::SEARCH_FULLTEXT && $package instanceof CompletePackageInterface && preg_match($regex, implode(' ', (array) $package->getKeywords()) . ' ' . $package->getDescription()))
- ) {
- $matches[$name] = array(
- 'name' => $package->getPrettyName(),
- 'description' => $package->getDescription(),
- );
- }
- }
- return array_values($matches);
- }
- public function hasPackage(PackageInterface $package)
- {
- $packageId = $package->getUniqueName();
- foreach ($this->getPackages() as $repoPackage) {
- if ($packageId === $repoPackage->getUniqueName()) {
- return true;
- }
- }
- return false;
- }
- public function addPackage(PackageInterface $package)
- {
- if (null === $this->packages) {
- $this->initialize();
- }
- $package->setRepository($this);
- $this->packages[] = $package;
- if ($package instanceof AliasPackage) {
- $aliasedPackage = $package->getAliasOf();
- if (null === $aliasedPackage->getRepository()) {
- $this->addPackage($aliasedPackage);
- }
- }
- }
- protected function createAliasPackage(PackageInterface $package, $alias, $prettyAlias)
- {
- return new AliasPackage($package instanceof AliasPackage ? $package->getAliasOf() : $package, $alias, $prettyAlias);
- }
- public function removePackage(PackageInterface $package)
- {
- $packageId = $package->getUniqueName();
- foreach ($this->getPackages() as $key => $repoPackage) {
- if ($packageId === $repoPackage->getUniqueName()) {
- array_splice($this->packages, $key, 1);
- return;
- }
- }
- }
- public function getPackages()
- {
- if (null === $this->packages) {
- $this->initialize();
- }
- return $this->packages;
- }
- public function count()
- {
- return count($this->packages);
- }
- protected function initialize()
- {
- $this->packages = array();
- }
- }
- <?php
- namespace Composer\Repository;
- use Composer\IO\IOInterface;
- use Composer\Json\JsonFile;
- use Composer\Package\Loader\ArrayLoader;
- use Composer\Package\Loader\LoaderInterface;
- class ArtifactRepository extends ArrayRepository implements ConfigurableRepositoryInterface
- {
- protected $loader;
- protected $lookup;
- protected $repoConfig;
- public function __construct(array $repoConfig, IOInterface $io)
- {
- if (!extension_loaded('zip')) {
- throw new \RuntimeException('The artifact repository requires PHP\'s zip extension');
- }
- $this->loader = new ArrayLoader();
- $this->lookup = $repoConfig['url'];
- $this->io = $io;
- $this->repoConfig = $repoConfig;
- }
- public function getRepoConfig()
- {
- return $this->repoConfig;
- }
- protected function initialize()
- {
- parent::initialize();
- $this->scanDirectory($this->lookup);
- }
- private function scanDirectory($path)
- {
- $io = $this->io;
- $directory = new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS);
- $iterator = new \RecursiveIteratorIterator($directory);
- $regex = new \RegexIterator($iterator, '/^.+\.(zip|phar)$/i');
- foreach ($regex as $file) {
- if (!$file->isFile()) {
- continue;
- }
- $package = $this->getComposerInformation($file);
- if (!$package) {
- $io->writeError("File <comment>{$file->getBasename()}</comment> doesn't seem to hold a package", true, IOInterface::VERBOSE);
- continue;
- }
- $template = 'Found package <info>%s</info> (<comment>%s</comment>) in file <info>%s</info>';
- $io->writeError(sprintf($template, $package->getName(), $package->getPrettyVersion(), $file->getBasename()), true, IOInterface::VERBOSE);
- $this->addPackage($package);
- }
- }
- private function locateFile(\ZipArchive $zip, $filename)
- {
- $indexOfShortestMatch = false;
- $lengthOfShortestMatch = -1;
- for ($i = 0; $i < $zip->numFiles; $i++) {
- $stat = $zip->statIndex($i);
- if (strcmp(basename($stat['name']), $filename) === 0) {
- $directoryName = dirname($stat['name']);
- if ($directoryName == '.') {
-
- return $i;
- }
- if (strpos($directoryName, '\\') !== false ||
- strpos($directoryName, '/') !== false) {
- continue;
- }
- $length = strlen($stat['name']);
- if ($indexOfShortestMatch == false || $length < $lengthOfShortestMatch) {
- $contents = $zip->getFromIndex($i);
- if ($contents !== false) {
- $indexOfShortestMatch = $i;
- $lengthOfShortestMatch = $length;
- }
- }
- }
- }
- return $indexOfShortestMatch;
- }
- private function getComposerInformation(\SplFileInfo $file)
- {
- $zip = new \ZipArchive();
- $zip->open($file->getPathname());
- if (0 == $zip->numFiles) {
- return false;
- }
- $foundFileIndex = $this->locateFile($zip, 'composer.json');
- if (false === $foundFileIndex) {
- return false;
- }
- $configurationFileName = $zip->getNameIndex($foundFileIndex);
- $composerFile = "zip://{$file->getPathname()}#$configurationFileName";
- $json = file_get_contents($composerFile);
- $package = JsonFile::parseJson($json, $composerFile);
- $package['dist'] = array(
- 'type' => 'zip',
- 'url' => strtr($file->getPathname(), '\\', '/'),
- 'shasum' => sha1_file($file->getRealPath()),
- );
- $package = $this->loader->load($package);
- return $package;
- }
- }
- <?php
- namespace Composer\Repository;
- use Composer\Package\RootPackageInterface;
- use Composer\Semver\Constraint\ConstraintInterface;
- abstract class BaseRepository implements RepositoryInterface
- {
- public function getDependents($needle, $constraint = null, $invert = false, $recurse = true)
- {
- $needles = (array) $needle;
- $results = array();
- foreach ($this->getPackages() as $package) {
- $links = $package->getRequires();
- if (!$invert) {
- $links += $package->getReplaces();
- }
- if ($package instanceof RootPackageInterface) {
- $links += $package->getDevRequires();
- }
- foreach ($links as $link) {
- foreach ($needles as $needle) {
- if ($link->getTarget() === $needle) {
- if (is_null($constraint) || (($link->getConstraint()->matches($constraint) === !$invert))) {
- $dependents = $recurse ? $this->getDependents($link->getSource(), null, false, true) : array();
- $results[$link->getSource()] = array($package, $link, $dependents);
- }
- }
- }
- }
- }
- ksort($results);
- return $results;
- }
- }
- <?php
- namespace Composer\Repository;
- use Composer\Package\Loader\ArrayLoader;
- use Composer\Package\PackageInterface;
- use Composer\Package\AliasPackage;
- use Composer\Package\Version\VersionParser;
- use Composer\DependencyResolver\Pool;
- use Composer\Json\JsonFile;
- use Composer\Cache;
- use Composer\Config;
- use Composer\Factory;
- use Composer\IO\IOInterface;
- use Composer\Util\RemoteFilesystem;
- use Composer\Plugin\PluginEvents;
- use Composer\Plugin\PreFileDownloadEvent;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Downloader\TransportException;
- use Composer\Semver\Constraint\ConstraintInterface;
- use Composer\Semver\Constraint\Constraint;
- class ComposerRepository extends ArrayRepository implements ConfigurableRepositoryInterface
- {
- protected $config;
- protected $repoConfig;
- protected $options;
- protected $url;
- protected $baseUrl;
- protected $io;
- protected $rfs;
- protected $cache;
- protected $notifyUrl;
- protected $searchUrl;
- protected $hasProviders = false;
- protected $providersUrl;
- protected $lazyProvidersUrl;
- protected $providerListing;
- protected $providers = array();
- protected $providersByUid = array();
- protected $loader;
- protected $rootAliases;
- protected $allowSslDowngrade = false;
- protected $eventDispatcher;
- protected $sourceMirrors;
- protected $distMirrors;
- private $degradedMode = false;
- private $rootData;
- public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, RemoteFilesystem $rfs = null)
- {
- if (!preg_match('{^[\w.]+\??://}', $repoConfig['url'])) {
- $repoConfig['url'] = 'http://'.$repoConfig['url'];
- }
- $repoConfig['url'] = rtrim($repoConfig['url'], '/');
- if ('https?' === substr($repoConfig['url'], 0, 6)) {
- $repoConfig['url'] = (extension_loaded('openssl') ? 'https' : 'http') . substr($repoConfig['url'], 6);
- }
- $urlBits = parse_url($repoConfig['url']);
- if ($urlBits === false || empty($urlBits['scheme'])) {
- throw new \UnexpectedValueException('Invalid url given for Composer repository: '.$repoConfig['url']);
- }
- if (!isset($repoConfig['options'])) {
- $repoConfig['options'] = array();
- }
- if (isset($repoConfig['allow_ssl_downgrade']) && true === $repoConfig['allow_ssl_downgrade']) {
- $this->allowSslDowngrade = true;
- }
- $this->config = $config;
- $this->options = $repoConfig['options'];
- $this->url = $repoConfig['url'];
- $this->baseUrl = rtrim(preg_replace('{^(.*)(?:/[^/\\]+.json)?(?:[?#].*)?$}', '$1', $this->url), '/');
- $this->io = $io;
- $this->cache = new Cache($io, $config->get('cache-repo-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', $this->url), 'a-z0-9.$');
- $this->loader = new ArrayLoader();
- if ($rfs && $this->options) {
- $rfs = clone $rfs;
- $rfs->setOptions($this->options);
- }
- $this->rfs = $rfs ?: Factory::createRemoteFilesystem($this->io, $this->config, $this->options);
- $this->eventDispatcher = $eventDispatcher;
- $this->repoConfig = $repoConfig;
- }
- public function getRepoConfig()
- {
- return $this->repoConfig;
- }
- public function setRootAliases(array $rootAliases)
- {
- $this->rootAliases = $rootAliases;
- }
- public function findPackage($name, $constraint)
- {
- if (!$this->hasProviders()) {
- return parent::findPackage($name, $constraint);
- }
- $name = strtolower($name);
- if (!$constraint instanceof ConstraintInterface) {
- $versionParser = new VersionParser();
- $constraint = $versionParser->parseConstraints($constraint);
- }
- foreach ($this->getProviderNames() as $providerName) {
- if ($name === $providerName) {
- $packages = $this->whatProvides(new Pool('dev'), $providerName);
- foreach ($packages as $package) {
- if ($name === $package->getName()) {
- $pkgConstraint = new Constraint('==', $package->getVersion());
- if ($constraint->matches($pkgConstraint)) {
- return $package;
- }
- }
- }
- break;
- }
- }
- }
- public function findPackages($name, $constraint = null)
- {
- if (!$this->hasProviders()) {
- return parent::findPackages($name, $constraint);
- }
- $name = strtolower($name);
- if (null !== $constraint && !$constraint instanceof ConstraintInterface) {
- $versionParser = new VersionParser();
- $constraint = $versionParser->parseConstraints($constraint);
- }
- $packages = array();
- foreach ($this->getProviderNames() as $providerName) {
- if ($name === $providerName) {
- $candidates = $this->whatProvides(new Pool('dev'), $providerName);
- foreach ($candidates as $package) {
- if ($name === $package->getName()) {
- $pkgConstraint = new Constraint('==', $package->getVersion());
- if (null === $constraint || $constraint->matches($pkgConstraint)) {
- $packages[] = $package;
- }
- }
- }
- break;
- }
- }
- return $packages;
- }
- public function getPackages()
- {
- if ($this->hasProviders()) {
- throw new \LogicException('Composer repositories that have providers can not load the complete list of packages, use getProviderNames instead.');
- }
- return parent::getPackages();
- }
- public function search($query, $mode = 0)
- {
- $this->loadRootServerFile();
- if ($this->searchUrl && $mode === self::SEARCH_FULLTEXT) {
- $url = str_replace('%query%', $query, $this->searchUrl);
- $hostname = parse_url($url, PHP_URL_HOST) ?: $url;
- $json = $this->rfs->getContents($hostname, $url, false);
- $results = JsonFile::parseJson($json, $url);
- return $results['results'];
- }
- if ($this->hasProviders()) {
- $results = array();
- $regex = '{(?:'.implode('|', preg_split('{\s+}', $query)).')}i';
- foreach ($this->getProviderNames() as $name) {
- if (preg_match($regex, $name)) {
- $results[] = array('name' => $name);
- }
- }
- return $results;
- }
- return parent::search($query, $mode);
- }
- public function getProviderNames()
- {
- $this->loadRootServerFile();
- if (null === $this->providerListing) {
- $this->loadProviderListings($this->loadRootServerFile());
- }
- if ($this->lazyProvidersUrl) {
- return array();
- }
- if ($this->providersUrl) {
- return array_keys($this->providerListing);
- }
- return array();
- }
- protected function configurePackageTransportOptions(PackageInterface $package)
- {
- foreach ($package->getDistUrls() as $url) {
- if (strpos($url, $this->baseUrl) === 0) {
- $package->setTransportOptions($this->options);
- return;
- }
- }
- }
- public function hasProviders()
- {
- $this->loadRootServerFile();
- return $this->hasProviders;
- }
- public function resetPackageIds()
- {
- foreach ($this->providersByUid as $package) {
- if ($package instanceof AliasPackage) {
- $package->getAliasOf()->setId(-1);
- }
- $package->setId(-1);
- }
- }
- public function whatProvides(Pool $pool, $name)
- {
- if (isset($this->providers[$name])) {
- return $this->providers[$name];
- }
- if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $name) || '__root__' === $name) {
- return array();
- }
- if (null === $this->providerListing) {
- $this->loadProviderListings($this->loadRootServerFile());
- }
- $useLastModifiedCheck = false;
- if ($this->lazyProvidersUrl && !isset($this->providerListing[$name])) {
- $hash = null;
- $url = str_replace('%package%', $name, $this->lazyProvidersUrl);
- $cacheKey = 'provider-'.strtr($name, '/', '$').'.json';
- $useLastModifiedCheck = true;
- } elseif ($this->providersUrl) {
- if (!isset($this->providerListing[$name])) {
- return array();
- }
- $hash = $this->providerListing[$name]['sha256'];
- $url = str_replace(array('%package%', '%hash%'), array($name, $hash), $this->providersUrl);
- $cacheKey = 'provider-'.strtr($name, '/', '$').'.json';
- } else {
- return array();
- }
- $packages = null;
- if ($cacheKey) {
- if (!$useLastModifiedCheck && $hash && $this->cache->sha256($cacheKey) === $hash) {
- $packages = json_decode($this->cache->read($cacheKey), true);
- } elseif ($useLastModifiedCheck) {
- if ($contents = $this->cache->read($cacheKey)) {
- $contents = json_decode($contents, true);
- if (isset($contents['last-modified'])) {
- $response = $this->fetchFileIfLastModified($url, $cacheKey, $contents['last-modified']);
- if (true === $response) {
- $packages = $contents;
- } elseif ($response) {
- $packages = $response;
- }
- }
- }
- }
- }
- if (!$packages) {
- try {
- $packages = $this->fetchFile($url, $cacheKey, $hash, $useLastModifiedCheck);
- } catch (TransportException $e) {
- if ($e->getStatusCode() === 404 && $this->lazyProvidersUrl) {
- $packages = array('packages' => array());
- } else {
- throw $e;
- }
- }
- }
- $this->providers[$name] = array();
- foreach ($packages['packages'] as $versions) {
- foreach ($versions as $version) {
- if (isset($this->providersByUid[$version['uid']])) {
- if (!isset($this->providers[$name][$version['uid']])) {
- if ($this->providersByUid[$version['uid']] instanceof AliasPackage) {
- $this->providers[$name][$version['uid']] = $this->providersByUid[$version['uid']]->getAliasOf();
- $this->providers[$name][$version['uid'].'-alias'] = $this->providersByUid[$version['uid']];
- } else {
- $this->providers[$name][$version['uid']] = $this->providersByUid[$version['uid']];
- }
- if (isset($this->providersByUid[$version['uid'].'-root'])) {
- $this->providers[$name][$version['uid'].'-root'] = $this->providersByUid[$version['uid'].'-root'];
- }
- }
- } else {
- if (!$pool->isPackageAcceptable(strtolower($version['name']), VersionParser::parseStability($version['version']))) {
- continue;
- }
- $package = $this->createPackage($version, 'Composer\Package\Package');
- $package->setRepository($this);
- if ($package instanceof AliasPackage) {
- $aliased = $package->getAliasOf();
- $aliased->setRepository($this);
- $this->providers[$name][$version['uid']] = $aliased;
- $this->providers[$name][$version['uid'].'-alias'] = $package;
- $this->providersByUid[$version['uid']] = $package;
- } else {
- $this->providers[$name][$version['uid']] = $package;
- $this->providersByUid[$version['uid']] = $package;
- }
- unset($rootAliasData);
- if (isset($this->rootAliases[$package->getName()][$package->getVersion()])) {
- $rootAliasData = $this->rootAliases[$package->getName()][$package->getVersion()];
- } elseif ($package instanceof AliasPackage && isset($this->rootAliases[$package->getName()][$package->getAliasOf()->getVersion()])) {
- $rootAliasData = $this->rootAliases[$package->getName()][$package->getAliasOf()->getVersion()];
- }
- if (isset($rootAliasData)) {
- $alias = $this->createAliasPackage($package, $rootAliasData['alias_normalized'], $rootAliasData['alias']);
- $alias->setRepository($this);
- $this->providers[$name][$version['uid'].'-root'] = $alias;
- $this->providersByUid[$version['uid'].'-root'] = $alias;
- }
- }
- }
- }
- return $this->providers[$name];
- }
- protected function initialize()
- {
- parent::initialize();
- $repoData = $this->loadDataFromServer();
- foreach ($repoData as $package) {
- $this->addPackage($this->createPackage($package, 'Composer\Package\CompletePackage'));
- }
- }
- public function addPackage(PackageInterface $package)
- {
- parent::addPackage($package);
- $this->configurePackageTransportOptions($package);
- }
- protected function loadRootServerFile()
- {
- if (null !== $this->rootData) {
- return $this->rootData;
- }
- if (!extension_loaded('openssl') && 'https' === substr($this->url, 0, 5)) {
- throw new \RuntimeException('You must enable the openssl extension in your php.ini to load information from '.$this->url);
- }
- $jsonUrlParts = parse_url($this->url);
- if (isset($jsonUrlParts['path']) && false !== strpos($jsonUrlParts['path'], '.json')) {
- $jsonUrl = $this->url;
- } else {
- $jsonUrl = $this->url . '/packages.json';
- }
- $data = $this->fetchFile($jsonUrl, 'packages.json');
- if (!empty($data['notify-batch'])) {
- $this->notifyUrl = $this->canonicalizeUrl($data['notify-batch']);
- } elseif (!empty($data['notify'])) {
- $this->notifyUrl = $this->canonicalizeUrl($data['notify']);
- }
- if (!empty($data['search'])) {
- $this->searchUrl = $this->canonicalizeUrl($data['search']);
- }
- if (!empty($data['mirrors'])) {
- foreach ($data['mirrors'] as $mirror) {
- if (!empty($mirror['git-url'])) {
- $this->sourceMirrors['git'][] = array('url' => $mirror['git-url'], 'preferred' => !empty($mirror['preferred']));
- }
- if (!empty($mirror['hg-url'])) {
- $this->sourceMirrors['hg'][] = array('url' => $mirror['hg-url'], 'preferred' => !empty($mirror['preferred']));
- }
- if (!empty($mirror['dist-url'])) {
- $this->distMirrors[] = array('url' => $mirror['dist-url'], 'preferred' => !empty($mirror['preferred']));
- }
- }
- }
- if (!empty($data['warning'])) {
- $this->io->writeError('<warning>Warning from '.$this->url.': '.$data['warning'].'</warning>');
- }
- if (!empty($data['providers-lazy-url'])) {
- $this->lazyProvidersUrl = $this->canonicalizeUrl($data['providers-lazy-url']);
- $this->hasProviders = true;
- }
- if ($this->allowSslDowngrade) {
- $this->url = str_replace('https://', 'http://', $this->url);
- $this->baseUrl = str_replace('https://', 'http://', $this->baseUrl);
- }
- if (!empty($data['providers-url'])) {
- $this->providersUrl = $this->canonicalizeUrl($data['providers-url']);
- $this->hasProviders = true;
- }
- if (!empty($data['providers']) || !empty($data['providers-includes'])) {
- $this->hasProviders = true;
- }
- if (preg_match('{^https?://packagist.org/?$}i', $this->url) && !empty($this->repoConfig['force-lazy-providers'])) {
- $this->url = 'https://packagist.org';
- $this->baseUrl = 'https://packagist.org';
- $this->lazyProvidersUrl = $this->canonicalizeUrl('https://packagist.org/p/%package%.json');
- $this->providersUrl = null;
- } elseif (!empty($this->repoConfig['force-lazy-providers'])) {
- $this->lazyProvidersUrl = $this->canonicalizeUrl('/p/%package%.json');
- $this->providersUrl = null;
- }
- return $this->rootData = $data;
- }
- protected function canonicalizeUrl($url)
- {
- if ('/' === $url[0]) {
- return preg_replace('{(https?://[^/]+).*}i', '$1' . $url, $this->url);
- }
- return $url;
- }
- protected function loadDataFromServer()
- {
- $data = $this->loadRootServerFile();
- return $this->loadIncludes($data);
- }
- protected function loadProviderListings($data)
- {
- if (isset($data['providers'])) {
- if (!is_array($this->providerListing)) {
- $this->providerListing = array();
- }
- $this->providerListing = array_merge($this->providerListing, $data['providers']);
- }
- if ($this->providersUrl && isset($data['provider-includes'])) {
- $includes = $data['provider-includes'];
- foreach ($includes as $include => $metadata) {
- $url = $this->baseUrl . '/' . str_replace('%hash%', $metadata['sha256'], $include);
- $cacheKey = str_replace(array('%hash%','$'), '', $include);
- if ($this->cache->sha256($cacheKey) === $metadata['sha256']) {
- $includedData = json_decode($this->cache->read($cacheKey), true);
- } else {
- $includedData = $this->fetchFile($url, $cacheKey, $metadata['sha256']);
- }
- $this->loadProviderListings($includedData);
- }
- }
- }
- protected function loadIncludes($data)
- {
- $packages = array();
- if (!isset($data['packages']) && !isset($data['includes'])) {
- foreach ($data as $pkg) {
- foreach ($pkg['versions'] as $metadata) {
- $packages[] = $metadata;
- }
- }
- return $packages;
- }
- if (isset($data['packages'])) {
- foreach ($data['packages'] as $package => $versions) {
- foreach ($versions as $version => $metadata) {
- $packages[] = $metadata;
- }
- }
- }
- if (isset($data['includes'])) {
- foreach ($data['includes'] as $include => $metadata) {
- if ($this->cache->sha1($include) === $metadata['sha1']) {
- $includedData = json_decode($this->cache->read($include), true);
- } else {
- $includedData = $this->fetchFile($include);
- }
- $packages = array_merge($packages, $this->loadIncludes($includedData));
- }
- }
- return $packages;
- }
- protected function createPackage(array $data, $class)
- {
- try {
- if (!isset($data['notification-url'])) {
- $data['notification-url'] = $this->notifyUrl;
- }
- $package = $this->loader->load($data, 'Composer\Package\CompletePackage');
- if (isset($this->sourceMirrors[$package->getSourceType()])) {
- $package->setSourceMirrors($this->sourceMirrors[$package->getSourceType()]);
- }
- $package->setDistMirrors($this->distMirrors);
- $this->configurePackageTransportOptions($package);
- return $package;
- } catch (\Exception $e) {
- throw new \RuntimeException('Could not load package '.(isset($data['name']) ? $data['name'] : json_encode($data)).' in '.$this->url.': ['.get_class($e).'] '.$e->getMessage(), 0, $e);
- }
- }
- protected function fetchFile($filename, $cacheKey = null, $sha256 = null, $storeLastModifiedTime = false)
- {
- if (null === $cacheKey) {
- $cacheKey = $filename;
- $filename = $this->baseUrl.'/'.$filename;
- }
- if (($pos = strpos($filename, '$')) && preg_match('{^https?://.*}i', $filename)) {
- $filename = substr($filename, 0, $pos) . '%24' . substr($filename, $pos + 1);
- }
- $retries = 3;
- while ($retries--) {
- try {
- $preFileDownloadEvent = new PreFileDownloadEvent(PluginEvents::PRE_FILE_DOWNLOAD, $this->rfs, $filename);
- if ($this->eventDispatcher) {
- $this->eventDispatcher->dispatch($preFileDownloadEvent->getName(), $preFileDownloadEvent);
- }
- $hostname = parse_url($filename, PHP_URL_HOST) ?: $filename;
- $rfs = $preFileDownloadEvent->getRemoteFilesystem();
- $json = $rfs->getContents($hostname, $filename, false);
- if ($sha256 && $sha256 !== hash('sha256', $json)) {
- if ($retries) {
- usleep(100000);
- continue;
- }
- throw new RepositorySecurityException('The contents of '.$filename.' do not match its signature. This should indicate a man-in-the-middle attack. Try running composer again and report this if you think it is a mistake.');
- }
- $data = JsonFile::parseJson($json, $filename);
- if ($cacheKey) {
- if ($storeLastModifiedTime) {
- $lastModifiedDate = $rfs->findHeaderValue($rfs->getLastHeaders(), 'last-modified');
- if ($lastModifiedDate) {
- $data['last-modified'] = $lastModifiedDate;
- $json = json_encode($data);
- }
- }
- $this->cache->write($cacheKey, $json);
- }
- break;
- } catch (\Exception $e) {
- if ($e instanceof TransportException && $e->getStatusCode() === 404) {
- throw $e;
- }
- if ($retries) {
- usleep(100000);
- continue;
- }
- if ($e instanceof RepositorySecurityException) {
- throw $e;
- }
- if ($cacheKey && ($contents = $this->cache->read($cacheKey))) {
- if (!$this->degradedMode) {
- $this->io->writeError('<warning>'.$e->getMessage().'</warning>');
- $this->io->writeError('<warning>'.$this->url.' could not be fully loaded, package information was loaded from the local cache and may be out of date</warning>');
- }
- $this->degradedMode = true;
- $data = JsonFile::parseJson($contents, $this->cache->getRoot().$cacheKey);
- break;
- }
- throw $e;
- }
- }
- return $data;
- }
- protected function fetchFileIfLastModified($filename, $cacheKey, $lastModifiedTime)
- {
- $retries = 3;
- while ($retries--) {
- try {
- $preFileDownloadEvent = new PreFileDownloadEvent(PluginEvents::PRE_FILE_DOWNLOAD, $this->rfs, $filename);
- if ($this->eventDispatcher) {
- $this->eventDispatcher->dispatch($preFileDownloadEvent->getName(), $preFileDownloadEvent);
- }
- $hostname = parse_url($filename, PHP_URL_HOST) ?: $filename;
- $rfs = $preFileDownloadEvent->getRemoteFilesystem();
- $options = array('http' => array('header' => array('If-Modified-Since: '.$lastModifiedTime)));
- $json = $rfs->getContents($hostname, $filename, false, $options);
- if ($json === '' && $rfs->findStatusCode($rfs->getLastHeaders()) === 304) {
- return true;
- }
- $data = JsonFile::parseJson($json, $filename);
- $lastModifiedDate = $rfs->findHeaderValue($rfs->getLastHeaders(), 'last-modified');
- if ($lastModifiedDate) {
- $data['last-modified'] = $lastModifiedDate;
- $json = json_encode($data);
- }
- $this->cache->write($cacheKey, $json);
- return $data;
- } catch (\Exception $e) {
- if ($e instanceof TransportException && $e->getStatusCode() === 404) {
- throw $e;
- }
- if ($retries) {
- usleep(100000);
- continue;
- }
- if (!$this->degradedMode) {
- $this->io->writeError('<warning>'.$e->getMessage().'</warning>');
- $this->io->writeError('<warning>'.$this->url.' could not be fully loaded, package information was loaded from the local cache and may be out of date</warning>');
- }
- $this->degradedMode = true;
- return true;
- }
- }
- }
- }
- <?php
- namespace Composer\Repository;
- use Composer\Package\PackageInterface;
- class CompositeRepository extends BaseRepository
- {
- private $repositories;
- public function __construct(array $repositories)
- {
- $this->repositories = array();
- foreach ($repositories as $repo) {
- $this->addRepository($repo);
- }
- }
- public function getRepositories()
- {
- return $this->repositories;
- }
- public function hasPackage(PackageInterface $package)
- {
- foreach ($this->repositories as $repository) {
- if ($repository->hasPackage($package)) {
- return true;
- }
- }
- return false;
- }
- public function findPackage($name, $constraint)
- {
- foreach ($this->repositories as $repository) {
- $package = $repository->findPackage($name, $constraint);
- if (null !== $package) {
- return $package;
- }
- }
- return null;
- }
- public function findPackages($name, $constraint = null)
- {
- $packages = array();
- foreach ($this->repositories as $repository) {
- $packages[] = $repository->findPackages($name, $constraint);
- }
- return $packages ? call_user_func_array('array_merge', $packages) : array();
- }
- public function search($query, $mode = 0)
- {
- $matches = array();
- foreach ($this->repositories as $repository) {
- $matches[] = $repository->search($query, $mode);
- }
- return $matches ? call_user_func_array('array_merge', $matches) : array();
- }
- public function getPackages()
- {
- $packages = array();
- foreach ($this->repositories as $repository) {
- $packages[] = $repository->getPackages();
- }
- return $packages ? call_user_func_array('array_merge', $packages) : array();
- }
- public function removePackage(PackageInterface $package)
- {
- foreach ($this->repositories as $repository) {
- $repository->removePackage($package);
- }
- }
- public function count()
- {
- $total = 0;
- foreach ($this->repositories as $repository) {
- $total += $repository->count();
- }
- return $total;
- }
- public function addRepository(RepositoryInterface $repository)
- {
- if ($repository instanceof self) {
- foreach ($repository->getRepositories() as $repo) {
- $this->addRepository($repo);
- }
- } else {
- $this->repositories[] = $repository;
- }
- }
- }
- <?php
- namespace Composer\Repository;
- interface ConfigurableRepositoryInterface
- {
- public function getRepoConfig();
- }
- <?php
- namespace Composer\Repository;
- use Composer\Json\JsonFile;
- use Composer\Package\Loader\ArrayLoader;
- use Composer\Package\Dumper\ArrayDumper;
- class FilesystemRepository extends WritableArrayRepository
- {
- private $file;
- public function __construct(JsonFile $repositoryFile)
- {
- $this->file = $repositoryFile;
- }
- protected function initialize()
- {
- parent::initialize();
- if (!$this->file->exists()) {
- return;
- }
- try {
- $packages = $this->file->read();
- if (!is_array($packages)) {
- throw new \UnexpectedValueException('Could not parse package list from the repository');
- }
- } catch (\Exception $e) {
- throw new InvalidRepositoryException('Invalid repository data in '.$this->file->getPath().', packages could not be loaded: ['.get_class($e).'] '.$e->getMessage());
- }
- $loader = new ArrayLoader(null, true);
- foreach ($packages as $packageData) {
- $package = $loader->load($packageData);
- $this->addPackage($package);
- }
- }
- public function reload()
- {
- $this->packages = null;
- $this->initialize();
- }
- public function write()
- {
- $data = array();
- $dumper = new ArrayDumper();
- foreach ($this->getCanonicalPackages() as $package) {
- $data[] = $dumper->dump($package);
- }
- $this->file->write($data);
- }
- }
- <?php
- namespace Composer\Repository;
- class InstalledArrayRepository extends WritableArrayRepository implements InstalledRepositoryInterface
- {
- }
- <?php
- namespace Composer\Repository;
- class InstalledFilesystemRepository extends FilesystemRepository implements InstalledRepositoryInterface
- {
- }
- <?php
- namespace Composer\Repository;
- interface InstalledRepositoryInterface extends WritableRepositoryInterface
- {
- }
- <?php
- namespace Composer\Repository;
- class InvalidRepositoryException extends \Exception
- {
- }
- <?php
- namespace Composer\Repository;
- use Composer\Package\Loader\ArrayLoader;
- use Composer\Package\Loader\ValidatingArrayLoader;
- class PackageRepository extends ArrayRepository
- {
- private $config;
- public function __construct(array $config)
- {
- $this->config = $config['package'];
- if (!is_numeric(key($this->config))) {
- $this->config = array($this->config);
- }
- }
- protected function initialize()
- {
- parent::initialize();
- $loader = new ValidatingArrayLoader(new ArrayLoader, false);
- foreach ($this->config as $package) {
- try {
- $package = $loader->load($package);
- } catch (\Exception $e) {
- throw new InvalidRepositoryException('A repository of type "package" contains an invalid package definition: '.$e->getMessage()."\n\nInvalid package definition:\n".json_encode($package));
- }
- $this->addPackage($package);
- }
- }
- }
- <?php
- namespace Composer\Repository;
- use Composer\Config;
- use Composer\IO\IOInterface;
- use Composer\Json\JsonFile;
- use Composer\Package\Loader\ArrayLoader;
- use Composer\Package\Locker;
- use Composer\Package\Version\VersionGuesser;
- use Composer\Package\Version\VersionParser;
- use Composer\Util\ProcessExecutor;
- class PathRepository extends ArrayRepository implements ConfigurableRepositoryInterface
- {
- private $loader;
- private $versionGuesser;
- private $url;
- private $repoConfig;
- private $process;
- public function __construct(array $repoConfig, IOInterface $io, Config $config)
- {
- if (!isset($repoConfig['url'])) {
- throw new \RuntimeException('You must specify the `url` configuration for the path repository');
- }
- $this->loader = new ArrayLoader();
- $this->url = $repoConfig['url'];
- $this->process = new ProcessExecutor($io);
- $this->versionGuesser = new VersionGuesser($config, $this->process, new VersionParser());
- $this->repoConfig = $repoConfig;
- parent::__construct();
- }
- public function getRepoConfig()
- {
- return $this->repoConfig;
- }
- protected function initialize()
- {
- parent::initialize();
- foreach ($this->getUrlMatches() as $url) {
- $path = realpath($url) . DIRECTORY_SEPARATOR;
- $composerFilePath = $path.'composer.json';
- if (!file_exists($composerFilePath)) {
- continue;
- }
- $json = file_get_contents($composerFilePath);
- $package = JsonFile::parseJson($json, $composerFilePath);
- $package['dist'] = array(
- 'type' => 'path',
- 'url' => $url,
- 'reference' => sha1($json),
- );
- if (!isset($package['version'])) {
- $package['version'] = $this->versionGuesser->guessVersion($package, $path) ?: 'dev-master';
- }
- $output = '';
- if (is_dir($path . DIRECTORY_SEPARATOR . '.git') && 0 === $this->process->execute('git log -n1 --pretty=%H', $output, $path)) {
- $package['dist']['reference'] = trim($output);
- }
- $package = $this->loader->load($package);
- $this->addPackage($package);
- }
- }
- private function getUrlMatches()
- {
- return array_map(function ($val) {
- return str_replace(DIRECTORY_SEPARATOR, '/', $val);
- }, glob($this->url, GLOB_MARK | GLOB_ONLYDIR));
- }
- }
- <?php
- namespace Composer\Repository\Pear;
- use Composer\Util\RemoteFilesystem;
- abstract class BaseChannelReader
- {
- const CHANNEL_NS = 'http://pear.php.net/channel-1.0';
- const ALL_CATEGORIES_NS = 'http://pear.php.net/dtd/rest.allcategories';
- const CATEGORY_PACKAGES_INFO_NS = 'http://pear.php.net/dtd/rest.categorypackageinfo';
- const ALL_PACKAGES_NS = 'http://pear.php.net/dtd/rest.allpackages';
- const ALL_RELEASES_NS = 'http://pear.php.net/dtd/rest.allreleases';
- const PACKAGE_INFO_NS = 'http://pear.php.net/dtd/rest.package';
- private $rfs;
- protected function __construct(RemoteFilesystem $rfs)
- {
- $this->rfs = $rfs;
- }
- protected function requestContent($origin, $path)
- {
- $url = rtrim($origin, '/') . '/' . ltrim($path, '/');
- $content = $this->rfs->getContents($origin, $url, false);
- if (!$content) {
- throw new \UnexpectedValueException('The PEAR channel at ' . $url . ' did not respond.');
- }
- return $content;
- }
- protected function requestXml($origin, $path)
- {
- $xml = simplexml_load_string($this->requestContent($origin, $path), "SimpleXMLElement", LIBXML_NOERROR);
- if (false == $xml) {
- $url = rtrim($origin, '/') . '/' . ltrim($path, '/');
- throw new \UnexpectedValueException(sprintf('The PEAR channel at ' . $origin . ' is broken. (Invalid XML at file `%s`)', $path));
- }
- return $xml;
- }
- }
- <?php
- namespace Composer\Repository\Pear;
- class ChannelInfo
- {
- private $name;
- private $alias;
- private $packages;
- public function __construct($name, $alias, array $packages)
- {
- $this->name = $name;
- $this->alias = $alias;
- $this->packages = $packages;
- }
- public function getName()
- {
- return $this->name;
- }
- public function getAlias()
- {
- return $this->alias;
- }
- public function getPackages()
- {
- return $this->packages;
- }
- }
- <?php
- namespace Composer\Repository\Pear;
- use Composer\Util\RemoteFilesystem;
- class ChannelReader extends BaseChannelReader
- {
- private $readerMap;
- public function __construct(RemoteFilesystem $rfs)
- {
- parent::__construct($rfs);
- $rest10reader = new ChannelRest10Reader($rfs);
- $rest11reader = new ChannelRest11Reader($rfs);
- $this->readerMap = array(
- 'REST1.3' => $rest11reader,
- 'REST1.2' => $rest11reader,
- 'REST1.1' => $rest11reader,
- 'REST1.0' => $rest10reader,
- );
- }
- public function read($url)
- {
- $xml = $this->requestXml($url, "/channel.xml");
- $channelName = (string) $xml->name;
- $channelSummary = (string) $xml->summary;
- $channelAlias = (string) $xml->suggestedalias;
- $supportedVersions = array_keys($this->readerMap);
- $selectedRestVersion = $this->selectRestVersion($xml, $supportedVersions);
- if (!$selectedRestVersion) {
- throw new \UnexpectedValueException(sprintf('PEAR repository %s does not supports any of %s protocols.', $url, implode(', ', $supportedVersions)));
- }
- $reader = $this->readerMap[$selectedRestVersion['version']];
- $packageDefinitions = $reader->read($selectedRestVersion['baseUrl']);
- return new ChannelInfo($channelName, $channelAlias, $packageDefinitions);
- }
- private function selectRestVersion($channelXml, $supportedVersions)
- {
- $channelXml->registerXPathNamespace('ns', self::CHANNEL_NS);
- foreach ($supportedVersions as $version) {
- $xpathTest = "ns:servers/ns:primary/ns:rest/ns:baseurl[@type='{$version}']";
- $testResult = $channelXml->xpath($xpathTest);
- if (count($testResult) > 0) {
- return array('version' => $version, 'baseUrl' => (string) $testResult[0]);
- }
- }
- return null;
- }
- }
- <?php
- namespace Composer\Repository\Pear;
- use Composer\Downloader\TransportException;
- class ChannelRest10Reader extends BaseChannelReader
- {
- private $dependencyReader;
- public function __construct($rfs)
- {
- parent::__construct($rfs);
- $this->dependencyReader = new PackageDependencyParser();
- }
- public function read($baseUrl)
- {
- return $this->readPackages($baseUrl);
- }
- private function readPackages($baseUrl)
- {
- $result = array();
- $xmlPath = '/p/packages.xml';
- $xml = $this->requestXml($baseUrl, $xmlPath);
- $xml->registerXPathNamespace('ns', self::ALL_PACKAGES_NS);
- foreach ($xml->xpath('ns:p') as $node) {
- $packageName = (string) $node;
- $packageInfo = $this->readPackage($baseUrl, $packageName);
- $result[] = $packageInfo;
- }
- return $result;
- }
- private function readPackage($baseUrl, $packageName)
- {
- $xmlPath = '/p/' . strtolower($packageName) . '/info.xml';
- $xml = $this->requestXml($baseUrl, $xmlPath);
- $xml->registerXPathNamespace('ns', self::PACKAGE_INFO_NS);
- $channelName = (string) $xml->c;
- $packageName = (string) $xml->n;
- $license = (string) $xml->l;
- $shortDescription = (string) $xml->s;
- $description = (string) $xml->d;
- return new PackageInfo(
- $channelName,
- $packageName,
- $license,
- $shortDescription,
- $description,
- $this->readPackageReleases($baseUrl, $packageName)
- );
- }
- private function readPackageReleases($baseUrl, $packageName)
- {
- $result = array();
- try {
- $xmlPath = '/r/' . strtolower($packageName) . '/allreleases.xml';
- $xml = $this->requestXml($baseUrl, $xmlPath);
- $xml->registerXPathNamespace('ns', self::ALL_RELEASES_NS);
- foreach ($xml->xpath('ns:r') as $node) {
- $releaseVersion = (string) $node->v;
- $releaseStability = (string) $node->s;
- try {
- $result[$releaseVersion] = new ReleaseInfo(
- $releaseStability,
- $this->readPackageReleaseDependencies($baseUrl, $packageName, $releaseVersion)
- );
- } catch (TransportException $exception) {
- if ($exception->getCode() != 404) {
- throw $exception;
- }
- }
- }
- } catch (TransportException $exception) {
- if ($exception->getCode() != 404) {
- throw $exception;
- }
- }
- return $result;
- }
- private function readPackageReleaseDependencies($baseUrl, $packageName, $version)
- {
- $dependencyReader = new PackageDependencyParser();
- $depthPath = '/r/' . strtolower($packageName) . '/deps.' . $version . '.txt';
- $content = $this->requestContent($baseUrl, $depthPath);
- $dependencyArray = unserialize($content);
- $result = $dependencyReader->buildDependencyInfo($dependencyArray);
- return $result;
- }
- }
- <?php
- namespace Composer\Repository\Pear;
- class ChannelRest11Reader extends BaseChannelReader
- {
- private $dependencyReader;
- public function __construct($rfs)
- {
- parent::__construct($rfs);
- $this->dependencyReader = new PackageDependencyParser();
- }
- public function read($baseUrl)
- {
- return $this->readChannelPackages($baseUrl);
- }
- private function readChannelPackages($baseUrl)
- {
- $result = array();
- $xml = $this->requestXml($baseUrl, "/c/categories.xml");
- $xml->registerXPathNamespace('ns', self::ALL_CATEGORIES_NS);
- foreach ($xml->xpath('ns:c') as $node) {
- $categoryName = (string) $node;
- $categoryPackages = $this->readCategoryPackages($baseUrl, $categoryName);
- $result = array_merge($result, $categoryPackages);
- }
- return $result;
- }
- private function readCategoryPackages($baseUrl, $categoryName)
- {
- $result = array();
- $categoryPath = '/c/'.urlencode($categoryName).'/packagesinfo.xml';
- $xml = $this->requestXml($baseUrl, $categoryPath);
- $xml->registerXPathNamespace('ns', self::CATEGORY_PACKAGES_INFO_NS);
- foreach ($xml->xpath('ns:pi') as $node) {
- $packageInfo = $this->parsePackage($node);
- $result[] = $packageInfo;
- }
- return $result;
- }
- private function parsePackage($packageInfo)
- {
- $packageInfo->registerXPathNamespace('ns', self::CATEGORY_PACKAGES_INFO_NS);
- $channelName = (string) $packageInfo->p->c;
- $packageName = (string) $packageInfo->p->n;
- $license = (string) $packageInfo->p->l;
- $shortDescription = (string) $packageInfo->p->s;
- $description = (string) $packageInfo->p->d;
- $dependencies = array();
- foreach ($packageInfo->xpath('ns:deps') as $node) {
- $dependencyVersion = (string) $node->v;
- $dependencyArray = unserialize((string) $node->d);
- $dependencyInfo = $this->dependencyReader->buildDependencyInfo($dependencyArray);
- $dependencies[$dependencyVersion] = $dependencyInfo;
- }
- $releases = array();
- $releasesInfo = $packageInfo->xpath('ns:a/ns:r');
- if ($releasesInfo) {
- foreach ($releasesInfo as $node) {
- $releaseVersion = (string) $node->v;
- $releaseStability = (string) $node->s;
- $releases[$releaseVersion] = new ReleaseInfo(
- $releaseStability,
- isset($dependencies[$releaseVersion]) ? $dependencies[$releaseVersion] : new DependencyInfo(array(), array())
- );
- }
- }
- return new PackageInfo(
- $channelName,
- $packageName,
- $license,
- $shortDescription,
- $description,
- $releases
- );
- }
- }
- <?php
- namespace Composer\Repository\Pear;
- class DependencyConstraint
- {
- private $type;
- private $constraint;
- private $channelName;
- private $packageName;
- public function __construct($type, $constraint, $channelName, $packageName)
- {
- $this->type = $type;
- $this->constraint = $constraint;
- $this->channelName = $channelName;
- $this->packageName = $packageName;
- }
- public function getChannelName()
- {
- return $this->channelName;
- }
- public function getConstraint()
- {
- return $this->constraint;
- }
- public function getPackageName()
- {
- return $this->packageName;
- }
- public function getType()
- {
- return $this->type;
- }
- }
- <?php
- namespace Composer\Repository\Pear;
- class DependencyInfo
- {
- private $requires;
- private $optionals;
- public function __construct($requires, $optionals)
- {
- $this->requires = $requires;
- $this->optionals = $optionals;
- }
- public function getRequires()
- {
- return $this->requires;
- }
- public function getOptionals()
- {
- return $this->optionals;
- }
- }
- <?php
- namespace Composer\Repository\Pear;
- class PackageDependencyParser
- {
- public function buildDependencyInfo($depArray)
- {
- if (!is_array($depArray)) {
- return new DependencyInfo(array(), array());
- }
- if (!$this->isHash($depArray)) {
- return new DependencyInfo($this->buildDependency10Info($depArray), array());
- }
- return $this->buildDependency20Info($depArray);
- }
- private function buildDependency10Info($depArray)
- {
- static $dep10toOperatorMap = array('has' => '==', 'eq' => '==', 'ge' => '>=', 'gt' => '>', 'le' => '<=', 'lt' => '<', 'not' => '!=');
- $result = array();
- foreach ($depArray as $depItem) {
- if (empty($depItem['rel']) || !array_key_exists($depItem['rel'], $dep10toOperatorMap)) {
- continue;
- }
- $depType = !empty($depItem['optional']) && 'yes' == $depItem['optional']
- ? 'optional'
- : 'required';
- $depType = 'not' == $depItem['rel']
- ? 'conflicts'
- : $depType;
- $depVersion = !empty($depItem['version']) ? $this->parseVersion($depItem['version']) : '*';
- $depVersionConstraint = ('has' == $depItem['rel'] || 'not' == $depItem['rel']) && '*' == $depVersion
- ? '*'
- : $dep10toOperatorMap[$depItem['rel']] . $depVersion;
- switch ($depItem['type']) {
- case 'php':
- $depChannelName = 'php';
- $depPackageName = '';
- break;
- case 'pkg':
- $depChannelName = !empty($depItem['channel']) ? $depItem['channel'] : 'pear.php.net';
- $depPackageName = $depItem['name'];
- break;
- case 'ext':
- $depChannelName = 'ext';
- $depPackageName = $depItem['name'];
- break;
- case 'os':
- case 'sapi':
- $depChannelName = '';
- $depPackageName = '';
- break;
- default:
- $depChannelName = '';
- $depPackageName = '';
- break;
- }
- if ('' != $depChannelName) {
- $result[] = new DependencyConstraint(
- $depType,
- $depVersionConstraint,
- $depChannelName,
- $depPackageName
- );
- }
- }
- return $result;
- }
- private function buildDependency20Info($depArray)
- {
- $result = array();
- $optionals = array();
- $defaultOptionals = array();
- foreach ($depArray as $depType => $depTypeGroup) {
- if (!is_array($depTypeGroup)) {
- continue;
- }
- if ('required' == $depType || 'optional' == $depType) {
- foreach ($depTypeGroup as $depItemType => $depItem) {
- switch ($depItemType) {
- case 'php':
- $result[] = new DependencyConstraint(
- $depType,
- $this->parse20VersionConstraint($depItem),
- 'php',
- ''
- );
- break;
- case 'package':
- $deps = $this->buildDepPackageConstraints($depItem, $depType);
- $result = array_merge($result, $deps);
- break;
- case 'extension':
- $deps = $this->buildDepExtensionConstraints($depItem, $depType);
- $result = array_merge($result, $deps);
- break;
- case 'subpackage':
- $deps = $this->buildDepPackageConstraints($depItem, 'replaces');
- $defaultOptionals += $deps;
- break;
- case 'os':
- case 'pearinstaller':
- break;
- default:
- break;
- }
- }
- } elseif ('group' == $depType) {
- if ($this->isHash($depTypeGroup)) {
- $depTypeGroup = array($depTypeGroup);
- }
- foreach ($depTypeGroup as $depItem) {
- $groupName = $depItem['attribs']['name'];
- if (!isset($optionals[$groupName])) {
- $optionals[$groupName] = array();
- }
- if (isset($depItem['subpackage'])) {
- $optionals[$groupName] += $this->buildDepPackageConstraints($depItem['subpackage'], 'replaces');
- } else {
- $result += $this->buildDepPackageConstraints($depItem['package'], 'optional');
- }
- }
- }
- }
- if (count($defaultOptionals) > 0) {
- $optionals['*'] = $defaultOptionals;
- }
- return new DependencyInfo($result, $optionals);
- }
- private function buildDepExtensionConstraints($depItem, $depType)
- {
- if ($this->isHash($depItem)) {
- $depItem = array($depItem);
- }
- $result = array();
- foreach ($depItem as $subDepItem) {
- $depChannelName = 'ext';
- $depPackageName = $subDepItem['name'];
- $depVersionConstraint = $this->parse20VersionConstraint($subDepItem);
- $result[] = new DependencyConstraint(
- $depType,
- $depVersionConstraint,
- $depChannelName,
- $depPackageName
- );
- }
- return $result;
- }
- private function buildDepPackageConstraints($depItem, $depType)
- {
- if ($this->isHash($depItem)) {
- $depItem = array($depItem);
- }
- $result = array();
- foreach ($depItem as $subDepItem) {
- $depChannelName = $subDepItem['channel'];
- $depPackageName = $subDepItem['name'];
- $depVersionConstraint = $this->parse20VersionConstraint($subDepItem);
- if (isset($subDepItem['conflicts'])) {
- $depType = 'conflicts';
- }
- $result[] = new DependencyConstraint(
- $depType,
- $depVersionConstraint,
- $depChannelName,
- $depPackageName
- );
- }
- return $result;
- }
- private function parse20VersionConstraint(array $data)
- {
- static $dep20toOperatorMap = array('has' => '==', 'min' => '>=', 'max' => '<=', 'exclude' => '!=');
- $versions = array();
- $values = array_intersect_key($data, $dep20toOperatorMap);
- if (0 == count($values)) {
- return '*';
- }
- if (isset($values['min']) && isset($values['exclude']) && $data['min'] == $data['exclude']) {
- $versions[] = '>' . $this->parseVersion($values['min']);
- } elseif (isset($values['max']) && isset($values['exclude']) && $data['max'] == $data['exclude']) {
- $versions[] = '<' . $this->parseVersion($values['max']);
- } else {
- foreach ($values as $op => $version) {
- if ('exclude' == $op && is_array($version)) {
- foreach ($version as $versionPart) {
- $versions[] = $dep20toOperatorMap[$op] . $this->parseVersion($versionPart);
- }
- } else {
- $versions[] = $dep20toOperatorMap[$op] . $this->parseVersion($version);
- }
- }
- }
- return implode(',', $versions);
- }
- private function parseVersion($version)
- {
- if (preg_match('{^v?(\d{1,3})(\.\d+)?(\.\d+)?(\.\d+)?}i', $version, $matches)) {
- $version = $matches[1]
- .(!empty($matches[2]) ? $matches[2] : '.0')
- .(!empty($matches[3]) ? $matches[3] : '.0')
- .(!empty($matches[4]) ? $matches[4] : '.0');
- return $version;
- }
- return null;
- }
- private function isHash(array $array)
- {
- return !array_key_exists(1, $array) && !array_key_exists(0, $array);
- }
- }
- <?php
- namespace Composer\Repository\Pear;
- class PackageInfo
- {
- private $channelName;
- private $packageName;
- private $license;
- private $shortDescription;
- private $description;
- private $releases;
- public function __construct($channelName, $packageName, $license, $shortDescription, $description, $releases)
- {
- $this->channelName = $channelName;
- $this->packageName = $packageName;
- $this->license = $license;
- $this->shortDescription = $shortDescription;
- $this->description = $description;
- $this->releases = $releases;
- }
- public function getChannelName()
- {
- return $this->channelName;
- }
- public function getPackageName()
- {
- return $this->packageName;
- }
- public function getDescription()
- {
- return $this->description;
- }
- public function getShortDescription()
- {
- return $this->shortDescription;
- }
- public function getLicense()
- {
- return $this->license;
- }
- public function getReleases()
- {
- return $this->releases;
- }
- }
- <?php
- namespace Composer\Repository\Pear;
- class ReleaseInfo
- {
- private $stability;
- private $dependencyInfo;
- public function __construct($stability, $dependencyInfo)
- {
- $this->stability = $stability;
- $this->dependencyInfo = $dependencyInfo;
- }
- public function getDependencyInfo()
- {
- return $this->dependencyInfo;
- }
- public function getStability()
- {
- return $this->stability;
- }
- }
- <?php
- namespace Composer\Repository;
- use Composer\IO\IOInterface;
- use Composer\Semver\VersionParser as SemverVersionParser;
- use Composer\Package\Version\VersionParser;
- use Composer\Repository\Pear\ChannelReader;
- use Composer\Package\CompletePackage;
- use Composer\Repository\Pear\ChannelInfo;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Package\Link;
- use Composer\Semver\Constraint\Constraint;
- use Composer\Util\RemoteFilesystem;
- use Composer\Config;
- use Composer\Factory;
- class PearRepository extends ArrayRepository implements ConfigurableRepositoryInterface
- {
- private $url;
- private $io;
- private $rfs;
- private $versionParser;
- private $repoConfig;
- private $vendorAlias;
- public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $dispatcher = null, RemoteFilesystem $rfs = null)
- {
- if (!preg_match('{^https?://}', $repoConfig['url'])) {
- $repoConfig['url'] = 'http://'.$repoConfig['url'];
- }
- $urlBits = parse_url($repoConfig['url']);
- if (empty($urlBits['scheme']) || empty($urlBits['host'])) {
- throw new \UnexpectedValueException('Invalid url given for PEAR repository: '.$repoConfig['url']);
- }
- $this->url = rtrim($repoConfig['url'], '/');
- $this->io = $io;
- $this->rfs = $rfs ?: Factory::createRemoteFilesystem($this->io, $config);
- $this->vendorAlias = isset($repoConfig['vendor-alias']) ? $repoConfig['vendor-alias'] : null;
- $this->versionParser = new VersionParser();
- $this->repoConfig = $repoConfig;
- }
- public function getRepoConfig()
- {
- return $this->repoConfig;
- }
- protected function initialize()
- {
- parent::initialize();
- $this->io->writeError('Initializing PEAR repository '.$this->url);
- $reader = new ChannelReader($this->rfs);
- try {
- $channelInfo = $reader->read($this->url);
- } catch (\Exception $e) {
- $this->io->writeError('<warning>PEAR repository from '.$this->url.' could not be loaded. '.$e->getMessage().'</warning>');
- return;
- }
- $packages = $this->buildComposerPackages($channelInfo, $this->versionParser);
- foreach ($packages as $package) {
- $this->addPackage($package);
- }
- }
- private function buildComposerPackages(ChannelInfo $channelInfo, SemverVersionParser $versionParser)
- {
- $result = array();
- foreach ($channelInfo->getPackages() as $packageDefinition) {
- foreach ($packageDefinition->getReleases() as $version => $releaseInfo) {
- try {
- $normalizedVersion = $versionParser->normalize($version);
- } catch (\UnexpectedValueException $e) {
- $this->io->writeError('Could not load '.$packageDefinition->getPackageName().' '.$version.': '.$e->getMessage(), true, IOInterface::VERBOSE);
- continue;
- }
- $composerPackageName = $this->buildComposerPackageName($packageDefinition->getChannelName(), $packageDefinition->getPackageName());
-
- $urlBits = parse_url($this->url);
- $scheme = (isset($urlBits['scheme']) && 'https' === $urlBits['scheme'] && extension_loaded('openssl')) ? 'https' : 'http';
- $distUrl = "{$scheme}://{$packageDefinition->getChannelName()}/get/{$packageDefinition->getPackageName()}-{$version}.tgz";
- $requires = array();
- $suggests = array();
- $conflicts = array();
- $replaces = array();
-
- if ($channelInfo->getName() == $packageDefinition->getChannelName()) {
- $composerPackageAlias = $this->buildComposerPackageName($channelInfo->getAlias(), $packageDefinition->getPackageName());
- $aliasConstraint = new Constraint('==', $normalizedVersion);
- $replaces[] = new Link($composerPackageName, $composerPackageAlias, $aliasConstraint, 'replaces', (string) $aliasConstraint);
- }
- if (!empty($this->vendorAlias)
- && ($this->vendorAlias != 'pear-'.$channelInfo->getAlias() || $channelInfo->getName() != $packageDefinition->getChannelName())
- ) {
- $composerPackageAlias = "{$this->vendorAlias}/{$packageDefinition->getPackageName()}";
- $aliasConstraint = new Constraint('==', $normalizedVersion);
- $replaces[] = new Link($composerPackageName, $composerPackageAlias, $aliasConstraint, 'replaces', (string) $aliasConstraint);
- }
- foreach ($releaseInfo->getDependencyInfo()->getRequires() as $dependencyConstraint) {
- $dependencyPackageName = $this->buildComposerPackageName($dependencyConstraint->getChannelName(), $dependencyConstraint->getPackageName());
- $constraint = $versionParser->parseConstraints($dependencyConstraint->getConstraint());
- $link = new Link($composerPackageName, $dependencyPackageName, $constraint, $dependencyConstraint->getType(), $dependencyConstraint->getConstraint());
- switch ($dependencyConstraint->getType()) {
- case 'required':
- $requires[] = $link;
- break;
- case 'conflicts':
- $conflicts[] = $link;
- break;
- case 'replaces':
- $replaces[] = $link;
- break;
- }
- }
- foreach ($releaseInfo->getDependencyInfo()->getOptionals() as $group => $dependencyConstraints) {
- foreach ($dependencyConstraints as $dependencyConstraint) {
- $dependencyPackageName = $this->buildComposerPackageName($dependencyConstraint->getChannelName(), $dependencyConstraint->getPackageName());
- $suggests[$group.'-'.$dependencyPackageName] = $dependencyConstraint->getConstraint();
- }
- }
- $package = new CompletePackage($composerPackageName, $normalizedVersion, $version);
- $package->setType('pear-library');
- $package->setDescription($packageDefinition->getDescription());
- $package->setLicense(array($packageDefinition->getLicense()));
- $package->setDistType('file');
- $package->setDistUrl($distUrl);
- $package->setAutoload(array('classmap' => array('')));
- $package->setIncludePaths(array('/'));
- $package->setRequires($requires);
- $package->setConflicts($conflicts);
- $package->setSuggests($suggests);
- $package->setReplaces($replaces);
- $result[] = $package;
- }
- }
- return $result;
- }
- private function buildComposerPackageName($channelName, $packageName)
- {
- if ('php' === $channelName) {
- return "php";
- }
- if ('ext' === $channelName) {
- return "ext-{$packageName}";
- }
- return "pear-{$channelName}/{$packageName}";
- }
- }
- <?php
- namespace Composer\Repository;
- use Composer\Config;
- use Composer\Package\PackageInterface;
- use Composer\Package\CompletePackage;
- use Composer\Package\Version\VersionParser;
- use Composer\Plugin\PluginInterface;
- class PlatformRepository extends ArrayRepository
- {
- const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit)?|hhvm|(?:ext|lib)-[^/]+)$}i';
- private $overrides = array();
- public function __construct(array $packages = array(), array $overrides = array())
- {
- foreach ($overrides as $name => $version) {
- $this->overrides[strtolower($name)] = array('name' => $name, 'version' => $version);
- }
- parent::__construct($packages);
- }
- protected function initialize()
- {
- parent::initialize();
- $versionParser = new VersionParser();
-
- foreach ($this->overrides as $override) {
- if (!preg_match(self::PLATFORM_PACKAGE_REGEX, $override['name'])) {
- throw new \InvalidArgumentException('Invalid platform package name in config.platform: '.$override['name']);
- }
- $version = $versionParser->normalize($override['version']);
- $package = new CompletePackage($override['name'], $version, $override['version']);
- $package->setDescription('Package overridden via config.platform');
- $package->setExtra(array('config.platform' => true));
- parent::addPackage($package);
- }
- $prettyVersion = PluginInterface::PLUGIN_API_VERSION;
- $version = $versionParser->normalize($prettyVersion);
- $composerPluginApi = new CompletePackage('composer-plugin-api', $version, $prettyVersion);
- $composerPluginApi->setDescription('The Composer Plugin API');
- $this->addPackage($composerPluginApi);
- try {
- $prettyVersion = PHP_VERSION;
- $version = $versionParser->normalize($prettyVersion);
- } catch (\UnexpectedValueException $e) {
- $prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', PHP_VERSION);
- $version = $versionParser->normalize($prettyVersion);
- }
- $php = new CompletePackage('php', $version, $prettyVersion);
- $php->setDescription('The PHP interpreter');
- $this->addPackage($php);
- if (PHP_INT_SIZE === 8) {
- $php64 = new CompletePackage('php-64bit', $version, $prettyVersion);
- $php64->setDescription('The PHP interpreter, 64bit');
- $this->addPackage($php64);
- }
- $loadedExtensions = get_loaded_extensions();
- foreach ($loadedExtensions as $name) {
- if (in_array($name, array('standard', 'Core'))) {
- continue;
- }
- $reflExt = new \ReflectionExtension($name);
- try {
- $prettyVersion = $reflExt->getVersion();
- $version = $versionParser->normalize($prettyVersion);
- } catch (\UnexpectedValueException $e) {
- $prettyVersion = '0';
- $version = $versionParser->normalize($prettyVersion);
- }
- $packageName = $this->buildPackageName($name);
- $ext = new CompletePackage($packageName, $version, $prettyVersion);
- $ext->setDescription('The '.$name.' PHP extension');
- $this->addPackage($ext);
- }
-
-
- foreach ($loadedExtensions as $name) {
- $prettyVersion = null;
- $description = 'The '.$name.' PHP library';
- switch ($name) {
- case 'curl':
- $curlVersion = curl_version();
- $prettyVersion = $curlVersion['version'];
- break;
- case 'iconv':
- $prettyVersion = ICONV_VERSION;
- break;
- case 'intl':
- $name = 'ICU';
- if (defined('INTL_ICU_VERSION')) {
- $prettyVersion = INTL_ICU_VERSION;
- } else {
- $reflector = new \ReflectionExtension('intl');
- ob_start();
- $reflector->info();
- $output = ob_get_clean();
- preg_match('/^ICU version => (.*)$/m', $output, $matches);
- $prettyVersion = $matches[1];
- }
- break;
- case 'libxml':
- $prettyVersion = LIBXML_DOTTED_VERSION;
- break;
- case 'openssl':
- $prettyVersion = preg_replace_callback('{^(?:OpenSSL\s*)?([0-9.]+)([a-z]*).*}', function ($match) {
- if (empty($match[2])) {
- return $match[1];
- }
-
- if (!preg_match('{^z*[a-z]$}', $match[2])) {
- return 0;
- }
- $len = strlen($match[2]);
- $patchVersion = ($len - 1) * 26;
- $patchVersion += ord($match[2][$len - 1]) - 96;
- return $match[1].'.'.$patchVersion;
- }, OPENSSL_VERSION_TEXT);
- $description = OPENSSL_VERSION_TEXT;
- break;
- case 'pcre':
- $prettyVersion = preg_replace('{^(\S+).*}', '$1', PCRE_VERSION);
- break;
- case 'uuid':
- $prettyVersion = phpversion('uuid');
- break;
- case 'xsl':
- $prettyVersion = LIBXSLT_DOTTED_VERSION;
- break;
- default:
- continue 2;
- }
- try {
- $version = $versionParser->normalize($prettyVersion);
- } catch (\UnexpectedValueException $e) {
- continue;
- }
- $lib = new CompletePackage('lib-'.$name, $version, $prettyVersion);
- $lib->setDescription($description);
- $this->addPackage($lib);
- }
- if (defined('HHVM_VERSION')) {
- try {
- $prettyVersion = HHVM_VERSION;
- $version = $versionParser->normalize($prettyVersion);
- } catch (\UnexpectedValueException $e) {
- $prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', HHVM_VERSION);
- $version = $versionParser->normalize($prettyVersion);
- }
- $hhvm = new CompletePackage('hhvm', $version, $prettyVersion);
- $hhvm->setDescription('The HHVM Runtime (64bit)');
- $this->addPackage($hhvm);
- }
- }
- public function addPackage(PackageInterface $package)
- {
- if (isset($this->overrides[strtolower($package->getName())])) {
- $overrider = $this->findPackage($package->getName(), '*');
- $overrider->setDescription($overrider->getDescription().' (actual: '.$package->getPrettyVersion().')');
- return;
- }
- parent::addPackage($package);
- }
- private function buildPackageName($name)
- {
- return 'ext-' . str_replace(' ', '-', $name);
- }
- }
- <?php
- namespace Composer\Repository;
- use Composer\Package\PackageInterface;
- interface RepositoryInterface extends \Countable
- {
- const SEARCH_FULLTEXT = 0;
- const SEARCH_NAME = 1;
- public function hasPackage(PackageInterface $package);
- public function findPackage($name, $constraint);
- public function findPackages($name, $constraint = null);
- public function getPackages();
- public function search($query, $mode = 0);
- }
- <?php
- namespace Composer\Repository;
- use Composer\IO\IOInterface;
- use Composer\Config;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\Package\PackageInterface;
- use Composer\Util\RemoteFilesystem;
- class RepositoryManager
- {
- private $localRepository;
- private $repositories = array();
- private $repositoryClasses = array();
- private $io;
- private $config;
- private $eventDispatcher;
- private $rfs;
- public function __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, RemoteFilesystem $rfs = null)
- {
- $this->io = $io;
- $this->config = $config;
- $this->eventDispatcher = $eventDispatcher;
- $this->rfs = $rfs;
- }
- public function findPackage($name, $constraint)
- {
- foreach ($this->repositories as $repository) {
- if ($package = $repository->findPackage($name, $constraint)) {
- return $package;
- }
- }
- }
- public function findPackages($name, $constraint)
- {
- $packages = array();
- foreach ($this->repositories as $repository) {
- $packages = array_merge($packages, $repository->findPackages($name, $constraint));
- }
- return $packages;
- }
- public function addRepository(RepositoryInterface $repository)
- {
- $this->repositories[] = $repository;
- }
- public function prependRepository(RepositoryInterface $repository)
- {
- array_unshift($this->repositories, $repository);
- }
- public function createRepository($type, $config)
- {
- if (!isset($this->repositoryClasses[$type])) {
- throw new \InvalidArgumentException('Repository type is not registered: '.$type);
- }
- $class = $this->repositoryClasses[$type];
- $reflMethod = new \ReflectionMethod($class, '__construct');
- $params = $reflMethod->getParameters();
- if (isset($params[4]) && $params[4]->getClass() && $params[4]->getClass()->getName() === 'Composer\Util\RemoteFilesystem') {
- return new $class($config, $this->io, $this->config, $this->eventDispatcher, $this->rfs);
- }
- return new $class($config, $this->io, $this->config, $this->eventDispatcher);
- }
- public function setRepositoryClass($type, $class)
- {
- $this->repositoryClasses[$type] = $class;
- }
- public function getRepositories()
- {
- return $this->repositories;
- }
- public function setLocalRepository(WritableRepositoryInterface $repository)
- {
- $this->localRepository = $repository;
- }
- public function getLocalRepository()
- {
- return $this->localRepository;
- }
- }
- <?php
- namespace Composer\Repository;
- class RepositorySecurityException extends \Exception
- {
- }
- <?php
- namespace Composer\Repository\Vcs;
- use Composer\Cache;
- use Composer\Config;
- use Composer\Json\JsonFile;
- use Composer\IO\IOInterface;
- class GitBitbucketDriver extends VcsDriver implements VcsDriverInterface
- {
- protected $cache;
- protected $owner;
- protected $repository;
- protected $tags;
- protected $branches;
- protected $rootIdentifier;
- protected $infoCache = array();
- public function initialize()
- {
- preg_match('#^https?://bitbucket\.org/([^/]+)/(.+?)\.git$#', $this->url, $match);
- $this->owner = $match[1];
- $this->repository = $match[2];
- $this->originUrl = 'bitbucket.org';
- $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.$this->originUrl.'/'.$this->owner.'/'.$this->repository);
- }
- public function getRootIdentifier()
- {
- if (null === $this->rootIdentifier) {
- $resource = $this->getScheme() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository;
- $repoData = JsonFile::parseJson($this->getContents($resource), $resource);
- $this->rootIdentifier = !empty($repoData['main_branch']) ? $repoData['main_branch'] : 'master';
- }
- return $this->rootIdentifier;
- }
- public function getUrl()
- {
- return $this->url;
- }
- public function getSource($identifier)
- {
- return array('type' => 'git', 'url' => $this->getUrl(), 'reference' => $identifier);
- }
- public function getDist($identifier)
- {
- $url = $this->getScheme() . '://bitbucket.org/'.$this->owner.'/'.$this->repository.'/get/'.$identifier.'.zip';
- return array('type' => 'zip', 'url' => $url, 'reference' => $identifier, 'shasum' => '');
- }
- public function getComposerInformation($identifier)
- {
- if (preg_match('{[a-f0-9]{40}}i', $identifier) && $res = $this->cache->read($identifier)) {
- $this->infoCache[$identifier] = JsonFile::parseJson($res);
- }
- if (!isset($this->infoCache[$identifier])) {
- $resource = $this->getScheme() . '://bitbucket.org/'.$this->owner.'/'.$this->repository.'/raw/'.$identifier.'/composer.json';
- $composer = $this->getContents($resource);
- if (!$composer) {
- return;
- }
- $composer = JsonFile::parseJson($composer, $resource);
- if (empty($composer['time'])) {
- $resource = $this->getScheme() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository.'/changesets/'.$identifier;
- $changeset = JsonFile::parseJson($this->getContents($resource), $resource);
- $composer['time'] = $changeset['timestamp'];
- }
- if (preg_match('{[a-f0-9]{40}}i', $identifier)) {
- $this->cache->write($identifier, json_encode($composer));
- }
- $this->infoCache[$identifier] = $composer;
- }
- return $this->infoCache[$identifier];
- }
- public function getTags()
- {
- if (null === $this->tags) {
- $resource = $this->getScheme() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository.'/tags';
- $tagsData = JsonFile::parseJson($this->getContents($resource), $resource);
- $this->tags = array();
- foreach ($tagsData as $tag => $data) {
- $this->tags[$tag] = $data['raw_node'];
- }
- }
- return $this->tags;
- }
- public function getBranches()
- {
- if (null === $this->branches) {
- $resource = $this->getScheme() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository.'/branches';
- $branchData = JsonFile::parseJson($this->getContents($resource), $resource);
- $this->branches = array();
- foreach ($branchData as $branch => $data) {
- $this->branches[$branch] = $data['raw_node'];
- }
- }
- return $this->branches;
- }
- public static function supports(IOInterface $io, Config $config, $url, $deep = false)
- {
- if (!preg_match('#^https?://bitbucket\.org/([^/]+)/(.+?)\.git$#', $url)) {
- return false;
- }
- if (!extension_loaded('openssl')) {
- $io->writeError('Skipping Bitbucket git driver for '.$url.' because the OpenSSL PHP extension is missing.', true, IOInterface::VERBOSE);
- return false;
- }
- return true;
- }
- }
- <?php
- namespace Composer\Repository\Vcs;
- use Composer\Json\JsonFile;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\Filesystem;
- use Composer\Util\Git as GitUtil;
- use Composer\IO\IOInterface;
- use Composer\Cache;
- use Composer\Config;
- class GitDriver extends VcsDriver
- {
- protected $cache;
- protected $tags;
- protected $branches;
- protected $rootIdentifier;
- protected $repoDir;
- protected $infoCache = array();
- public function initialize()
- {
- if (Filesystem::isLocalPath($this->url)) {
- $this->repoDir = $this->url;
- $cacheUrl = realpath($this->url);
- } else {
- $this->repoDir = $this->config->get('cache-vcs-dir') . '/' . preg_replace('{[^a-z0-9.]}i', '-', $this->url) . '/';
- GitUtil::cleanEnv();
- $fs = new Filesystem();
- $fs->ensureDirectoryExists(dirname($this->repoDir));
- if (!is_writable(dirname($this->repoDir))) {
- throw new \RuntimeException('Can not clone '.$this->url.' to access package information. The "'.dirname($this->repoDir).'" directory is not writable by the current user.');
- }
- if (preg_match('{^ssh://[^@]+@[^:]+:[^0-9]+}', $this->url)) {
- throw new \InvalidArgumentException('The source URL '.$this->url.' is invalid, ssh URLs should have a port number after ":".'."\n".'Use ssh://git@example.com:22/path or just git@example.com:path if you do not want to provide a password or custom port.');
- }
- $gitUtil = new GitUtil($this->io, $this->config, $this->process, $fs);
- if (is_dir($this->repoDir) && 0 === $this->process->execute('git rev-parse --git-dir', $output, $this->repoDir) && trim($output) === '.') {
- try {
- $commandCallable = function ($url) {
- return sprintf('git remote set-url origin %s && git remote update --prune origin', ProcessExecutor::escape($url));
- };
- $gitUtil->runCommand($commandCallable, $this->url, $this->repoDir);
- } catch (\Exception $e) {
- $this->io->writeError('<error>Failed to update '.$this->url.', package information from this repository may be outdated ('.$e->getMessage().')</error>');
- }
- } else {
- $fs->removeDirectory($this->repoDir);
- $repoDir = $this->repoDir;
- $commandCallable = function ($url) use ($repoDir) {
- return sprintf('git clone --mirror %s %s', ProcessExecutor::escape($url), ProcessExecutor::escape($repoDir));
- };
- $gitUtil->runCommand($commandCallable, $this->url, $this->repoDir, true);
- }
- $cacheUrl = $this->url;
- }
- $this->getTags();
- $this->getBranches();
- $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', $cacheUrl));
- }
- public function getRootIdentifier()
- {
- if (null === $this->rootIdentifier) {
- $this->rootIdentifier = 'master';
- $this->process->execute('git branch --no-color', $output, $this->repoDir);
- $branches = $this->process->splitLines($output);
- if (!in_array('* master', $branches)) {
- foreach ($branches as $branch) {
- if ($branch && preg_match('{^\* +(\S+)}', $branch, $match)) {
- $this->rootIdentifier = $match[1];
- break;
- }
- }
- }
- }
- return $this->rootIdentifier;
- }
- public function getUrl()
- {
- return $this->url;
- }
- public function getSource($identifier)
- {
- return array('type' => 'git', 'url' => $this->getUrl(), 'reference' => $identifier);
- }
- public function getDist($identifier)
- {
- return null;
- }
- public function getComposerInformation($identifier)
- {
- if (preg_match('{[a-f0-9]{40}}i', $identifier) && $res = $this->cache->read($identifier)) {
- $this->infoCache[$identifier] = JsonFile::parseJson($res);
- }
- if (!isset($this->infoCache[$identifier])) {
- $resource = sprintf('%s:composer.json', ProcessExecutor::escape($identifier));
- $this->process->execute(sprintf('git show %s', $resource), $composer, $this->repoDir);
- if (!trim($composer)) {
- return;
- }
- $composer = JsonFile::parseJson($composer, $resource);
- if (empty($composer['time'])) {
- $this->process->execute(sprintf('git log -1 --format=%%at %s', ProcessExecutor::escape($identifier)), $output, $this->repoDir);
- $date = new \DateTime('@'.trim($output), new \DateTimeZone('UTC'));
- $composer['time'] = $date->format('Y-m-d H:i:s');
- }
- if (preg_match('{[a-f0-9]{40}}i', $identifier)) {
- $this->cache->write($identifier, json_encode($composer));
- }
- $this->infoCache[$identifier] = $composer;
- }
- return $this->infoCache[$identifier];
- }
- public function getTags()
- {
- if (null === $this->tags) {
- $this->tags = array();
- $this->process->execute('git show-ref --tags', $output, $this->repoDir);
- foreach ($output = $this->process->splitLines($output) as $tag) {
- if ($tag && preg_match('{^([a-f0-9]{40}) refs/tags/(\S+)$}', $tag, $match)) {
- $this->tags[$match[2]] = $match[1];
- }
- }
- }
- return $this->tags;
- }
- public function getBranches()
- {
- if (null === $this->branches) {
- $branches = array();
- $this->process->execute('git branch --no-color --no-abbrev -v', $output, $this->repoDir);
- foreach ($this->process->splitLines($output) as $branch) {
- if ($branch && !preg_match('{^ *[^/]+/HEAD }', $branch)) {
- if (preg_match('{^(?:\* )? *(\S+) *([a-f0-9]+)(?: .*)?$}', $branch, $match)) {
- $branches[$match[1]] = $match[2];
- }
- }
- }
- $this->branches = $branches;
- }
- return $this->branches;
- }
- public static function supports(IOInterface $io, Config $config, $url, $deep = false)
- {
- if (preg_match('#(^git://|\.git$|git(?:olite)?@|//git\.|//github.com/)#i', $url)) {
- return true;
- }
- if (Filesystem::isLocalPath($url)) {
- $url = Filesystem::getPlatformPath($url);
- if (!is_dir($url)) {
- return false;
- }
- $process = new ProcessExecutor($io);
- if ($process->execute('git tag', $output, $url) === 0) {
- return true;
- }
- }
- if (!$deep) {
- return false;
- }
- $process = new ProcessExecutor($io);
- if ($process->execute('git ls-remote --heads ' . ProcessExecutor::escape($url), $output) === 0) {
- return true;
- }
- return false;
- }
- }
- <?php
- namespace Composer\Repository\Vcs;
- use Composer\Config;
- use Composer\Downloader\TransportException;
- use Composer\Json\JsonFile;
- use Composer\Cache;
- use Composer\IO\IOInterface;
- use Composer\Util\GitHub;
- class GitHubDriver extends VcsDriver
- {
- protected $cache;
- protected $owner;
- protected $repository;
- protected $tags;
- protected $branches;
- protected $rootIdentifier;
- protected $hasIssues;
- protected $infoCache = array();
- protected $isPrivate = false;
- protected $gitDriver;
- public function initialize()
- {
- preg_match('#^(?:(?:https?|git)://([^/]+)/|git@([^:]+):)([^/]+)/(.+?)(?:\.git|/)?$#', $this->url, $match);
- $this->owner = $match[3];
- $this->repository = $match[4];
- $this->originUrl = !empty($match[1]) ? $match[1] : $match[2];
- if ($this->originUrl === 'www.github.com') {
- $this->originUrl = 'github.com';
- }
- $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.$this->originUrl.'/'.$this->owner.'/'.$this->repository);
- if (isset($this->repoConfig['no-api']) && $this->repoConfig['no-api']) {
- $this->setupGitDriver($this->url);
- return;
- }
- $this->fetchRootIdentifier();
- }
- public function getRepositoryUrl()
- {
- return 'https://'.$this->originUrl.'/'.$this->owner.'/'.$this->repository;
- }
- public function getRootIdentifier()
- {
- if ($this->gitDriver) {
- return $this->gitDriver->getRootIdentifier();
- }
- return $this->rootIdentifier;
- }
- public function getUrl()
- {
- if ($this->gitDriver) {
- return $this->gitDriver->getUrl();
- }
- return 'https://' . $this->originUrl . '/'.$this->owner.'/'.$this->repository.'.git';
- }
- protected function getApiUrl()
- {
- if ('github.com' === $this->originUrl) {
- $apiUrl = 'api.github.com';
- } else {
- $apiUrl = $this->originUrl . '/api/v3';
- }
- return 'https://' . $apiUrl;
- }
- public function getSource($identifier)
- {
- if ($this->gitDriver) {
- return $this->gitDriver->getSource($identifier);
- }
- if ($this->isPrivate) {
-
- $url = $this->generateSshUrl();
- } else {
- $url = $this->getUrl();
- }
- return array('type' => 'git', 'url' => $url, 'reference' => $identifier);
- }
- public function getDist($identifier)
- {
- $url = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/zipball/'.$identifier;
- return array('type' => 'zip', 'url' => $url, 'reference' => $identifier, 'shasum' => '');
- }
- public function getComposerInformation($identifier)
- {
- if ($this->gitDriver) {
- return $this->gitDriver->getComposerInformation($identifier);
- }
- if (preg_match('{[a-f0-9]{40}}i', $identifier) && $res = $this->cache->read($identifier)) {
- $this->infoCache[$identifier] = JsonFile::parseJson($res);
- }
- if (!isset($this->infoCache[$identifier])) {
- $notFoundRetries = 2;
- while ($notFoundRetries) {
- try {
- $resource = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/contents/composer.json?ref='.urlencode($identifier);
- $resource = JsonFile::parseJson($this->getContents($resource));
- if (empty($resource['content']) || $resource['encoding'] !== 'base64' || !($composer = base64_decode($resource['content']))) {
- throw new \RuntimeException('Could not retrieve composer.json for '.$identifier);
- }
- break;
- } catch (TransportException $e) {
- if (404 !== $e->getCode()) {
- throw $e;
- }
-
- $notFoundRetries--;
- $composer = null;
- }
- }
- if ($composer) {
- $composer = JsonFile::parseJson($composer, $resource);
- if (empty($composer['time'])) {
- $resource = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/commits/'.urlencode($identifier);
- $commit = JsonFile::parseJson($this->getContents($resource), $resource);
- $composer['time'] = $commit['commit']['committer']['date'];
- }
- if (!isset($composer['support']['source'])) {
- $label = array_search($identifier, $this->getTags()) ?: array_search($identifier, $this->getBranches()) ?: $identifier;
- $composer['support']['source'] = sprintf('https://%s/%s/%s/tree/%s', $this->originUrl, $this->owner, $this->repository, $label);
- }
- if (!isset($composer['support']['issues']) && $this->hasIssues) {
- $composer['support']['issues'] = sprintf('https://%s/%s/%s/issues', $this->originUrl, $this->owner, $this->repository);
- }
- }
- if (preg_match('{[a-f0-9]{40}}i', $identifier)) {
- $this->cache->write($identifier, json_encode($composer));
- }
- $this->infoCache[$identifier] = $composer;
- }
- return $this->infoCache[$identifier];
- }
- public function getTags()
- {
- if ($this->gitDriver) {
- return $this->gitDriver->getTags();
- }
- if (null === $this->tags) {
- $this->tags = array();
- $resource = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/tags?per_page=100';
- do {
- $tagsData = JsonFile::parseJson($this->getContents($resource), $resource);
- foreach ($tagsData as $tag) {
- $this->tags[$tag['name']] = $tag['commit']['sha'];
- }
- $resource = $this->getNextPage();
- } while ($resource);
- }
- return $this->tags;
- }
- public function getBranches()
- {
- if ($this->gitDriver) {
- return $this->gitDriver->getBranches();
- }
- if (null === $this->branches) {
- $this->branches = array();
- $resource = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/git/refs/heads?per_page=100';
- $branchBlacklist = array('gh-pages');
- do {
- $branchData = JsonFile::parseJson($this->getContents($resource), $resource);
- foreach ($branchData as $branch) {
- $name = substr($branch['ref'], 11);
- if (!in_array($name, $branchBlacklist)) {
- $this->branches[$name] = $branch['object']['sha'];
- }
- }
- $resource = $this->getNextPage();
- } while ($resource);
- }
- return $this->branches;
- }
- public static function supports(IOInterface $io, Config $config, $url, $deep = false)
- {
- if (!preg_match('#^((?:https?|git)://([^/]+)/|git@([^:]+):)([^/]+)/(.+?)(?:\.git|/)?$#', $url, $matches)) {
- return false;
- }
- $originUrl = !empty($matches[2]) ? $matches[2] : $matches[3];
- if (!in_array(preg_replace('{^www\.}i', '', $originUrl), $config->get('github-domains'))) {
- return false;
- }
- if (!extension_loaded('openssl')) {
- $io->writeError('Skipping GitHub driver for '.$url.' because the OpenSSL PHP extension is missing.', true, IOInterface::VERBOSE);
- return false;
- }
- return true;
- }
- protected function generateSshUrl()
- {
- return 'git@' . $this->originUrl . ':'.$this->owner.'/'.$this->repository.'.git';
- }
- protected function getContents($url, $fetchingRepoData = false)
- {
- try {
- return parent::getContents($url);
- } catch (TransportException $e) {
- $gitHubUtil = new GitHub($this->io, $this->config, $this->process, $this->remoteFilesystem);
- switch ($e->getCode()) {
- case 401:
- case 404:
- if (!$fetchingRepoData) {
- throw $e;
- }
- if ($gitHubUtil->authorizeOAuth($this->originUrl)) {
- return parent::getContents($url);
- }
- if (!$this->io->isInteractive()) {
- return $this->attemptCloneFallback();
- }
- $gitHubUtil->authorizeOAuthInteractively($this->originUrl, 'Your GitHub credentials are required to fetch private repository metadata (<info>'.$this->url.'</info>)');
- return parent::getContents($url);
- case 403:
- if (!$this->io->hasAuthentication($this->originUrl) && $gitHubUtil->authorizeOAuth($this->originUrl)) {
- return parent::getContents($url);
- }
- if (!$this->io->isInteractive() && $fetchingRepoData) {
- return $this->attemptCloneFallback();
- }
- $rateLimited = false;
- foreach ($e->getHeaders() as $header) {
- if (preg_match('{^X-RateLimit-Remaining: *0$}i', trim($header))) {
- $rateLimited = true;
- }
- }
- if (!$this->io->hasAuthentication($this->originUrl)) {
- if (!$this->io->isInteractive()) {
- $this->io->writeError('<error>GitHub API limit exhausted. Failed to get metadata for the '.$this->url.' repository, try running in interactive mode so that you can enter your GitHub credentials to increase the API limit</error>');
- throw $e;
- }
- $gitHubUtil->authorizeOAuthInteractively($this->originUrl, 'API limit exhausted. Enter your GitHub credentials to get a larger API limit (<info>'.$this->url.'</info>)');
- return parent::getContents($url);
- }
- if ($rateLimited) {
- $rateLimit = $this->getRateLimit($e->getHeaders());
- $this->io->writeError(sprintf(
- '<error>GitHub API limit (%d calls/hr) is exhausted. You are already authorized so you have to wait until %s before doing more requests</error>',
- $rateLimit['limit'],
- $rateLimit['reset']
- ));
- }
- throw $e;
- default:
- throw $e;
- }
- }
- }
- protected function getRateLimit(array $headers)
- {
- $rateLimit = array(
- 'limit' => '?',
- 'reset' => '?',
- );
- foreach ($headers as $header) {
- $header = trim($header);
- if (false === strpos($header, 'X-RateLimit-')) {
- continue;
- }
- list($type, $value) = explode(':', $header, 2);
- switch ($type) {
- case 'X-RateLimit-Limit':
- $rateLimit['limit'] = (int) trim($value);
- break;
- case 'X-RateLimit-Reset':
- $rateLimit['reset'] = date('Y-m-d H:i:s', (int) trim($value));
- break;
- }
- }
- return $rateLimit;
- }
- protected function fetchRootIdentifier()
- {
- $repoDataUrl = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository;
- $repoData = JsonFile::parseJson($this->getContents($repoDataUrl, true), $repoDataUrl);
- if (null === $repoData && null !== $this->gitDriver) {
- return;
- }
- $this->owner = $repoData['owner']['login'];
- $this->repository = $repoData['name'];
- $this->isPrivate = !empty($repoData['private']);
- if (isset($repoData['default_branch'])) {
- $this->rootIdentifier = $repoData['default_branch'];
- } elseif (isset($repoData['master_branch'])) {
- $this->rootIdentifier = $repoData['master_branch'];
- } else {
- $this->rootIdentifier = 'master';
- }
- $this->hasIssues = !empty($repoData['has_issues']);
- }
- protected function attemptCloneFallback()
- {
- $this->isPrivate = true;
- try {
-
-
-
- $this->setupGitDriver($this->generateSshUrl());
- return;
- } catch (\RuntimeException $e) {
- $this->gitDriver = null;
- $this->io->writeError('<error>Failed to clone the '.$this->generateSshUrl().' repository, try running in interactive mode so that you can enter your GitHub credentials</error>');
- throw $e;
- }
- }
- protected function setupGitDriver($url)
- {
- $this->gitDriver = new GitDriver(
- array('url' => $url),
- $this->io,
- $this->config,
- $this->process,
- $this->remoteFilesystem
- );
- $this->gitDriver->initialize();
- }
- protected function getNextPage()
- {
- $headers = $this->remoteFilesystem->getLastHeaders();
- foreach ($headers as $header) {
- if (substr($header, 0, 5) === 'Link:') {
- $links = explode(',', substr($header, 5));
- foreach ($links as $link) {
- if (preg_match('{<(.+?)>; *rel="next"}', $link, $match)) {
- return $match[1];
- }
- }
- }
- }
- }
- }
- <?php
- namespace Composer\Repository\Vcs;
- use Composer\Config;
- use Composer\Cache;
- use Composer\IO\IOInterface;
- use Composer\Json\JsonFile;
- use Composer\Downloader\TransportException;
- use Composer\Util\RemoteFilesystem;
- use Composer\Util\GitLab;
- class GitLabDriver extends VcsDriver
- {
- private $scheme;
- private $owner;
- private $repository;
- private $cache;
- private $infoCache = array();
- private $project;
- private $commits = array();
- private $tags;
- private $branches;
- protected $gitDriver;
- const URL_REGEX = '#^(?:(?P<scheme>https?)://(?P<domain>.+?)/|git@(?P<domain2>[^:]+):)(?P<owner>[^/]+)/(?P<repo>[^/]+?)(?:\.git|/)?$#';
- public function initialize()
- {
- if (!preg_match(self::URL_REGEX, $this->url, $match)) {
- throw new \InvalidArgumentException('The URL provided is invalid. It must be the HTTP URL of a GitLab project.');
- }
- $this->scheme = !empty($match['scheme']) ? $match['scheme'] : 'https';
- $this->originUrl = !empty($match['domain']) ? $match['domain'] : $match['domain2'];
- $this->owner = $match['owner'];
- $this->repository = preg_replace('#(\.git)$#', '', $match['repo']);
- $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.$this->originUrl.'/'.$this->owner.'/'.$this->repository);
- $this->fetchProject();
- }
- public function setRemoteFilesystem(RemoteFilesystem $remoteFilesystem)
- {
- $this->remoteFilesystem = $remoteFilesystem;
- }
- public function getComposerInformation($identifier)
- {
- if (!preg_match('{[a-f0-9]{40}}i', $identifier)) {
- $branches = $this->getBranches();
- if (isset($branches[$identifier])) {
- $identifier = $branches[$identifier];
- }
- }
- if (isset($this->infoCache[$identifier])) {
- return $this->infoCache[$identifier];
- }
- if (preg_match('{[a-f0-9]{40}}i', $identifier) && $res = $this->cache->read($identifier)) {
- return $this->infoCache[$identifier] = JsonFile::parseJson($res, $res);
- }
- try {
- $composer = $this->fetchComposerFile($identifier);
- } catch (TransportException $e) {
- if ($e->getCode() !== 404) {
- throw $e;
- }
- $composer = false;
- }
- if ($composer && !isset($composer['time']) && isset($this->commits[$identifier])) {
- $composer['time'] = $this->commits[$identifier]['committed_date'];
- }
- if (preg_match('{[a-f0-9]{40}}i', $identifier)) {
- $this->cache->write($identifier, json_encode($composer));
- }
- return $this->infoCache[$identifier] = $composer;
- }
- public function getRepositoryUrl()
- {
- return $this->project['ssh_url_to_repo'];
- }
- public function getUrl()
- {
- return $this->project['web_url'];
- }
- public function getDist($identifier)
- {
- $url = $this->getApiUrl().'/repository/archive.zip?sha='.$identifier;
- return array('type' => 'zip', 'url' => $url, 'reference' => $identifier, 'shasum' => '');
- }
- public function getSource($identifier)
- {
- return array('type' => 'git', 'url' => $this->getRepositoryUrl(), 'reference' => $identifier);
- }
- public function getRootIdentifier()
- {
- return $this->project['default_branch'];
- }
- public function getBranches()
- {
- if (!$this->branches) {
- $this->branches = $this->getReferences('branches');
- }
- return $this->branches;
- }
- public function getTags()
- {
- if (!$this->tags) {
- $this->tags = $this->getReferences('tags');
- }
- return $this->tags;
- }
- protected function fetchComposerFile($identifier)
- {
- $resource = $this->getApiUrl().'/repository/blobs/'.$identifier.'?filepath=composer.json';
- return JsonFile::parseJson($this->getContents($resource), $resource);
- }
- public function getApiUrl()
- {
- return $this->scheme.'://'.$this->originUrl.'/api/v3/projects/'.$this->owner.'%2F'.$this->repository;
- }
- protected function getReferences($type)
- {
- $resource = $this->getApiUrl().'/repository/'.$type;
- $data = JsonFile::parseJson($this->getContents($resource), $resource);
- $references = array();
- foreach ($data as $datum) {
- $references[$datum['name']] = $datum['commit']['id'];
-
- $this->commits[$datum['commit']['id']] = $datum['commit'];
- }
- return $references;
- }
- protected function fetchProject()
- {
- $resource = $this->getApiUrl();
- $this->project = JsonFile::parseJson($this->getContents($resource, true), $resource);
- }
- protected function attemptCloneFallback()
- {
- try {
-
-
- $this->setupGitDriver($this->generateSshUrl());
- return;
- } catch (\RuntimeException $e) {
- $this->gitDriver = null;
- $this->io->writeError('<error>Failed to clone the '.$this->generateSshUrl().' repository, try running in interactive mode so that you can enter your credentials</error>');
- throw $e;
- }
- }
- protected function generateSshUrl()
- {
- return 'git@' . $this->originUrl . ':'.$this->owner.'/'.$this->repository.'.git';
- }
- protected function setupGitDriver($url)
- {
- $this->gitDriver = new GitDriver(
- array('url' => $url),
- $this->io,
- $this->config,
- $this->process,
- $this->remoteFilesystem
- );
- $this->gitDriver->initialize();
- }
- protected function getContents($url, $fetchingRepoData = false)
- {
- try {
- return parent::getContents($url);
- } catch (TransportException $e) {
- $gitLabUtil = new GitLab($this->io, $this->config, $this->process, $this->remoteFilesystem);
- switch ($e->getCode()) {
- case 401:
- case 404:
- if (!$fetchingRepoData) {
- throw $e;
- }
- if ($gitLabUtil->authorizeOAuth($this->originUrl)) {
- return parent::getContents($url);
- }
- if (!$this->io->isInteractive()) {
- return $this->attemptCloneFallback();
- }
- $this->io->writeError('<warning>Failed to download ' . $this->owner . '/' . $this->repository . ':' . $e->getMessage() . '</warning>');
- $gitLabUtil->authorizeOAuthInteractively($this->originUrl, 'Your credentials are required to fetch private repository metadata (<info>'.$this->url.'</info>)');
- return parent::getContents($url);
- case 403:
- if (!$this->io->hasAuthentication($this->originUrl) && $gitLabUtil->authorizeOAuth($this->originUrl)) {
- return parent::getContents($url);
- }
- if (!$this->io->isInteractive() && $fetchingRepoData) {
- return $this->attemptCloneFallback();
- }
- throw $e;
- default:
- throw $e;
- }
- }
- }
- public static function supports(IOInterface $io, Config $config, $url, $deep = false)
- {
- if (!preg_match(self::URL_REGEX, $url, $match)) {
- return false;
- }
- $scheme = !empty($match['scheme']) ? $match['scheme'] : 'https';
- $originUrl = !empty($match['domain']) ? $match['domain'] : $match['domain2'];
- if (!in_array($originUrl, (array) $config->get('gitlab-domains'))) {
- return false;
- }
- if ('https' === $scheme && !extension_loaded('openssl')) {
- $io->writeError('Skipping GitLab driver for '.$url.' because the OpenSSL PHP extension is missing.', true, IOInterface::VERBOSE);
- return false;
- }
- return true;
- }
- }
- <?php
- namespace Composer\Repository\Vcs;
- use Composer\Cache;
- use Composer\Config;
- use Composer\Json\JsonFile;
- use Composer\IO\IOInterface;
- class HgBitbucketDriver extends VcsDriver
- {
- protected $cache;
- protected $owner;
- protected $repository;
- protected $tags;
- protected $branches;
- protected $rootIdentifier;
- protected $infoCache = array();
- public function initialize()
- {
- preg_match('#^https?://bitbucket\.org/([^/]+)/([^/]+)/?$#', $this->url, $match);
- $this->owner = $match[1];
- $this->repository = $match[2];
- $this->originUrl = 'bitbucket.org';
- $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.$this->originUrl.'/'.$this->owner.'/'.$this->repository);
- }
- public function getRootIdentifier()
- {
- if (null === $this->rootIdentifier) {
- $resource = $this->getScheme() . '://bitbucket.org/api/1.0/repositories/'.$this->owner.'/'.$this->repository.'/tags';
- $repoData = JsonFile::parseJson($this->getContents($resource), $resource);
- if (array() === $repoData || !isset($repoData['tip'])) {
- throw new \RuntimeException($this->url.' does not appear to be a mercurial repository, use '.$this->url.'.git if this is a git bitbucket repository');
- }
- $this->rootIdentifier = $repoData['tip']['raw_node'];
- }
- return $this->rootIdentifier;
- }
- public function getUrl()
- {
- return $this->url;
- }
- public function getSource($identifier)
- {
- return array('type' => 'hg', 'url' => $this->getUrl(), 'reference' => $identifier);
- }
- public function getDist($identifier)
- {
- $url = $this->getScheme() . '://bitbucket.org/'.$this->owner.'/'.$this->repository.'/get/'.$identifier.'.zip';
- return array('type' => 'zip', 'url' => $url, 'reference' => $identifier, 'shasum' => '');
- }
- public function getComposerInformation($identifier)
- {
- if (preg_match('{[a-f0-9]{40}}i', $identifier) && $res = $this->cache->read($identifier)) {
- $this->infoCache[$identifier] = JsonFile::parseJson($res);
- }
- if (!isset($this->infoCache[$identifier])) {
- $resource = $this->getScheme() . '://bitbucket.org/api/1.0/repositories/'.$this->owner.'/'.$this->repository.'/src/'.$identifier.'/composer.json';
- $repoData = JsonFile::parseJson($this->getContents($resource), $resource);
-
-
-
- if (!array_key_exists('data', $repoData)) {
- return;
- }
- $composer = JsonFile::parseJson($repoData['data'], $resource);
- if (empty($composer['time'])) {
- $resource = $this->getScheme() . '://bitbucket.org/api/1.0/repositories/'.$this->owner.'/'.$this->repository.'/changesets/'.$identifier;
- $changeset = JsonFile::parseJson($this->getContents($resource), $resource);
- $composer['time'] = $changeset['timestamp'];
- }
- if (preg_match('{[a-f0-9]{40}}i', $identifier)) {
- $this->cache->write($identifier, json_encode($composer));
- }
- $this->infoCache[$identifier] = $composer;
- }
- return $this->infoCache[$identifier];
- }
- public function getTags()
- {
- if (null === $this->tags) {
- $resource = $this->getScheme() . '://bitbucket.org/api/1.0/repositories/'.$this->owner.'/'.$this->repository.'/tags';
- $tagsData = JsonFile::parseJson($this->getContents($resource), $resource);
- $this->tags = array();
- foreach ($tagsData as $tag => $data) {
- $this->tags[$tag] = $data['raw_node'];
- }
- unset($this->tags['tip']);
- }
- return $this->tags;
- }
- public function getBranches()
- {
- if (null === $this->branches) {
- $resource = $this->getScheme() . '://bitbucket.org/api/1.0/repositories/'.$this->owner.'/'.$this->repository.'/branches';
- $branchData = JsonFile::parseJson($this->getContents($resource), $resource);
- $this->branches = array();
- foreach ($branchData as $branch => $data) {
- $this->branches[$branch] = $data['raw_node'];
- }
- }
- return $this->branches;
- }
- public static function supports(IOInterface $io, Config $config, $url, $deep = false)
- {
- if (!preg_match('#^https?://bitbucket\.org/([^/]+)/([^/]+)/?$#', $url)) {
- return false;
- }
- if (!extension_loaded('openssl')) {
- $io->writeError('Skipping Bitbucket hg driver for '.$url.' because the OpenSSL PHP extension is missing.', true, IOInterface::VERBOSE);
- return false;
- }
- return true;
- }
- }
- <?php
- namespace Composer\Repository\Vcs;
- use Composer\Config;
- use Composer\Json\JsonFile;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\Filesystem;
- use Composer\IO\IOInterface;
- class HgDriver extends VcsDriver
- {
- protected $tags;
- protected $branches;
- protected $rootIdentifier;
- protected $repoDir;
- protected $infoCache = array();
- public function initialize()
- {
- if (Filesystem::isLocalPath($this->url)) {
- $this->repoDir = $this->url;
- } else {
- $cacheDir = $this->config->get('cache-vcs-dir');
- $this->repoDir = $cacheDir . '/' . preg_replace('{[^a-z0-9]}i', '-', $this->url) . '/';
- $fs = new Filesystem();
- $fs->ensureDirectoryExists($cacheDir);
- if (!is_writable(dirname($this->repoDir))) {
- throw new \RuntimeException('Can not clone '.$this->url.' to access package information. The "'.$cacheDir.'" directory is not writable by the current user.');
- }
- if (is_dir($this->repoDir) && 0 === $this->process->execute('hg summary', $output, $this->repoDir)) {
- if (0 !== $this->process->execute('hg pull', $output, $this->repoDir)) {
- $this->io->writeError('<error>Failed to update '.$this->url.', package information from this repository may be outdated ('.$this->process->getErrorOutput().')</error>');
- }
- } else {
- $fs->removeDirectory($this->repoDir);
- if (0 !== $this->process->execute(sprintf('hg clone --noupdate %s %s', ProcessExecutor::escape($this->url), ProcessExecutor::escape($this->repoDir)), $output, $cacheDir)) {
- $output = $this->process->getErrorOutput();
- if (0 !== $this->process->execute('hg --version', $ignoredOutput)) {
- throw new \RuntimeException('Failed to clone '.$this->url.', hg was not found, check that it is installed and in your PATH env.' . "\n\n" . $this->process->getErrorOutput());
- }
- throw new \RuntimeException('Failed to clone '.$this->url.', could not read packages from it' . "\n\n" .$output);
- }
- }
- }
- $this->getTags();
- $this->getBranches();
- }
- public function getRootIdentifier()
- {
- if (null === $this->rootIdentifier) {
- $this->process->execute(sprintf('hg tip --template "{node}"'), $output, $this->repoDir);
- $output = $this->process->splitLines($output);
- $this->rootIdentifier = $output[0];
- }
- return $this->rootIdentifier;
- }
- public function getUrl()
- {
- return $this->url;
- }
- public function getSource($identifier)
- {
- return array('type' => 'hg', 'url' => $this->getUrl(), 'reference' => $identifier);
- }
- public function getDist($identifier)
- {
- return null;
- }
- public function getComposerInformation($identifier)
- {
- if (!isset($this->infoCache[$identifier])) {
- $this->process->execute(sprintf('hg cat -r %s composer.json', ProcessExecutor::escape($identifier)), $composer, $this->repoDir);
- if (!trim($composer)) {
- return;
- }
- $composer = JsonFile::parseJson($composer, $identifier);
- if (empty($composer['time'])) {
- $this->process->execute(sprintf('hg log --template "{date|rfc3339date}" -r %s', ProcessExecutor::escape($identifier)), $output, $this->repoDir);
- $date = new \DateTime(trim($output), new \DateTimeZone('UTC'));
- $composer['time'] = $date->format('Y-m-d H:i:s');
- }
- $this->infoCache[$identifier] = $composer;
- }
- return $this->infoCache[$identifier];
- }
- public function getTags()
- {
- if (null === $this->tags) {
- $tags = array();
- $this->process->execute('hg tags', $output, $this->repoDir);
- foreach ($this->process->splitLines($output) as $tag) {
- if ($tag && preg_match('(^([^\s]+)\s+\d+:(.*)$)', $tag, $match)) {
- $tags[$match[1]] = $match[2];
- }
- }
- unset($tags['tip']);
- $this->tags = $tags;
- }
- return $this->tags;
- }
- public function getBranches()
- {
- if (null === $this->branches) {
- $branches = array();
- $bookmarks = array();
- $this->process->execute('hg branches', $output, $this->repoDir);
- foreach ($this->process->splitLines($output) as $branch) {
- if ($branch && preg_match('(^([^\s]+)\s+\d+:([a-f0-9]+))', $branch, $match)) {
- $branches[$match[1]] = $match[2];
- }
- }
- $this->process->execute('hg bookmarks', $output, $this->repoDir);
- foreach ($this->process->splitLines($output) as $branch) {
- if ($branch && preg_match('(^(?:[\s*]*)([^\s]+)\s+\d+:(.*)$)', $branch, $match)) {
- $bookmarks[$match[1]] = $match[2];
- }
- }
- $this->branches = array_merge($bookmarks, $branches);
- }
- return $this->branches;
- }
- public static function supports(IOInterface $io, Config $config, $url, $deep = false)
- {
- if (preg_match('#(^(?:https?|ssh)://(?:[^@]@)?bitbucket.org|https://(?:.*?)\.kilnhg.com)#i', $url)) {
- return true;
- }
- if (Filesystem::isLocalPath($url)) {
- $url = Filesystem::getPlatformPath($url);
- if (!is_dir($url)) {
- return false;
- }
- $process = new ProcessExecutor();
- if ($process->execute('hg summary', $output, $url) === 0) {
- return true;
- }
- }
- if (!$deep) {
- return false;
- }
- $processExecutor = new ProcessExecutor();
- $exit = $processExecutor->execute(sprintf('hg identify %s', ProcessExecutor::escape($url)), $ignored);
- return $exit === 0;
- }
- }
- <?php
- namespace Composer\Repository\Vcs;
- use Composer\Config;
- use Composer\IO\IOInterface;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\Perforce;
- class PerforceDriver extends VcsDriver
- {
- protected $depot;
- protected $branch;
- protected $perforce;
- protected $composerInfo;
- protected $composerInfoIdentifier;
- public function initialize()
- {
- $this->depot = $this->repoConfig['depot'];
- $this->branch = '';
- if (!empty($this->repoConfig['branch'])) {
- $this->branch = $this->repoConfig['branch'];
- }
- $this->initPerforce($this->repoConfig);
- $this->perforce->p4Login($this->io);
- $this->perforce->checkStream($this->depot);
- $this->perforce->writeP4ClientSpec();
- $this->perforce->connectClient();
- return true;
- }
- private function initPerforce($repoConfig)
- {
- if (!empty($this->perforce)) {
- return;
- }
- $repoDir = $this->config->get('cache-vcs-dir') . '/' . $this->depot;
- $this->perforce = Perforce::create($repoConfig, $this->getUrl(), $repoDir, $this->process, $this->io);
- }
- public function getComposerInformation($identifier)
- {
- if (!empty($this->composerInfoIdentifier)) {
- if (strcmp($identifier, $this->composerInfoIdentifier) === 0) {
- return $this->composerInfo;
- }
- }
- $composer_info = $this->perforce->getComposerInformation($identifier);
- return $composer_info;
- }
- public function getRootIdentifier()
- {
- return $this->branch;
- }
- public function getBranches()
- {
- $branches = $this->perforce->getBranches();
- return $branches;
- }
- public function getTags()
- {
- $tags = $this->perforce->getTags();
- return $tags;
- }
- public function getDist($identifier)
- {
- return null;
- }
- public function getSource($identifier)
- {
- $source = array(
- 'type' => 'perforce',
- 'url' => $this->repoConfig['url'],
- 'reference' => $identifier,
- 'p4user' => $this->perforce->getUser(),
- );
- return $source;
- }
- public function getUrl()
- {
- return $this->url;
- }
- public function hasComposerFile($identifier)
- {
- $this->composerInfo = $this->perforce->getComposerInformation('//' . $this->depot . '/' . $identifier);
- $this->composerInfoIdentifier = $identifier;
- return !empty($this->composerInfo);
- }
- public function getContents($url)
- {
- return false;
- }
- public static function supports(IOInterface $io, Config $config, $url, $deep = false)
- {
- if ($deep || preg_match('#\b(perforce|p4)\b#i', $url)) {
- return Perforce::checkServerExists($url, new ProcessExecutor($io));
- }
- return false;
- }
- public function cleanup()
- {
- $this->perforce->cleanupClientSpec();
- $this->perforce = null;
- }
- public function getDepot()
- {
- return $this->depot;
- }
- public function getBranch()
- {
- return $this->branch;
- }
- }
- <?php
- namespace Composer\Repository\Vcs;
- use Composer\Cache;
- use Composer\Config;
- use Composer\Json\JsonFile;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\Filesystem;
- use Composer\Util\Svn as SvnUtil;
- use Composer\IO\IOInterface;
- use Composer\Downloader\TransportException;
- class SvnDriver extends VcsDriver
- {
- protected $cache;
- protected $baseUrl;
- protected $tags;
- protected $branches;
- protected $rootIdentifier;
- protected $infoCache = array();
- protected $trunkPath = 'trunk';
- protected $branchesPath = 'branches';
- protected $tagsPath = 'tags';
- protected $packagePath = '';
- protected $cacheCredentials = true;
- private $util;
- public function initialize()
- {
- $this->url = $this->baseUrl = rtrim(self::normalizeUrl($this->url), '/');
- SvnUtil::cleanEnv();
- if (isset($this->repoConfig['trunk-path'])) {
- $this->trunkPath = $this->repoConfig['trunk-path'];
- }
- if (isset($this->repoConfig['branches-path'])) {
- $this->branchesPath = $this->repoConfig['branches-path'];
- }
- if (isset($this->repoConfig['tags-path'])) {
- $this->tagsPath = $this->repoConfig['tags-path'];
- }
- if (array_key_exists('svn-cache-credentials', $this->repoConfig)) {
- $this->cacheCredentials = (bool) $this->repoConfig['svn-cache-credentials'];
- }
- if (isset($this->repoConfig['package-path'])) {
- $this->packagePath = '/' . trim($this->repoConfig['package-path'], '/');
- }
- if (false !== ($pos = strrpos($this->url, '/' . $this->trunkPath))) {
- $this->baseUrl = substr($this->url, 0, $pos);
- }
- $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', $this->baseUrl));
- $this->getBranches();
- $this->getTags();
- }
- public function getRootIdentifier()
- {
- return $this->rootIdentifier ?: $this->trunkPath;
- }
- public function getUrl()
- {
- return $this->url;
- }
- public function getSource($identifier)
- {
- return array('type' => 'svn', 'url' => $this->baseUrl, 'reference' => $identifier);
- }
- public function getDist($identifier)
- {
- return null;
- }
- public function getComposerInformation($identifier)
- {
- $identifier = '/' . trim($identifier, '/') . '/';
- if ($res = $this->cache->read($identifier.'.json')) {
- $this->infoCache[$identifier] = JsonFile::parseJson($res);
- }
- if (!isset($this->infoCache[$identifier])) {
- preg_match('{^(.+?)(@\d+)?/$}', $identifier, $match);
- if (!empty($match[2])) {
- $path = $match[1];
- $rev = $match[2];
- } else {
- $path = $identifier;
- $rev = '';
- }
- try {
- $resource = $path.'composer.json';
- $output = $this->execute('svn cat', $this->baseUrl . $resource . $rev);
- if (!trim($output)) {
- return;
- }
- } catch (\RuntimeException $e) {
- throw new TransportException($e->getMessage());
- }
- $composer = JsonFile::parseJson($output, $this->baseUrl . $resource . $rev);
- if (empty($composer['time'])) {
- $output = $this->execute('svn info', $this->baseUrl . $path . $rev);
- foreach ($this->process->splitLines($output) as $line) {
- if ($line && preg_match('{^Last Changed Date: ([^(]+)}', $line, $match)) {
- $date = new \DateTime($match[1], new \DateTimeZone('UTC'));
- $composer['time'] = $date->format('Y-m-d H:i:s');
- break;
- }
- }
- }
- $this->cache->write($identifier.'.json', json_encode($composer));
- $this->infoCache[$identifier] = $composer;
- }
- return $this->infoCache[$identifier];
- }
- public function getTags()
- {
- if (null === $this->tags) {
- $this->tags = array();
- if ($this->tagsPath !== false) {
- $output = $this->execute('svn ls --verbose', $this->baseUrl . '/' . $this->tagsPath);
- if ($output) {
- foreach ($this->process->splitLines($output) as $line) {
- $line = trim($line);
- if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) {
- if (isset($match[1]) && isset($match[2]) && $match[2] !== './') {
- $this->tags[rtrim($match[2], '/')] = $this->buildIdentifier(
- '/' . $this->tagsPath . '/' . $match[2],
- $match[1]
- );
- }
- }
- }
- }
- }
- }
- return $this->tags;
- }
- public function getBranches()
- {
- if (null === $this->branches) {
- $this->branches = array();
- if (false === $this->trunkPath) {
- $trunkParent = $this->baseUrl . '/';
- } else {
- $trunkParent = $this->baseUrl . '/' . $this->trunkPath;
- }
- $output = $this->execute('svn ls --verbose', $trunkParent);
- if ($output) {
- foreach ($this->process->splitLines($output) as $line) {
- $line = trim($line);
- if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) {
- if (isset($match[1]) && isset($match[2]) && $match[2] === './') {
- $this->branches['trunk'] = $this->buildIdentifier(
- '/' . $this->trunkPath,
- $match[1]
- );
- $this->rootIdentifier = $this->branches['trunk'];
- break;
- }
- }
- }
- }
- unset($output);
- if ($this->branchesPath !== false) {
- $output = $this->execute('svn ls --verbose', $this->baseUrl . '/' . $this->branchesPath);
- if ($output) {
- foreach ($this->process->splitLines(trim($output)) as $line) {
- $line = trim($line);
- if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) {
- if (isset($match[1]) && isset($match[2]) && $match[2] !== './') {
- $this->branches[rtrim($match[2], '/')] = $this->buildIdentifier(
- '/' . $this->branchesPath . '/' . $match[2],
- $match[1]
- );
- }
- }
- }
- }
- }
- }
- return $this->branches;
- }
- public static function supports(IOInterface $io, Config $config, $url, $deep = false)
- {
- $url = self::normalizeUrl($url);
- if (preg_match('#(^svn://|^svn\+ssh://|svn\.)#i', $url)) {
- return true;
- }
- if (!$deep && !Filesystem::isLocalPath($url)) {
- return false;
- }
- $processExecutor = new ProcessExecutor();
- $exit = $processExecutor->execute(
- "svn info --non-interactive {$url}",
- $ignoredOutput
- );
- if ($exit === 0) {
- return true;
- }
- if (false !== stripos($processExecutor->getErrorOutput(), 'authorization failed:')) {
-
- return true;
- }
- return false;
- }
- protected static function normalizeUrl($url)
- {
- $fs = new Filesystem();
- if ($fs->isAbsolutePath($url)) {
- return 'file://' . strtr($url, '\\', '/');
- }
- return $url;
- }
- protected function execute($command, $url)
- {
- if (null === $this->util) {
- $this->util = new SvnUtil($this->baseUrl, $this->io, $this->config, $this->process);
- $this->util->setCacheCredentials($this->cacheCredentials);
- }
- try {
- return $this->util->execute($command, $url);
- } catch (\RuntimeException $e) {
- if (0 !== $this->process->execute('svn --version', $ignoredOutput)) {
- throw new \RuntimeException('Failed to load '.$this->url.', svn was not found, check that it is installed and in your PATH env.' . "\n\n" . $this->process->getErrorOutput());
- }
- throw new \RuntimeException(
- 'Repository '.$this->url.' could not be processed, '.$e->getMessage()
- );
- }
- }
- protected function buildIdentifier($baseDir, $revision)
- {
- return rtrim($baseDir, '/') . $this->packagePath . '/@' . $revision;
- }
- }
- <?php
- namespace Composer\Repository\Vcs;
- use Composer\Downloader\TransportException;
- use Composer\Config;
- use Composer\Factory;
- use Composer\IO\IOInterface;
- use Composer\Util\ProcessExecutor;
- use Composer\Util\RemoteFilesystem;
- use Composer\Util\Filesystem;
- abstract class VcsDriver implements VcsDriverInterface
- {
- protected $url;
- protected $originUrl;
- protected $repoConfig;
- protected $io;
- protected $config;
- protected $process;
- protected $remoteFilesystem;
- final public function __construct(array $repoConfig, IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null)
- {
- if (Filesystem::isLocalPath($repoConfig['url'])) {
- $repoConfig['url'] = Filesystem::getPlatformPath($repoConfig['url']);
- }
- $this->url = $repoConfig['url'];
- $this->originUrl = $repoConfig['url'];
- $this->repoConfig = $repoConfig;
- $this->io = $io;
- $this->config = $config;
- $this->process = $process ?: new ProcessExecutor($io);
- $this->remoteFilesystem = $remoteFilesystem ?: Factory::createRemoteFilesystem($this->io, $config);
- }
- public function hasComposerFile($identifier)
- {
- try {
- return (bool) $this->getComposerInformation($identifier);
- } catch (TransportException $e) {
- }
- return false;
- }
- protected function getScheme()
- {
- if (extension_loaded('openssl')) {
- return 'https';
- }
- return 'http';
- }
- protected function getContents($url)
- {
- return $this->remoteFilesystem->getContents($this->originUrl, $url, false);
- }
- public function cleanup()
- {
- return;
- }
- }
- <?php
- namespace Composer\Repository\Vcs;
- use Composer\Config;
- use Composer\IO\IOInterface;
- interface VcsDriverInterface
- {
- public function initialize();
- public function getComposerInformation($identifier);
- public function getRootIdentifier();
- public function getBranches();
- public function getTags();
- public function getDist($identifier);
- public function getSource($identifier);
- public function getUrl();
- public function hasComposerFile($identifier);
- public function cleanup();
- public static function supports(IOInterface $io, Config $config, $url, $deep = false);
- }
- <?php
- namespace Composer\Repository;
- use Composer\Downloader\TransportException;
- use Composer\Repository\Vcs\VcsDriverInterface;
- use Composer\Package\Version\VersionParser;
- use Composer\Package\Loader\ArrayLoader;
- use Composer\Package\Loader\ValidatingArrayLoader;
- use Composer\Package\Loader\InvalidPackageException;
- use Composer\Package\Loader\LoaderInterface;
- use Composer\EventDispatcher\EventDispatcher;
- use Composer\IO\IOInterface;
- use Composer\Config;
- class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInterface
- {
- protected $url;
- protected $packageName;
- protected $verbose;
- protected $io;
- protected $config;
- protected $versionParser;
- protected $type;
- protected $loader;
- protected $repoConfig;
- protected $branchErrorOccurred = false;
- public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $dispatcher = null, array $drivers = null)
- {
- $this->drivers = $drivers ?: array(
- 'github' => 'Composer\Repository\Vcs\GitHubDriver',
- 'gitlab' => 'Composer\Repository\Vcs\GitLabDriver',
- 'git-bitbucket' => 'Composer\Repository\Vcs\GitBitbucketDriver',
- 'git' => 'Composer\Repository\Vcs\GitDriver',
- 'hg-bitbucket' => 'Composer\Repository\Vcs\HgBitbucketDriver',
- 'hg' => 'Composer\Repository\Vcs\HgDriver',
- 'perforce' => 'Composer\Repository\Vcs\PerforceDriver',
- 'svn' => 'Composer\Repository\Vcs\SvnDriver',
- );
- $this->url = $repoConfig['url'];
- $this->io = $io;
- $this->type = isset($repoConfig['type']) ? $repoConfig['type'] : 'vcs';
- $this->verbose = $io->isVeryVerbose();
- $this->config = $config;
- $this->repoConfig = $repoConfig;
- }
- public function getRepoConfig()
- {
- return $this->repoConfig;
- }
- public function setLoader(LoaderInterface $loader)
- {
- $this->loader = $loader;
- }
- public function getDriver()
- {
- if (isset($this->drivers[$this->type])) {
- $class = $this->drivers[$this->type];
- $driver = new $class($this->repoConfig, $this->io, $this->config);
- $driver->initialize();
- return $driver;
- }
- foreach ($this->drivers as $driver) {
- if ($driver::supports($this->io, $this->config, $this->url)) {
- $driver = new $driver($this->repoConfig, $this->io, $this->config);
- $driver->initialize();
- return $driver;
- }
- }
- foreach ($this->drivers as $driver) {
- if ($driver::supports($this->io, $this->config, $this->url, true)) {
- $driver = new $driver($this->repoConfig, $this->io, $this->config);
- $driver->initialize();
- return $driver;
- }
- }
- }
- public function hadInvalidBranches()
- {
- return $this->branchErrorOccurred;
- }
- protected function initialize()
- {
- parent::initialize();
- $verbose = $this->verbose;
- $driver = $this->getDriver();
- if (!$driver) {
- throw new \InvalidArgumentException('No driver found to handle VCS repository '.$this->url);
- }
- $this->versionParser = new VersionParser;
- if (!$this->loader) {
- $this->loader = new ArrayLoader($this->versionParser);
- }
- try {
- if ($driver->hasComposerFile($driver->getRootIdentifier())) {
- $data = $driver->getComposerInformation($driver->getRootIdentifier());
- $this->packageName = !empty($data['name']) ? $data['name'] : null;
- }
- } catch (\Exception $e) {
- if ($verbose) {
- $this->io->writeError('<error>Skipped parsing '.$driver->getRootIdentifier().', '.$e->getMessage().'</error>');
- }
- }
- foreach ($driver->getTags() as $tag => $identifier) {
- $msg = 'Reading composer.json of <info>' . ($this->packageName ?: $this->url) . '</info> (<comment>' . $tag . '</comment>)';
- if ($verbose) {
- $this->io->writeError($msg);
- } else {
- $this->io->overwriteError($msg, false);
- }
- $tag = str_replace('release-', '', $tag);
- if (!$parsedTag = $this->validateTag($tag)) {
- if ($verbose) {
- $this->io->writeError('<warning>Skipped tag '.$tag.', invalid tag name</warning>');
- }
- continue;
- }
- try {
- if (!$data = $driver->getComposerInformation($identifier)) {
- if ($verbose) {
- $this->io->writeError('<warning>Skipped tag '.$tag.', no composer file</warning>');
- }
- continue;
- }
- if (isset($data['version'])) {
- $data['version_normalized'] = $this->versionParser->normalize($data['version']);
- } else {
- $data['version'] = $tag;
- $data['version_normalized'] = $parsedTag;
- }
- $data['version'] = preg_replace('{[.-]?dev$}i', '', $data['version']);
- $data['version_normalized'] = preg_replace('{(^dev-|[.-]?dev$)}i', '', $data['version_normalized']);
- if ($data['version_normalized'] !== $parsedTag) {
- if ($verbose) {
- $this->io->writeError('<warning>Skipped tag '.$tag.', tag ('.$parsedTag.') does not match version ('.$data['version_normalized'].') in composer.json</warning>');
- }
- continue;
- }
- if ($verbose) {
- $this->io->writeError('Importing tag '.$tag.' ('.$data['version_normalized'].')');
- }
- $this->addPackage($this->loader->load($this->preProcess($driver, $data, $identifier)));
- } catch (\Exception $e) {
- if ($verbose) {
- $this->io->writeError('<warning>Skipped tag '.$tag.', '.($e instanceof TransportException ? 'no composer file was found' : $e->getMessage()).'</warning>');
- }
- continue;
- }
- }
- if (!$verbose) {
- $this->io->overwriteError('', false);
- }
- foreach ($driver->getBranches() as $branch => $identifier) {
- $msg = 'Reading composer.json of <info>' . ($this->packageName ?: $this->url) . '</info> (<comment>' . $branch . '</comment>)';
- if ($verbose) {
- $this->io->writeError($msg);
- } else {
- $this->io->overwriteError($msg, false);
- }
- if (!$parsedBranch = $this->validateBranch($branch)) {
- if ($verbose) {
- $this->io->writeError('<warning>Skipped branch '.$branch.', invalid name</warning>');
- }
- continue;
- }
- try {
- if (!$data = $driver->getComposerInformation($identifier)) {
- if ($verbose) {
- $this->io->writeError('<warning>Skipped branch '.$branch.', no composer file</warning>');
- }
- continue;
- }
- $data['version'] = $branch;
- $data['version_normalized'] = $parsedBranch;
- if ('dev-' === substr($parsedBranch, 0, 4) || '9999999-dev' === $parsedBranch) {
- $data['version'] = 'dev-' . $data['version'];
- } else {
- $data['version'] = preg_replace('{(\.9{7})+}', '.x', $parsedBranch);
- }
- if ($verbose) {
- $this->io->writeError('Importing branch '.$branch.' ('.$data['version'].')');
- }
- $packageData = $this->preProcess($driver, $data, $identifier);
- $package = $this->loader->load($packageData);
- if ($this->loader instanceof ValidatingArrayLoader && $this->loader->getWarnings()) {
- throw new InvalidPackageException($this->loader->getErrors(), $this->loader->getWarnings(), $packageData);
- }
- $this->addPackage($package);
- } catch (TransportException $e) {
- if ($verbose) {
- $this->io->writeError('<warning>Skipped branch '.$branch.', no composer file was found</warning>');
- }
- continue;
- } catch (\Exception $e) {
- if (!$verbose) {
- $this->io->writeError('');
- }
- $this->branchErrorOccurred = true;
- $this->io->writeError('<error>Skipped branch '.$branch.', '.$e->getMessage().'</error>');
- $this->io->writeError('');
- continue;
- }
- }
- $driver->cleanup();
- if (!$verbose) {
- $this->io->overwriteError('', false);
- }
- if (!$this->getPackages()) {
- throw new InvalidRepositoryException('No valid composer.json was found in any branch or tag of '.$this->url.', could not load a package from it.');
- }
- }
- protected function preProcess(VcsDriverInterface $driver, array $data, $identifier)
- {
- $data['name'] = $this->packageName ?: $data['name'];
- if (!isset($data['dist'])) {
- $data['dist'] = $driver->getDist($identifier);
- }
- if (!isset($data['source'])) {
- $data['source'] = $driver->getSource($identifier);
- }
- return $data;
- }
- private function validateBranch($branch)
- {
- try {
- return $this->versionParser->normalizeBranch($branch);
- } catch (\Exception $e) {
- }
- return false;
- }
- private function validateTag($version)
- {
- try {
- return $this->versionParser->normalize($version);
- } catch (\Exception $e) {
- }
- return false;
- }
- }
- <?php
- namespace Composer\Repository;
- use Composer\Package\AliasPackage;
- class WritableArrayRepository extends ArrayRepository implements WritableRepositoryInterface
- {
- public function write()
- {
- }
- public function reload()
- {
- }
- public function getCanonicalPackages()
- {
- $packages = $this->getPackages();
- $packagesByName = array();
- foreach ($packages as $package) {
- if (!isset($packagesByName[$package->getName()]) || $packagesByName[$package->getName()] instanceof AliasPackage) {
- $packagesByName[$package->getName()] = $package;
- }
- }
- $canonicalPackages = array();
- foreach ($packagesByName as $package) {
- while ($package instanceof AliasPackage) {
- $package = $package->getAliasOf();
- }
- $canonicalPackages[] = $package;
- }
- return $canonicalPackages;
- }
- }
- <?php
- namespace Composer\Repository;
- use Composer\Package\PackageInterface;
- interface WritableRepositoryInterface extends RepositoryInterface
- {
- public function write();
- public function addPackage(PackageInterface $package);
- public function removePackage(PackageInterface $package);
- public function getCanonicalPackages();
- public function reload();
- }
- <?php
- namespace Composer\Script;
- class CommandEvent extends Event
- {
- }
- <?php
- namespace Composer\Script;
- use Composer\Composer;
- use Composer\IO\IOInterface;
- use Composer\EventDispatcher\Event as BaseEvent;
- class Event extends BaseEvent
- {
- private $composer;
- private $io;
- private $devMode;
- public function __construct($name, Composer $composer, IOInterface $io, $devMode = false, array $args = array(), array $flags = array())
- {
- parent::__construct($name, $args, $flags);
- $this->composer = $composer;
- $this->io = $io;
- $this->devMode = $devMode;
- }
- public function getComposer()
- {
- return $this->composer;
- }
- public function getIO()
- {
- return $this->io;
- }
- public function isDevMode()
- {
- return $this->devMode;
- }
- }
- <?php
- namespace Composer\Script;
- use Composer\Installer\PackageEvent as BasePackageEvent;
- class PackageEvent extends BasePackageEvent
- {
- }
- <?php
- namespace Composer\Script;
- class ScriptEvents
- {
- const PRE_INSTALL_CMD = 'pre-install-cmd';
- const POST_INSTALL_CMD = 'post-install-cmd';
- const PRE_UPDATE_CMD = 'pre-update-cmd';
- const POST_UPDATE_CMD = 'post-update-cmd';
- const PRE_STATUS_CMD = 'pre-status-cmd';
- const POST_STATUS_CMD = 'post-status-cmd';
- const PRE_AUTOLOAD_DUMP = 'pre-autoload-dump';
- const POST_AUTOLOAD_DUMP = 'post-autoload-dump';
- const POST_ROOT_PACKAGE_INSTALL = 'post-root-package-install';
- const POST_CREATE_PROJECT_CMD = 'post-create-project-cmd';
- const PRE_ARCHIVE_CMD = 'pre-archive-cmd';
- const POST_ARCHIVE_CMD = 'post-archive-cmd';
- const PRE_PACKAGE_INSTALL = 'pre-package-install';
- const POST_PACKAGE_INSTALL = 'post-package-install';
- const PRE_PACKAGE_UPDATE = 'pre-package-update';
- const POST_PACKAGE_UPDATE = 'post-package-update';
- const PRE_PACKAGE_UNINSTALL = 'pre-package-uninstall';
- const POST_PACKAGE_UNINSTALL = 'post-package-uninstall';
- }
- <?php
- namespace Composer\Util;
- use Composer\Config;
- use Composer\IO\IOInterface;
- class AuthHelper
- {
- protected $io;
- protected $config;
- public function __construct(IOInterface $io, Config $config)
- {
- $this->io = $io;
- $this->config = $config;
- }
- public function storeAuth($originUrl, $storeAuth)
- {
- $store = false;
- $configSource = $this->config->getAuthConfigSource();
- if ($storeAuth === true) {
- $store = $configSource;
- } elseif ($storeAuth === 'prompt') {
- $answer = $this->io->askAndValidate(
- 'Do you want to store credentials for '.$originUrl.' in '.$configSource->getName().' ? [Yn] ',
- function ($value) {
- $input = strtolower(substr(trim($value), 0, 1));
- if (in_array($input, array('y','n'))) {
- return $input;
- }
- throw new \RuntimeException('Please answer (y)es or (n)o');
- },
- null,
- 'y'
- );
- if ($answer === 'y') {
- $store = $configSource;
- }
- }
- if ($store) {
- $store->addConfigSetting(
- 'http-basic.'.$originUrl,
- $this->io->getAuthentication($originUrl)
- );
- }
- }
- }
- <?php
- namespace Composer\Util;
- class ComposerMirror
- {
- public static function processUrl($mirrorUrl, $packageName, $version, $reference, $type)
- {
- if ($reference) {
- $reference = preg_match('{^([a-f0-9]*|%reference%)$}', $reference) ? $reference : md5($reference);
- }
- $version = strpos($version, '/') === false ? $version : md5($version);
- return str_replace(
- array('%package%', '%version%', '%reference%', '%type%'),
- array($packageName, $version, $reference, $type),
- $mirrorUrl
- );
- }
- public static function processGitUrl($mirrorUrl, $packageName, $url, $type)
- {
- if (preg_match('#^(?:(?:https?|git)://github\.com/|git@github\.com:)([^/]+)/(.+?)(?:\.git)?$#', $url, $match)) {
- $url = 'gh-'.$match[1].'/'.$match[2];
- } elseif (preg_match('#^https://bitbucket\.org/([^/]+)/(.+?)(?:\.git)?/?$#', $url, $match)) {
- $url = 'bb-'.$match[1].'/'.$match[2];
- } else {
- $url = preg_replace('{[^a-z0-9_.-]}i', '-', trim($url, '/'));
- }
- return str_replace(
- array('%package%', '%normalizedUrl%', '%type%'),
- array($packageName, $url, $type),
- $mirrorUrl
- );
- }
- public static function processHgUrl($mirrorUrl, $packageName, $url, $type)
- {
- return self::processGitUrl($mirrorUrl, $packageName, $url, $type);
- }
- }
- <?php
- namespace Composer\Util;
- use Composer\Package\Loader\ArrayLoader;
- use Composer\Package\Loader\ValidatingArrayLoader;
- use Composer\Package\Loader\InvalidPackageException;
- use Composer\Json\JsonValidationException;
- use Composer\IO\IOInterface;
- use Composer\Json\JsonFile;
- use Composer\Spdx\SpdxLicenses;
- class ConfigValidator
- {
- private $io;
- public function __construct(IOInterface $io)
- {
- $this->io = $io;
- }
- public function validate($file, $arrayLoaderValidationFlags = ValidatingArrayLoader::CHECK_ALL)
- {
- $errors = array();
- $publishErrors = array();
- $warnings = array();
- $laxValid = false;
- try {
- $json = new JsonFile($file, null, $this->io);
- $manifest = $json->read();
- $json->validateSchema(JsonFile::LAX_SCHEMA);
- $laxValid = true;
- $json->validateSchema();
- } catch (JsonValidationException $e) {
- foreach ($e->getErrors() as $message) {
- if ($laxValid) {
- $publishErrors[] = $message;
- } else {
- $errors[] = $message;
- }
- }
- } catch (\Exception $e) {
- $errors[] = $e->getMessage();
- return array($errors, $publishErrors, $warnings);
- }
- if (!empty($manifest['license'])) {
- if (is_array($manifest['license'])) {
- foreach ($manifest['license'] as $key => $license) {
- if ('proprietary' === $license) {
- unset($manifest['license'][$key]);
- }
- }
- }
- $licenseValidator = new SpdxLicenses();
- if ('proprietary' !== $manifest['license'] && array() !== $manifest['license'] && !$licenseValidator->validate($manifest['license'])) {
- $warnings[] = sprintf(
- 'License %s is not a valid SPDX license identifier, see https://spdx.org/licenses/ if you use an open license.'
- ."\nIf the software is closed-source, you may use \"proprietary\" as license.",
- json_encode($manifest['license'])
- );
- }
- } else {
- $warnings[] = 'No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.';
- }
- if (isset($manifest['version'])) {
- $warnings[] = 'The version field is present, it is recommended to leave it out if the package is published on Packagist.';
- }
- if (!empty($manifest['name']) && preg_match('{[A-Z]}', $manifest['name'])) {
- $suggestName = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $manifest['name']);
- $suggestName = strtolower($suggestName);
- $publishErrors[] = sprintf(
- 'Name "%s" does not match the best practice (e.g. lower-cased/with-dashes). We suggest using "%s" instead. As such you will not be able to submit it to Packagist.',
- $manifest['name'],
- $suggestName
- );
- }
- if (!empty($manifest['type']) && $manifest['type'] == 'composer-installer') {
- $warnings[] = "The package type 'composer-installer' is deprecated. Please distribute your custom installers as plugins from now on. See https://getcomposer.org/doc/articles/plugins.md for plugin documentation.";
- }
- if (isset($manifest['require']) && isset($manifest['require-dev'])) {
- $requireOverrides = array_intersect_key($manifest['require'], $manifest['require-dev']);
- if (!empty($requireOverrides)) {
- $plural = (count($requireOverrides) > 1) ? 'are' : 'is';
- $warnings[] = implode(', ', array_keys($requireOverrides)). " {$plural} required both in require and require-dev, this can lead to unexpected behavior";
- }
- }
- $require = isset($manifest['require']) ? $manifest['require'] : array();
- $requireDev = isset($manifest['require-dev']) ? $manifest['require-dev'] : array();
- $packages = array_merge($require, $requireDev);
- foreach ($packages as $package => $version) {
- if (preg_match('/#/', $version) === 1) {
- $warnings[] = sprintf(
- 'The package "%s" is pointing to a commit-ref, this is bad practice and can cause unforeseen issues.',
- $package
- );
- }
- }
- if (isset($manifest['autoload']['psr-0'][''])) {
- $warnings[] = "Defining autoload.psr-0 with an empty namespace prefix is a bad idea for performance";
- }
- if (isset($manifest['autoload']['psr-4'][''])) {
- $warnings[] = "Defining autoload.psr-4 with an empty namespace prefix is a bad idea for performance";
- }
- try {
- $loader = new ValidatingArrayLoader(new ArrayLoader(), true, null, $arrayLoaderValidationFlags);
- if (!isset($manifest['version'])) {
- $manifest['version'] = '1.0.0';
- }
- if (!isset($manifest['name'])) {
- $manifest['name'] = 'dummy/dummy';
- }
- $loader->load($manifest);
- } catch (InvalidPackageException $e) {
- $errors = array_merge($errors, $e->getErrors());
- }
- $warnings = array_merge($warnings, $loader->getWarnings());
- return array($errors, $publishErrors, $warnings);
- }
- }
- <?php
- namespace Composer\Util;
- use Composer\IO\IOInterface;
- class ErrorHandler
- {
- private static $io;
- public static function handle($level, $message, $file, $line)
- {
- if (!(error_reporting() & $level)) {
- return;
- }
- if (ini_get('xdebug.scream')) {
- $message .= "\n\nWarning: You have xdebug.scream enabled, the warning above may be".
- "\na legitimately suppressed error that you were not supposed to see.";
- }
- if ($level !== E_DEPRECATED && $level !== E_USER_DEPRECATED) {
- throw new \ErrorException($message, 0, $level, $file, $line);
- }
- if (self::$io) {
- self::$io->writeError('<warning>Deprecation Notice: '.$message.' in '.$file.':'.$line.'</warning>');
- if (self::$io->isVerbose()) {
- self::$io->writeError('<warning>Stack trace:</warning>');
- self::$io->writeError(array_filter(array_map(function ($a) {
- if (isset($a['line'], $a['file'])) {
- return '<warning> '.$a['file'].':'.$a['line'].'</warning>';
- }
- return null;
- }, array_slice(debug_backtrace(), 2))));
- }
- }
- }
- public static function register(IOInterface $io = null)
- {
- set_error_handler(array(__CLASS__, 'handle'));
- error_reporting(E_ALL | E_STRICT);
- self::$io = $io;
- }
- }
- <?php
- namespace Composer\Util;
- use RecursiveDirectoryIterator;
- use RecursiveIteratorIterator;
- use Symfony\Component\Filesystem\Exception\IOException;
- use Symfony\Component\Finder\Finder;
- class Filesystem
- {
- private $processExecutor;
- public function __construct(ProcessExecutor $executor = null)
- {
- $this->processExecutor = $executor ?: new ProcessExecutor();
- }
- public function remove($file)
- {
- if (is_dir($file)) {
- return $this->removeDirectory($file);
- }
- if (file_exists($file)) {
- return $this->unlink($file);
- }
- return false;
- }
- public function isDirEmpty($dir)
- {
- $finder = Finder::create()
- ->ignoreVCS(false)
- ->ignoreDotFiles(false)
- ->depth(0)
- ->in($dir);
- return count($finder) === 0;
- }
- public function emptyDirectory($dir, $ensureDirectoryExists = true)
- {
- if (file_exists($dir) && is_link($dir)) {
- $this->unlink($dir);
- }
- if ($ensureDirectoryExists) {
- $this->ensureDirectoryExists($dir);
- }
- if (is_dir($dir)) {
- $finder = Finder::create()
- ->ignoreVCS(false)
- ->ignoreDotFiles(false)
- ->depth(0)
- ->in($dir);
- foreach ($finder as $path) {
- $this->remove((string) $path);
- }
- }
- }
- public function removeDirectory($directory)
- {
- if ($this->isSymlinkedDirectory($directory)) {
- return $this->unlinkSymlinkedDirectory($directory);
- }
- if ($this->isJunction($directory)) {
- return $this->removeJunction($directory);
- }
- if (!file_exists($directory) || !is_dir($directory)) {
- return true;
- }
- if (preg_match('{^(?:[a-z]:)?[/\\\\]+$}i', $directory)) {
- throw new \RuntimeException('Aborting an attempted deletion of '.$directory.', this was probably not intended, if it is a real use case please report it.');
- }
- if (!function_exists('proc_open')) {
- return $this->removeDirectoryPhp($directory);
- }
- if (Platform::isWindows()) {
- $cmd = sprintf('rmdir /S /Q %s', ProcessExecutor::escape(realpath($directory)));
- } else {
- $cmd = sprintf('rm -rf %s', ProcessExecutor::escape($directory));
- }
- $result = $this->getProcess()->execute($cmd, $output) === 0;
- clearstatcache();
- if ($result && !file_exists($directory)) {
- return true;
- }
- return $this->removeDirectoryPhp($directory);
- }
- public function removeDirectoryPhp($directory)
- {
- $it = new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS);
- $ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
- foreach ($ri as $file) {
- if ($file->isDir()) {
- $this->rmdir($file->getPathname());
- } else {
- $this->unlink($file->getPathname());
- }
- }
- return $this->rmdir($directory);
- }
- public function ensureDirectoryExists($directory)
- {
- if (!is_dir($directory)) {
- if (file_exists($directory)) {
- throw new \RuntimeException(
- $directory.' exists and is not a directory.'
- );
- }
- if (!@mkdir($directory, 0777, true)) {
- throw new \RuntimeException(
- $directory.' does not exist and could not be created.'
- );
- }
- }
- }
- public function unlink($path)
- {
- if (!@$this->unlinkImplementation($path)) {
- if (!Platform::isWindows() || (usleep(350000) && !@$this->unlinkImplementation($path))) {
- $error = error_get_last();
- $message = 'Could not delete '.$path.': ' . @$error['message'];
- if (Platform::isWindows()) {
- $message .= "\nThis can be due to an antivirus or the Windows Search Indexer locking the file while they are analyzed";
- }
- throw new \RuntimeException($message);
- }
- }
- return true;
- }
- public function rmdir($path)
- {
- if (!@rmdir($path)) {
- if (!Platform::isWindows() || (usleep(350000) && !@rmdir($path))) {
- $error = error_get_last();
- $message = 'Could not delete '.$path.': ' . @$error['message'];
- if (Platform::isWindows()) {
- $message .= "\nThis can be due to an antivirus or the Windows Search Indexer locking the file while they are analyzed";
- }
- throw new \RuntimeException($message);
- }
- }
- return true;
- }
- public function copyThenRemove($source, $target)
- {
- if (!is_dir($source)) {
- copy($source, $target);
- $this->unlink($source);
- return;
- }
- $it = new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS);
- $ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST);
- $this->ensureDirectoryExists($target);
- foreach ($ri as $file) {
- $targetPath = $target . DIRECTORY_SEPARATOR . $ri->getSubPathName();
- if ($file->isDir()) {
- $this->ensureDirectoryExists($targetPath);
- } else {
- copy($file->getPathname(), $targetPath);
- }
- }
- $this->removeDirectoryPhp($source);
- }
- public function rename($source, $target)
- {
- if (true === @rename($source, $target)) {
- return;
- }
- if (!function_exists('proc_open')) {
- return $this->copyThenRemove($source, $target);
- }
- if (Platform::isWindows()) {
- $command = sprintf('xcopy %s %s /E /I /Q /Y', ProcessExecutor::escape($source), ProcessExecutor::escape($target));
- $result = $this->processExecutor->execute($command, $output);
- clearstatcache();
- if (0 === $result) {
- $this->remove($source);
- return;
- }
- } else {
-
- $command = sprintf('mv %s %s', ProcessExecutor::escape($source), ProcessExecutor::escape($target));
- $result = $this->processExecutor->execute($command, $output);
- clearstatcache();
- if (0 === $result) {
- return;
- }
- }
- return $this->copyThenRemove($source, $target);
- }
- public function findShortestPath($from, $to, $directories = false)
- {
- if (!$this->isAbsolutePath($from) || !$this->isAbsolutePath($to)) {
- throw new \InvalidArgumentException(sprintf('$from (%s) and $to (%s) must be absolute paths.', $from, $to));
- }
- $from = lcfirst($this->normalizePath($from));
- $to = lcfirst($this->normalizePath($to));
- if ($directories) {
- $from = rtrim($from, '/') . '/dummy_file';
- }
- if (dirname($from) === dirname($to)) {
- return './'.basename($to);
- }
- $commonPath = $to;
- while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath)) {
- $commonPath = strtr(dirname($commonPath), '\\', '/');
- }
- if (0 !== strpos($from, $commonPath) || '/' === $commonPath) {
- return $to;
- }
- $commonPath = rtrim($commonPath, '/') . '/';
- $sourcePathDepth = substr_count(substr($from, strlen($commonPath)), '/');
- $commonPathCode = str_repeat('../', $sourcePathDepth);
- return ($commonPathCode . substr($to, strlen($commonPath))) ?: './';
- }
- public function findShortestPathCode($from, $to, $directories = false)
- {
- if (!$this->isAbsolutePath($from) || !$this->isAbsolutePath($to)) {
- throw new \InvalidArgumentException(sprintf('$from (%s) and $to (%s) must be absolute paths.', $from, $to));
- }
- $from = lcfirst($this->normalizePath($from));
- $to = lcfirst($this->normalizePath($to));
- if ($from === $to) {
- return $directories ? '__DIR__' : '__FILE__';
- }
- $commonPath = $to;
- while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath) && '.' !== $commonPath) {
- $commonPath = strtr(dirname($commonPath), '\\', '/');
- }
- if (0 !== strpos($from, $commonPath) || '/' === $commonPath || '.' === $commonPath) {
- return var_export($to, true);
- }
- $commonPath = rtrim($commonPath, '/') . '/';
- if (strpos($to, $from.'/') === 0) {
- return '__DIR__ . '.var_export(substr($to, strlen($from)), true);
- }
- $sourcePathDepth = substr_count(substr($from, strlen($commonPath)), '/') + $directories;
- $commonPathCode = str_repeat('dirname(', $sourcePathDepth).'__DIR__'.str_repeat(')', $sourcePathDepth);
- $relTarget = substr($to, strlen($commonPath));
- return $commonPathCode . (strlen($relTarget) ? '.' . var_export('/' . $relTarget, true) : '');
- }
- public function isAbsolutePath($path)
- {
- return substr($path, 0, 1) === '/' || substr($path, 1, 1) === ':';
- }
- public function size($path)
- {
- if (!file_exists($path)) {
- throw new \RuntimeException("$path does not exist.");
- }
- if (is_dir($path)) {
- return $this->directorySize($path);
- }
- return filesize($path);
- }
- public function normalizePath($path)
- {
- $parts = array();
- $path = strtr($path, '\\', '/');
- $prefix = '';
- $absolute = false;
- if (preg_match('{^([0-9a-z]+:(?://(?:[a-z]:)?)?)}i', $path, $match)) {
- $prefix = $match[1];
- $path = substr($path, strlen($prefix));
- }
- if (substr($path, 0, 1) === '/') {
- $absolute = true;
- $path = substr($path, 1);
- }
- $up = false;
- foreach (explode('/', $path) as $chunk) {
- if ('..' === $chunk && ($absolute || $up)) {
- array_pop($parts);
- $up = !(empty($parts) || '..' === end($parts));
- } elseif ('.' !== $chunk && '' !== $chunk) {
- $parts[] = $chunk;
- $up = '..' !== $chunk;
- }
- }
- return $prefix.($absolute ? '/' : '').implode('/', $parts);
- }
- public static function isLocalPath($path)
- {
- return (bool) preg_match('{^(file://|/|[a-z]:[\\\\/]|\.\.[\\\\/]|[a-z0-9_.-]+[\\\\/])}i', $path);
- }
- public static function getPlatformPath($path)
- {
- if (Platform::isWindows()) {
- $path = preg_replace('{^(?:file:///([a-z])/)}i', 'file://$1:/', $path);
- }
- return preg_replace('{^file://}i', '', $path);
- }
- protected function directorySize($directory)
- {
- $it = new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS);
- $ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
- $size = 0;
- foreach ($ri as $file) {
- if ($file->isFile()) {
- $size += $file->getSize();
- }
- }
- return $size;
- }
- protected function getProcess()
- {
- return new ProcessExecutor;
- }
- private function unlinkImplementation($path)
- {
- if (Platform::isWindows() && is_dir($path) && is_link($path)) {
- return rmdir($path);
- }
- return unlink($path);
- }
- public function relativeSymlink($target, $link)
- {
- $cwd = getcwd();
- $relativePath = $this->findShortestPath($link, $target);
- chdir(dirname($link));
- $result = @symlink($relativePath, $link);
- chdir($cwd);
- return (bool) $result;
- }
- public function isSymlinkedDirectory($directory)
- {
- if (!is_dir($directory)) {
- return false;
- }
- $resolved = $this->resolveSymlinkedDirectorySymlink($directory);
- return is_link($resolved);
- }
- private function unlinkSymlinkedDirectory($directory)
- {
- $resolved = $this->resolveSymlinkedDirectorySymlink($directory);
- return $this->unlink($resolved);
- }
- private function resolveSymlinkedDirectorySymlink($pathname)
- {
- if (!is_dir($pathname)) {
- return $pathname;
- }
- $resolved = rtrim($pathname, '/');
- if (!strlen($resolved)) {
- return $pathname;
- }
- return $resolved;
- }
- public function junction($target, $junction)
- {
- if (!Platform::isWindows()) {
- throw new \LogicException(sprintf('Function %s is not available on non-Windows platform', __CLASS__));
- }
- if (!is_dir($target)) {
- throw new IOException(sprintf('Cannot junction to "%s" as it is not a directory.', $target), 0, null, $target);
- }
- $cmd = sprintf('mklink /J %s %s',
- ProcessExecutor::escape(str_replace('/', DIRECTORY_SEPARATOR, $junction)),
- ProcessExecutor::escape(realpath($target)));
- if ($this->getProcess()->execute($cmd, $output) !== 0) {
- throw new IOException(sprintf('Failed to create junction to "%s" at "%s".', $target, $junction), 0, null, $target);
- }
- }
- public function isJunction($junction)
- {
- if (!Platform::isWindows()) {
- return false;
- }
- if (!is_dir($junction) || is_link($junction)) {
- return false;
- }
- $stat = lstat($junction);
- return ($stat['mode'] === 0);
- }
- public function removeJunction($junction)
- {
- if (!Platform::isWindows()) {
- return false;
- }
- $junction = rtrim(str_replace('/', DIRECTORY_SEPARATOR, $junction), DIRECTORY_SEPARATOR);
- if (!$this->isJunction($junction)) {
- throw new IOException(sprintf('%s is not a junction and thus cannot be removed as one', $junction));
- }
- $cmd = sprintf('rmdir /S /Q %s', ProcessExecutor::escape($junction));
- return ($this->getProcess()->execute($cmd, $output) === 0);
- }
- }
- <?php
- namespace Composer\Util;
- use Composer\Config;
- use Composer\IO\IOInterface;
- class Git
- {
- protected $io;
- protected $config;
- protected $process;
- protected $filesystem;
- public function __construct(IOInterface $io, Config $config, ProcessExecutor $process, Filesystem $fs)
- {
- $this->io = $io;
- $this->config = $config;
- $this->process = $process;
- $this->filesystem = $fs;
- }
- public function runCommand($commandCallable, $url, $cwd, $initialClone = false)
- {
- if ($initialClone) {
- $origCwd = $cwd;
- $cwd = null;
- }
- if (preg_match('{^ssh://[^@]+@[^:]+:[^0-9]+}', $url)) {
- throw new \InvalidArgumentException('The source URL '.$url.' is invalid, ssh URLs should have a port number after ":".'."\n".'Use ssh://git@example.com:22/path or just git@example.com:path if you do not want to provide a password or custom port.');
- }
- if (!$initialClone) {
- $this->process->execute('git remote -v', $output, $cwd);
- if (preg_match('{^(?:composer|origin)\s+https?://(.+):(.+)@([^/]+)}im', $output, $match)) {
- $this->io->setAuthentication($match[3], urldecode($match[1]), urldecode($match[2]));
- }
- }
- $protocols = $this->config->get('github-protocols');
- if (!is_array($protocols)) {
- throw new \RuntimeException('Config value "github-protocols" must be an array, got '.gettype($protocols));
- }
- if (preg_match('{^(?:https?|git)://'.self::getGitHubDomainsRegex($this->config).'/(.*)}', $url, $match)) {
- $messages = array();
- foreach ($protocols as $protocol) {
- if ('ssh' === $protocol) {
- $url = "git@" . $match[1] . ":" . $match[2];
- } else {
- $url = $protocol ."://" . $match[1] . "/" . $match[2];
- }
- if (0 === $this->process->execute(call_user_func($commandCallable, $url), $ignoredOutput, $cwd)) {
- return;
- }
- $messages[] = '- ' . $url . "\n" . preg_replace('#^#m', ' ', $this->process->getErrorOutput());
- if ($initialClone) {
- $this->filesystem->removeDirectory($origCwd);
- }
- }
- $this->throwException('Failed to clone ' . self::sanitizeUrl($url) .' via '.implode(', ', $protocols).' protocols, aborting.' . "\n\n" . implode("\n", $messages), $url);
- }
- $bypassSshForGitHub = preg_match('{^git@'.self::getGitHubDomainsRegex($this->config).':(.+?)\.git$}i', $url) && !in_array('ssh', $protocols, true);
- $command = call_user_func($commandCallable, $url);
- $auth = null;
- if ($bypassSshForGitHub || 0 !== $this->process->execute($command, $ignoredOutput, $cwd)) {
- if (preg_match('{^git@'.self::getGitHubDomainsRegex($this->config).':(.+?)\.git$}i', $url, $match)) {
- if (!$this->io->hasAuthentication($match[1])) {
- $gitHubUtil = new GitHub($this->io, $this->config, $this->process);
- $message = 'Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos';
- if (!$gitHubUtil->authorizeOAuth($match[1]) && $this->io->isInteractive()) {
- $gitHubUtil->authorizeOAuthInteractively($match[1], $message);
- }
- }
- if ($this->io->hasAuthentication($match[1])) {
- $auth = $this->io->getAuthentication($match[1]);
- $url = 'https://'.rawurlencode($auth['username']) . ':' . rawurlencode($auth['password']) . '@'.$match[1].'/'.$match[2].'.git';
- $command = call_user_func($commandCallable, $url);
- if (0 === $this->process->execute($command, $ignoredOutput, $cwd)) {
- return;
- }
- }
- } elseif ($this->isAuthenticationFailure($url, $match)) {
- if (strpos($match[2], '@')) {
- list($authParts, $match[2]) = explode('@', $match[2], 2);
- }
- $storeAuth = false;
- if ($this->io->hasAuthentication($match[2])) {
- $auth = $this->io->getAuthentication($match[2]);
- } elseif ($this->io->isInteractive()) {
- $defaultUsername = null;
- if (isset($authParts) && $authParts) {
- if (false !== strpos($authParts, ':')) {
- list($defaultUsername, ) = explode(':', $authParts, 2);
- } else {
- $defaultUsername = $authParts;
- }
- }
- $this->io->writeError(' Authentication required (<info>'.parse_url($url, PHP_URL_HOST).'</info>):');
- $auth = array(
- 'username' => $this->io->ask(' Username: ', $defaultUsername),
- 'password' => $this->io->askAndHideAnswer(' Password: '),
- );
- $storeAuth = $this->config->get('store-auths');
- }
- if ($auth) {
- $url = $match[1].rawurlencode($auth['username']).':'.rawurlencode($auth['password']).'@'.$match[2].$match[3];
- $command = call_user_func($commandCallable, $url);
- if (0 === $this->process->execute($command, $ignoredOutput, $cwd)) {
- $this->io->setAuthentication($match[2], $auth['username'], $auth['password']);
- $authHelper = new AuthHelper($this->io, $this->config);
- $authHelper->storeAuth($match[2], $storeAuth);
- return;
- }
- }
- }
- if ($initialClone) {
- $this->filesystem->removeDirectory($origCwd);
- }
- $this->throwException('Failed to execute ' . self::sanitizeUrl($command) . "\n\n" . $this->process->getErrorOutput(), $url);
- }
- }
- private function isAuthenticationFailure($url, &$match)
- {
- if (!preg_match('{(https?://)([^/]+)(.*)$}i', $url, $match)) {
- return false;
- }
- $authFailures = array('fatal: Authentication failed', 'remote error: Invalid username or password.');
- foreach ($authFailures as $authFailure) {
- if (strpos($this->process->getErrorOutput(), $authFailure) !== false) {
- return true;
- }
- }
- return false;
- }
- public static function cleanEnv()
- {
- if (ini_get('safe_mode') && false === strpos(ini_get('safe_mode_allowed_env_vars'), 'GIT_ASKPASS')) {
- throw new \RuntimeException('safe_mode is enabled and safe_mode_allowed_env_vars does not contain GIT_ASKPASS, can not set env var. You can disable safe_mode with "-dsafe_mode=0" when running composer');
- }
- if (getenv('GIT_ASKPASS') !== 'echo') {
- putenv('GIT_ASKPASS=echo');
- unset($_SERVER['GIT_ASKPASS']);
- }
- if (getenv('GIT_DIR')) {
- putenv('GIT_DIR');
- unset($_SERVER['GIT_DIR']);
- }
- if (getenv('GIT_WORK_TREE')) {
- putenv('GIT_WORK_TREE');
- unset($_SERVER['GIT_WORK_TREE']);
- }
- if (getenv('LANGUAGE') !== 'C') {
- putenv('LANGUAGE=C');
- }
- putenv("DYLD_LIBRARY_PATH");
- unset($_SERVER['DYLD_LIBRARY_PATH']);
- }
- public static function getGitHubDomainsRegex(Config $config)
- {
- return '('.implode('|', array_map('preg_quote', $config->get('github-domains'))).')';
- }
- public static function sanitizeUrl($message)
- {
- return preg_replace('{://([^@]+?):.+?@}', '://$1:***@', $message);
- }
- private function throwException($message, $url)
- {
- clearstatcache();
- if (0 !== $this->process->execute('git --version', $ignoredOutput)) {
- throw new \RuntimeException('Failed to clone '.self::sanitizeUrl($url).', git was not found, check that it is installed and in your PATH env.' . "\n\n" . $this->process->getErrorOutput());
- }
- throw new \RuntimeException($message);
- }
- }
- <?php
- namespace Composer\Util;
- use Composer\Factory;
- use Composer\IO\IOInterface;
- use Composer\Config;
- use Composer\Downloader\TransportException;
- class GitHub
- {
- protected $io;
- protected $config;
- protected $process;
- protected $remoteFilesystem;
- public function __construct(IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null)
- {
- $this->io = $io;
- $this->config = $config;
- $this->process = $process ?: new ProcessExecutor;
- $this->remoteFilesystem = $remoteFilesystem ?: Factory::createRemoteFilesystem($this->io, $config);
- }
- public function authorizeOAuth($originUrl)
- {
- if (!in_array($originUrl, $this->config->get('github-domains'))) {
- return false;
- }
- if (0 === $this->process->execute('git config github.accesstoken', $output)) {
- $this->io->setAuthentication($originUrl, trim($output), 'x-oauth-basic');
- return true;
- }
- return false;
- }
- public function authorizeOAuthInteractively($originUrl, $message = null)
- {
- if ($message) {
- $this->io->writeError($message);
- }
- $note = 'Composer';
- if ($this->config->get('github-expose-hostname') === true && 0 === $this->process->execute('hostname', $output)) {
- $note .= ' on ' . trim($output);
- }
- $note .= ' ' . date('Y-m-d Hi');
- $url = 'https://'.$originUrl.'/settings/tokens/new?scopes=repo&description=' . str_replace('%20', '+', rawurlencode($note));
- $this->io->writeError(sprintf('Head to %s', $url));
- $this->io->writeError(sprintf('to retrieve a token. It will be stored in "%s" for future use by Composer.', $this->config->getAuthConfigSource()->getName()));
- $token = trim($this->io->askAndHideAnswer('Token (hidden): '));
- if (!$token) {
- $this->io->writeError('<warning>No token given, aborting.</warning>');
- $this->io->writeError('You can also add it manually later by using "composer config github-oauth.github.com <token>"');
- return false;
- }
- $this->io->setAuthentication($originUrl, $token, 'x-oauth-basic');
- try {
- $apiUrl = ('github.com' === $originUrl) ? 'api.github.com/' : $originUrl . '/api/v3/';
- $this->remoteFilesystem->getContents($originUrl, 'https://'. $apiUrl, false, array(
- 'retry-auth-failure' => false,
- ));
- } catch (TransportException $e) {
- if (in_array($e->getCode(), array(403, 401))) {
- $this->io->writeError('<error>Invalid token provided.</error>');
- $this->io->writeError('You can also add it manually later by using "composer config github-oauth.github.com <token>"');
- return false;
- }
- throw $e;
- }
- $this->config->getConfigSource()->removeConfigSetting('github-oauth.'.$originUrl);
- $this->config->getAuthConfigSource()->addConfigSetting('github-oauth.'.$originUrl, $token);
- $this->io->writeError('<info>Token stored successfully.</info>');
- return true;
- }
- }
- <?php
- namespace Composer\Util;
- use Composer\IO\IOInterface;
- use Composer\Config;
- use Composer\Factory;
- use Composer\Downloader\TransportException;
- use Composer\Json\JsonFile;
- class GitLab
- {
- protected $io;
- protected $config;
- protected $process;
- protected $remoteFilesystem;
- public function __construct(IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null)
- {
- $this->io = $io;
- $this->config = $config;
- $this->process = $process ?: new ProcessExecutor();
- $this->remoteFilesystem = $remoteFilesystem ?: Factory::createRemoteFilesystem($this->io, $config);
- }
- public function authorizeOAuth($originUrl)
- {
- if (!in_array($originUrl, $this->config->get('gitlab-domains'), true)) {
- return false;
- }
- if (0 === $this->process->execute('git config gitlab.accesstoken', $output)) {
- $this->io->setAuthentication($originUrl, trim($output), 'oauth2');
- return true;
- }
- return false;
- }
- public function authorizeOAuthInteractively($scheme, $originUrl, $message = null)
- {
- if ($message) {
- $this->io->writeError($message);
- }
- $this->io->writeError(sprintf('A token will be created and stored in "%s", your password will never be stored', $this->config->getAuthConfigSource()->getName()));
- $this->io->writeError('To revoke access to this token you can visit '.$originUrl.'/profile/applications');
- $attemptCounter = 0;
- while ($attemptCounter++ < 5) {
- try {
- $response = $this->createToken($scheme, $originUrl);
- } catch (TransportException $e) {
-
- if (in_array($e->getCode(), array(403, 401))) {
- if (401 === $e->getCode()) {
- $this->io->writeError('Bad credentials.');
- } else {
- $this->io->writeError('Maximum number of login attempts exceeded. Please try again later.');
- }
- $this->io->writeError('You can also manually create a personal token at '.$scheme.'://'.$originUrl.'/profile/applications');
- $this->io->writeError('Add it using "composer config gitlab-oauth.'.$originUrl.' <token>"');
- continue;
- }
- throw $e;
- }
- $this->io->setAuthentication($originUrl, $response['access_token'], 'oauth2');
- $this->config->getAuthConfigSource()->addConfigSetting('gitlab-oauth.'.$originUrl, $response['access_token']);
- return true;
- }
- throw new \RuntimeException('Invalid GitLab credentials 5 times in a row, aborting.');
- }
- private function createToken($scheme, $originUrl)
- {
- $username = $this->io->ask('Username: ');
- $password = $this->io->askAndHideAnswer('Password: ');
- $headers = array('Content-Type: application/x-www-form-urlencoded');
- $apiUrl = $originUrl;
- $data = http_build_query(array(
- 'username' => $username,
- 'password' => $password,
- 'grant_type' => 'password',
- ));
- $options = array(
- 'retry-auth-failure' => false,
- 'http' => array(
- 'method' => 'POST',
- 'header' => $headers,
- 'content' => $data,
- ),
- );
- $json = $this->remoteFilesystem->getContents($originUrl, $scheme.'://'.$apiUrl.'/oauth/token', false, $options);
- $this->io->writeError('Token successfully created');
- return JsonFile::parseJson($json);
- }
- }
- <?php
- namespace Composer\Util;
- class Keys
- {
- public static function fingerprint($path)
- {
- $hash = strtoupper(hash('sha256', preg_replace('{\s}', '', file_get_contents($path))));
- return implode(' ', array(
- substr($hash, 0, 8),
- substr($hash, 8, 8),
- substr($hash, 16, 8),
- substr($hash, 24, 8),
- '',
- substr($hash, 32, 8),
- substr($hash, 40, 8),
- substr($hash, 48, 8),
- substr($hash, 56, 8),
- ));
- }
- }
- <?php
- namespace Composer\Util;
- class NoProxyPattern
- {
- protected $rules = array();
- public function __construct($pattern)
- {
- $this->rules = preg_split("/[\s,]+/", $pattern);
- }
- public function test($url)
- {
- $host = parse_url($url, PHP_URL_HOST);
- $port = parse_url($url, PHP_URL_PORT);
- if (empty($port)) {
- switch (parse_url($url, PHP_URL_SCHEME)) {
- case 'http':
- $port = 80;
- break;
- case 'https':
- $port = 443;
- break;
- }
- }
- foreach ($this->rules as $rule) {
- if ($rule == '*') {
- return true;
- }
- $match = false;
- list($ruleHost) = explode(':', $rule);
- list($base) = explode('/', $ruleHost);
- if (filter_var($base, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
- if (!isset($ip)) {
- $ip = gethostbyname($host);
- }
- if (strpos($ruleHost, '/') === false) {
- $match = $ip === $ruleHost;
- } else {
-
- if ($ip === $host) {
- $match = false;
- } else {
- $match = self::inCIDRBlock($ruleHost, $ip);
- }
- }
- } else {
- $haystack = '.' . trim($host, '.') . '.';
- $needle = '.'. trim($ruleHost, '.') .'.';
- $match = stripos(strrev($haystack), strrev($needle)) === 0;
- }
- if ($match && strpos($rule, ':') !== false) {
- list(, $rulePort) = explode(':', $rule);
- if (!empty($rulePort) && $port != $rulePort) {
- $match = false;
- }
- }
- if ($match) {
- return true;
- }
- }
- return false;
- }
- private static function inCIDRBlock($cidr, $ip)
- {
- list($base, $bits) = explode('/', $cidr);
- list($a, $b, $c, $d) = explode('.', $base);
- $i = ($a << 24) + ($b << 16) + ($c << 8) + $d;
- $mask = $bits == 0 ? 0 : (~0 << (32 - $bits));
- $low = $i & $mask;
- $high = $i | (~$mask & 0xFFFFFFFF);
- list($a, $b, $c, $d) = explode('.', $ip);
- $check = ($a << 24) + ($b << 16) + ($c << 8) + $d;
-
- return $check >= $low && $check <= $high;
- }
- }
- <?php
- namespace Composer\Util;
- use Composer\IO\IOInterface;
- use Symfony\Component\Process\Process;
- class Perforce
- {
- protected $path;
- protected $p4Depot;
- protected $p4Client;
- protected $p4User;
- protected $p4Password;
- protected $p4Port;
- protected $p4Stream;
- protected $p4ClientSpec;
- protected $p4DepotType;
- protected $p4Branch;
- protected $process;
- protected $uniquePerforceClientName;
- protected $windowsFlag;
- protected $commandResult;
- protected $io;
- protected $filesystem;
- public function __construct($repoConfig, $port, $path, ProcessExecutor $process, $isWindows, IOInterface $io)
- {
- $this->windowsFlag = $isWindows;
- $this->p4Port = $port;
- $this->initializePath($path);
- $this->process = $process;
- $this->initialize($repoConfig);
- $this->io = $io;
- }
- public static function create($repoConfig, $port, $path, ProcessExecutor $process, IOInterface $io)
- {
- return new Perforce($repoConfig, $port, $path, $process, Platform::isWindows(), $io);
- }
- public static function checkServerExists($url, ProcessExecutor $processExecutor)
- {
- $output = null;
- return 0 === $processExecutor->execute('p4 -p ' . $url . ' info -s', $output);
- }
- public function initialize($repoConfig)
- {
- $this->uniquePerforceClientName = $this->generateUniquePerforceClientName();
- if (null == $repoConfig) {
- return;
- }
- if (isset($repoConfig['unique_perforce_client_name'])) {
- $this->uniquePerforceClientName = $repoConfig['unique_perforce_client_name'];
- }
- if (isset($repoConfig['depot'])) {
- $this->p4Depot = $repoConfig['depot'];
- }
- if (isset($repoConfig['branch'])) {
- $this->p4Branch = $repoConfig['branch'];
- }
- if (isset($repoConfig['p4user'])) {
- $this->p4User = $repoConfig['p4user'];
- } else {
- $this->p4User = $this->getP4variable('P4USER');
- }
- if (isset($repoConfig['p4password'])) {
- $this->p4Password = $repoConfig['p4password'];
- }
- }
- public function initializeDepotAndBranch($depot, $branch)
- {
- if (isset($depot)) {
- $this->p4Depot = $depot;
- }
- if (isset($branch)) {
- $this->p4Branch = $branch;
- }
- }
- public function generateUniquePerforceClientName()
- {
- return gethostname() . "_" . time();
- }
- public function cleanupClientSpec()
- {
- $client = $this->getClient();
- $task = 'client -d ' . $client;
- $useP4Client = false;
- $command = $this->generateP4Command($task, $useP4Client);
- $this->executeCommand($command);
- $clientSpec = $this->getP4ClientSpec();
- $fileSystem = $this->getFilesystem();
- $fileSystem->remove($clientSpec);
- }
- protected function executeCommand($command)
- {
- $this->commandResult = "";
- $exit_code = $this->process->execute($command, $this->commandResult);
- return $exit_code;
- }
- public function getClient()
- {
- if (!isset($this->p4Client)) {
- $cleanStreamName = str_replace('@', '', str_replace('/', '_', str_replace('//', '', $this->getStream())));
- $this->p4Client = 'composer_perforce_' . $this->uniquePerforceClientName . '_' . $cleanStreamName;
- }
- return $this->p4Client;
- }
- protected function getPath()
- {
- return $this->path;
- }
- public function initializePath($path)
- {
- $this->path = $path;
- $fs = $this->getFilesystem();
- $fs->ensureDirectoryExists($path);
- }
- protected function getPort()
- {
- return $this->p4Port;
- }
- public function setStream($stream)
- {
- $this->p4Stream = $stream;
- $index = strrpos($stream, '/');
- if ($index > 2) {
- $this->p4DepotType = 'stream';
- }
- }
- public function isStream()
- {
- return (strcmp($this->p4DepotType, 'stream') === 0);
- }
- public function getStream()
- {
- if (!isset($this->p4Stream)) {
- if ($this->isStream()) {
- $this->p4Stream = '//' . $this->p4Depot . '/' . $this->p4Branch;
- } else {
- $this->p4Stream = '//' . $this->p4Depot;
- }
- }
- return $this->p4Stream;
- }
- public function getStreamWithoutLabel($stream)
- {
- $index = strpos($stream, '@');
- if ($index === false) {
- return $stream;
- }
- return substr($stream, 0, $index);
- }
- public function getP4ClientSpec()
- {
- $p4clientSpec = $this->path . '/' . $this->getClient() . '.p4.spec';
- return $p4clientSpec;
- }
- public function getUser()
- {
- return $this->p4User;
- }
- public function setUser($user)
- {
- $this->p4User = $user;
- }
- public function queryP4User()
- {
- $this->getUser();
- if (strlen($this->p4User) > 0) {
- return;
- }
- $this->p4User = $this->getP4variable('P4USER');
- if (strlen($this->p4User) > 0) {
- return;
- }
- $this->p4User = $this->io->ask('Enter P4 User:');
- if ($this->windowsFlag) {
- $command = 'p4 set P4USER=' . $this->p4User;
- } else {
- $command = 'export P4USER=' . $this->p4User;
- }
- $this->executeCommand($command);
- }
- protected function getP4variable($name)
- {
- if ($this->windowsFlag) {
- $command = 'p4 set';
- $this->executeCommand($command);
- $result = trim($this->commandResult);
- $resArray = explode(PHP_EOL, $result);
- foreach ($resArray as $line) {
- $fields = explode('=', $line);
- if (strcmp($name, $fields[0]) == 0) {
- $index = strpos($fields[1], ' ');
- if ($index === false) {
- $value = $fields[1];
- } else {
- $value = substr($fields[1], 0, $index);
- }
- $value = trim($value);
- return $value;
- }
- }
- } else {
- $command = 'echo $' . $name;
- $this->executeCommand($command);
- $result = trim($this->commandResult);
- return $result;
- }
- }
- public function queryP4Password()
- {
- if (isset($this->p4Password)) {
- return $this->p4Password;
- }
- $password = $this->getP4variable('P4PASSWD');
- if (strlen($password) <= 0) {
- $password = $this->io->askAndHideAnswer('Enter password for Perforce user ' . $this->getUser() . ': ');
- }
- $this->p4Password = $password;
- return $password;
- }
- public function generateP4Command($command, $useClient = true)
- {
- $p4Command = 'p4 ';
- $p4Command = $p4Command . '-u ' . $this->getUser() . ' ';
- if ($useClient) {
- $p4Command = $p4Command . '-c ' . $this->getClient() . ' ';
- }
- $p4Command = $p4Command . '-p ' . $this->getPort() . ' ';
- $p4Command = $p4Command . $command;
- return $p4Command;
- }
- public function isLoggedIn()
- {
- $command = $this->generateP4Command('login -s', false);
- $exitCode = $this->executeCommand($command);
- if ($exitCode) {
- $errorOutput = $this->process->getErrorOutput();
- $index = strpos($errorOutput, $this->getUser());
- if ($index === false) {
- $index = strpos($errorOutput, 'p4');
- if ($index === false) {
- return false;
- }
- throw new \Exception('p4 command not found in path: ' . $errorOutput);
- }
- throw new \Exception('Invalid user name: ' . $this->getUser());
- }
- return true;
- }
- public function connectClient()
- {
- $p4CreateClientCommand = $this->generateP4Command('client -i < ' . str_replace(" ", "\\ ", $this->getP4ClientSpec()));
- $this->executeCommand($p4CreateClientCommand);
- }
- public function syncCodeBase($sourceReference)
- {
- $prevDir = getcwd();
- chdir($this->path);
- $p4SyncCommand = $this->generateP4Command('sync -f ');
- if (null != $sourceReference) {
- $p4SyncCommand = $p4SyncCommand . '@' . $sourceReference;
- }
- $this->executeCommand($p4SyncCommand);
- chdir($prevDir);
- }
- public function writeClientSpecToFile($spec)
- {
- fwrite($spec, 'Client: ' . $this->getClient() . PHP_EOL . PHP_EOL);
- fwrite($spec, 'Update: ' . date('Y/m/d H:i:s') . PHP_EOL . PHP_EOL);
- fwrite($spec, 'Access: ' . date('Y/m/d H:i:s') . PHP_EOL);
- fwrite($spec, 'Owner: ' . $this->getUser() . PHP_EOL . PHP_EOL);
- fwrite($spec, 'Description:' . PHP_EOL);
- fwrite($spec, ' Created by ' . $this->getUser() . ' from composer.' . PHP_EOL . PHP_EOL);
- fwrite($spec, 'Root: ' . $this->getPath() . PHP_EOL . PHP_EOL);
- fwrite($spec, 'Options: noallwrite noclobber nocompress unlocked modtime rmdir' . PHP_EOL . PHP_EOL);
- fwrite($spec, 'SubmitOptions: revertunchanged' . PHP_EOL . PHP_EOL);
- fwrite($spec, 'LineEnd: local' . PHP_EOL . PHP_EOL);
- if ($this->isStream()) {
- fwrite($spec, 'Stream:' . PHP_EOL);
- fwrite($spec, ' ' . $this->getStreamWithoutLabel($this->p4Stream) . PHP_EOL);
- } else {
- fwrite(
- $spec,
- 'View: ' . $this->getStream() . '/... //' . $this->getClient() . '/... ' . PHP_EOL
- );
- }
- }
- public function writeP4ClientSpec()
- {
- $clientSpec = $this->getP4ClientSpec();
- $spec = fopen($clientSpec, 'w');
- try {
- $this->writeClientSpecToFile($spec);
- } catch (\Exception $e) {
- fclose($spec);
- throw $e;
- }
- fclose($spec);
- }
- protected function read($pipe, $name)
- {
- if (feof($pipe)) {
- return;
- }
- $line = fgets($pipe);
- while ($line != false) {
- $line = fgets($pipe);
- }
- return;
- }
- public function windowsLogin($password)
- {
- $command = $this->generateP4Command(' login -a');
- $process = new Process($command, null, null, $password);
- return $process->run();
- }
- public function p4Login()
- {
- $this->queryP4User();
- if (!$this->isLoggedIn()) {
- $password = $this->queryP4Password();
- if ($this->windowsFlag) {
- $this->windowsLogin($password);
- } else {
- $command = 'echo ' . $password . ' | ' . $this->generateP4Command(' login -a', false);
- $exitCode = $this->executeCommand($command);
- $result = trim($this->commandResult);
- if ($exitCode) {
- throw new \Exception("Error logging in:" . $this->process->getErrorOutput());
- }
- }
- }
- }
- public function getComposerInformation($identifier)
- {
- $index = strpos($identifier, '@');
- if ($index === false) {
- $composerJson = $identifier. '/composer.json';
- return $this->getComposerInformationFromPath($composerJson);
- }
- return $this->getComposerInformationFromLabel($identifier, $index);
- }
- public function getComposerInformationFromPath($composerJson)
- {
- $command = $this->generateP4Command(' print ' . $composerJson);
- $this->executeCommand($command);
- $result = $this->commandResult;
- $index = strpos($result, '{');
- if ($index === false) {
- return '';
- }
- if ($index >= 0) {
- $rawData = substr($result, $index);
- $composer_info = json_decode($rawData, true);
- return $composer_info;
- }
- return '';
- }
- public function getComposerInformationFromLabel($identifier, $index)
- {
- $composerJsonPath = substr($identifier, 0, $index) . '/composer.json' . substr($identifier, $index);
- $command = $this->generateP4Command(' files ' . $composerJsonPath, false);
- $this->executeCommand($command);
- $result = $this->commandResult;
- $index2 = strpos($result, 'no such file(s).');
- if ($index2 === false) {
- $index3 = strpos($result, 'change');
- if (!($index3 === false)) {
- $phrase = trim(substr($result, $index3));
- $fields = explode(' ', $phrase);
- $id = $fields[1];
- $composerJson = substr($identifier, 0, $index) . '/composer.json@' . $id;
- return $this->getComposerInformationFromPath($composerJson);
- }
- }
- return "";
- }
- public function getBranches()
- {
- $possibleBranches = array();
- if (!$this->isStream()) {
- $possibleBranches[$this->p4Branch] = $this->getStream();
- } else {
- $command = $this->generateP4Command('streams //' . $this->p4Depot . '/...');
- $this->executeCommand($command);
- $result = $this->commandResult;
- $resArray = explode(PHP_EOL, $result);
- foreach ($resArray as $line) {
- $resBits = explode(' ', $line);
- if (count($resBits) > 4) {
- $branch = preg_replace('/[^A-Za-z0-9 ]/', '', $resBits[4]);
- $possibleBranches[$branch] = $resBits[1];
- }
- }
- }
- $command = $this->generateP4Command('changes '. $this->getStream() . '/...', false);
- $this->executeCommand($command);
- $result = $this->commandResult;
- $resArray = explode(PHP_EOL, $result);
- $lastCommit = $resArray[0];
- $lastCommitArr = explode(' ', $lastCommit);
- $lastCommitNum = $lastCommitArr[1];
- $branches = array('master' => $possibleBranches[$this->p4Branch] . '@'. $lastCommitNum);
- return $branches;
- }
- public function getTags()
- {
- $command = $this->generateP4Command('labels');
- $this->executeCommand($command);
- $result = $this->commandResult;
- $resArray = explode(PHP_EOL, $result);
- $tags = array();
- foreach ($resArray as $line) {
- $index = strpos($line, 'Label');
- if (!($index === false)) {
- $fields = explode(' ', $line);
- $tags[$fields[1]] = $this->getStream() . '@' . $fields[1];
- }
- }
- return $tags;
- }
- public function checkStream()
- {
- $command = $this->generateP4Command('depots', false);
- $this->executeCommand($command);
- $result = $this->commandResult;
- $resArray = explode(PHP_EOL, $result);
- foreach ($resArray as $line) {
- $index = strpos($line, 'Depot');
- if (!($index === false)) {
- $fields = explode(' ', $line);
- if (strcmp($this->p4Depot, $fields[1]) === 0) {
- $this->p4DepotType = $fields[3];
- return $this->isStream();
- }
- }
- }
- return false;
- }
- protected function getChangeList($reference)
- {
- $index = strpos($reference, '@');
- if ($index === false) {
- return;
- }
- $label = substr($reference, $index);
- $command = $this->generateP4Command(' changes -m1 ' . $label);
- $this->executeCommand($command);
- $changes = $this->commandResult;
- if (strpos($changes, 'Change') !== 0) {
- return;
- }
- $fields = explode(' ', $changes);
- $changeList = $fields[1];
- return $changeList;
- }
- public function getCommitLogs($fromReference, $toReference)
- {
- $fromChangeList = $this->getChangeList($fromReference);
- if ($fromChangeList == null) {
- return;
- }
- $toChangeList = $this->getChangeList($toReference);
- if ($toChangeList == null) {
- return;
- }
- $index = strpos($fromReference, '@');
- $main = substr($fromReference, 0, $index) . '/...';
- $command = $this->generateP4Command('filelog ' . $main . '@' . $fromChangeList. ',' . $toChangeList);
- $this->executeCommand($command);
- $result = $this->commandResult;
- return $result;
- }
- public function getFilesystem()
- {
- if (empty($this->filesystem)) {
- $this->filesystem = new Filesystem($this->process);
- }
- return $this->filesystem;
- }
- public function setFilesystem(Filesystem $fs)
- {
- $this->filesystem = $fs;
- }
- }
- <?php
- namespace Composer\Util;
- class Platform
- {
- public static function isWindows()
- {
- return defined('PHP_WINDOWS_VERSION_BUILD');
- }
- }
- <?php
- namespace Composer\Util;
- use Symfony\Component\Process\Process;
- use Symfony\Component\Process\ProcessUtils;
- use Composer\IO\IOInterface;
- class ProcessExecutor
- {
- protected static $timeout = 300;
- protected $captureOutput;
- protected $errorOutput;
- protected $io;
- public function __construct(IOInterface $io = null)
- {
- $this->io = $io;
- }
- public function execute($command, &$output = null, $cwd = null)
- {
- if ($this->io && $this->io->isDebug()) {
- $safeCommand = preg_replace('{(://[^:/\s]+:)[^@\s/]+}i', '$1****', $command);
- $this->io->writeError('Executing command ('.($cwd ?: 'CWD').'): '.$safeCommand);
- }
-
- if (null === $cwd && Platform::isWindows() && false !== strpos($command, 'git') && getcwd()) {
- $cwd = realpath(getcwd());
- }
- $this->captureOutput = count(func_get_args()) > 1;
- $this->errorOutput = null;
- $process = new Process($command, $cwd, null, null, static::getTimeout());
- $callback = is_callable($output) ? $output : array($this, 'outputHandler');
- $process->run($callback);
- if ($this->captureOutput && !is_callable($output)) {
- $output = $process->getOutput();
- }
- $this->errorOutput = $process->getErrorOutput();
- return $process->getExitCode();
- }
- public function splitLines($output)
- {
- $output = trim($output);
- return ((string) $output === '') ? array() : preg_split('{\r?\n}', $output);
- }
- public function getErrorOutput()
- {
- return $this->errorOutput;
- }
- public function outputHandler($type, $buffer)
- {
- if ($this->captureOutput) {
- return;
- }
- echo $buffer;
- }
- public static function getTimeout()
- {
- return static::$timeout;
- }
- public static function setTimeout($timeout)
- {
- static::$timeout = $timeout;
- }
- public static function escape($argument)
- {
- return ProcessUtils::escapeArgument($argument);
- }
- }
- <?php
- namespace Composer\Util;
- use Composer\Config;
- use Composer\IO\IOInterface;
- use Composer\Downloader\TransportException;
- class RemoteFilesystem
- {
- private $io;
- private $config;
- private $bytesMax;
- private $originUrl;
- private $fileUrl;
- private $fileName;
- private $retry;
- private $progress;
- private $lastProgress;
- private $options = array();
- private $peerCertificateMap = array();
- private $disableTls = false;
- private $retryAuthFailure;
- private $lastHeaders;
- private $storeAuth;
- private $degradedMode = false;
- private $redirects;
- private $maxRedirects = 20;
- public function __construct(IOInterface $io, Config $config = null, array $options = array(), $disableTls = false)
- {
- $this->io = $io;
-
- if ($disableTls === false) {
- $this->options = $this->getTlsDefaults($options);
- } else {
- $this->disableTls = true;
- }
- $this->options = array_replace_recursive($this->options, $options);
- $this->config = $config;
- }
- public function copy($originUrl, $fileUrl, $fileName, $progress = true, $options = array())
- {
- return $this->get($originUrl, $fileUrl, $options, $fileName, $progress);
- }
- public function getContents($originUrl, $fileUrl, $progress = true, $options = array())
- {
- return $this->get($originUrl, $fileUrl, $options, null, $progress);
- }
- public function getOptions()
- {
- return $this->options;
- }
- public function setOptions(array $options)
- {
- $this->options = array_replace_recursive($this->options, $options);
- }
- public function isTlsDisabled()
- {
- return $this->disableTls === true;
- }
- public function getLastHeaders()
- {
- return $this->lastHeaders;
- }
- public function findHeaderValue(array $headers, $name)
- {
- $value = null;
- foreach ($headers as $header) {
- if (preg_match('{^'.$name.':\s*(.+?)\s*$}i', $header, $match)) {
- $value = $match[1];
- } elseif (preg_match('{^HTTP/}i', $header)) {
-
- $value = null;
- }
- }
- return $value;
- }
- public function findStatusCode(array $headers)
- {
- $value = null;
- foreach ($headers as $header) {
- if (preg_match('{^HTTP/\S+ (\d+)}i', $header, $match)) {
-
- $value = (int) $match[1];
- }
- }
- return $value;
- }
- protected function get($originUrl, $fileUrl, $additionalOptions = array(), $fileName = null, $progress = true)
- {
- if (strpos($originUrl, '.github.com') === (strlen($originUrl) - 11)) {
- $originUrl = 'github.com';
- }
- $this->scheme = parse_url($fileUrl, PHP_URL_SCHEME);
- $this->bytesMax = 0;
- $this->originUrl = $originUrl;
- $this->fileUrl = $fileUrl;
- $this->fileName = $fileName;
- $this->progress = $progress;
- $this->lastProgress = null;
- $this->retryAuthFailure = true;
- $this->lastHeaders = array();
- $this->redirects = 1;
- if (preg_match('{^https?://(.+):(.+)@([^/]+)}i', $fileUrl, $match)) {
- $this->io->setAuthentication($originUrl, urldecode($match[1]), urldecode($match[2]));
- }
- $tempAdditionalOptions = $additionalOptions;
- if (isset($tempAdditionalOptions['retry-auth-failure'])) {
- $this->retryAuthFailure = (bool) $tempAdditionalOptions['retry-auth-failure'];
- unset($tempAdditionalOptions['retry-auth-failure']);
- }
- $isRedirect = false;
- if (isset($tempAdditionalOptions['redirects'])) {
- $this->redirects = $tempAdditionalOptions['redirects'];
- $isRedirect = true;
- unset($tempAdditionalOptions['redirects']);
- }
- $options = $this->getOptionsForUrl($originUrl, $tempAdditionalOptions);
- unset($tempAdditionalOptions);
- $userlandFollow = isset($options['http']['follow_location']) && !$options['http']['follow_location'];
- $this->io->writeError((substr($fileUrl, 0, 4) === 'http' ? 'Downloading ' : 'Reading ') . $fileUrl, true, IOInterface::DEBUG);
- if (isset($options['github-token'])) {
- $fileUrl .= (false === strpos($fileUrl, '?') ? '?' : '&') . 'access_token='.$options['github-token'];
- unset($options['github-token']);
- }
- if (isset($options['gitlab-token'])) {
- $fileUrl .= (false === strpos($fileUrl, '?') ? '?' : '&') . 'access_token='.$options['gitlab-token'];
- unset($options['gitlab-token']);
- }
- if (isset($options['http'])) {
- $options['http']['ignore_errors'] = true;
- }
- if ($this->degradedMode && substr($fileUrl, 0, 21) === 'http://packagist.org/') {
- $fileUrl = 'http://' . gethostbyname('packagist.org') . substr($fileUrl, 20);
- }
- $ctx = StreamContextFactory::getContext($fileUrl, $options, array('notification' => array($this, 'callbackGet')));
- if ($this->progress && !$isRedirect) {
- $this->io->writeError(" Downloading: <comment>Connecting...</comment>", false);
- }
- $errorMessage = '';
- $errorCode = 0;
- $result = false;
- set_error_handler(function ($code, $msg) use (&$errorMessage) {
- if ($errorMessage) {
- $errorMessage .= "\n";
- }
- $errorMessage .= preg_replace('{^file_get_contents\(.*?\): }', '', $msg);
- });
- try {
- $result = file_get_contents($fileUrl, false, $ctx);
- if (PHP_VERSION_ID < 50600 && !empty($options['ssl']['peer_fingerprint'])) {
- $params = stream_context_get_params($ctx);
- $expectedPeerFingerprint = $options['ssl']['peer_fingerprint'];
- $peerFingerprint = TlsHelper::getCertificateFingerprint($params['options']['ssl']['peer_certificate']);
- if ($expectedPeerFingerprint !== $peerFingerprint) {
- throw new TransportException('Peer fingerprint did not match');
- }
- }
- } catch (\Exception $e) {
- if ($e instanceof TransportException && !empty($http_response_header[0])) {
- $e->setHeaders($http_response_header);
- $e->setStatusCode($this->findStatusCode($http_response_header));
- }
- if ($e instanceof TransportException && $result !== false) {
- $e->setResponse($result);
- }
- $result = false;
- }
- if ($errorMessage && !ini_get('allow_url_fopen')) {
- $errorMessage = 'allow_url_fopen must be enabled in php.ini ('.$errorMessage.')';
- }
- restore_error_handler();
- if (isset($e) && !$this->retry) {
- if (!$this->degradedMode && false !== strpos($e->getMessage(), 'Operation timed out')) {
- $this->degradedMode = true;
- $this->io->writeError(array(
- '<error>'.$e->getMessage().'</error>',
- '<error>Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info</error>',
- ));
- return $this->get($this->originUrl, $this->fileUrl, $additionalOptions, $this->fileName, $this->progress);
- }
- throw $e;
- }
- $statusCode = null;
- if (!empty($http_response_header[0])) {
- $statusCode = $this->findStatusCode($http_response_header);
- }
- $hasFollowedRedirect = false;
- if ($userlandFollow && $statusCode >= 300 && $statusCode <= 399 && $statusCode !== 304 && $this->redirects < $this->maxRedirects) {
- $hasFollowedRedirect = true;
- $result = $this->handleRedirect($http_response_header, $additionalOptions, $result);
- }
- if ($statusCode && $statusCode >= 400 && $statusCode <= 599) {
- if (!$this->retry) {
- $e = new TransportException('The "'.$this->fileUrl.'" file could not be downloaded ('.$http_response_header[0].')', $statusCode);
- $e->setHeaders($http_response_header);
- $e->setResponse($result);
- $e->setStatusCode($statusCode);
- throw $e;
- }
- $result = false;
- }
- if ($this->progress && !$this->retry && !$isRedirect) {
- $this->io->overwriteError(" Downloading: <comment>100%</comment>");
- }
- if ($result && extension_loaded('zlib') && substr($fileUrl, 0, 4) === 'http' && !$hasFollowedRedirect) {
- $decode = 'gzip' === strtolower($this->findHeaderValue($http_response_header, 'content-encoding'));
- if ($decode) {
- try {
- if (PHP_VERSION_ID >= 50400) {
- $result = zlib_decode($result);
- } else {
- $result = file_get_contents('compress.zlib://data:application/octet-stream;base64,'.base64_encode($result));
- }
- if (!$result) {
- throw new TransportException('Failed to decode zlib stream');
- }
- } catch (\Exception $e) {
- if ($this->degradedMode) {
- throw $e;
- }
- $this->degradedMode = true;
- $this->io->writeError(array(
- '<error>Failed to decode response: '.$e->getMessage().'</error>',
- '<error>Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info</error>',
- ));
- return $this->get($this->originUrl, $this->fileUrl, $additionalOptions, $this->fileName, $this->progress);
- }
- }
- }
- if (false !== $result && null !== $fileName && !$isRedirect) {
- if ('' === $result) {
- throw new TransportException('"'.$this->fileUrl.'" appears broken, and returned an empty 200 response');
- }
- $errorMessage = '';
- set_error_handler(function ($code, $msg) use (&$errorMessage) {
- if ($errorMessage) {
- $errorMessage .= "\n";
- }
- $errorMessage .= preg_replace('{^file_put_contents\(.*?\): }', '', $msg);
- });
- $result = (bool) file_put_contents($fileName, $result);
- restore_error_handler();
- if (false === $result) {
- throw new TransportException('The "'.$this->fileUrl.'" file could not be written to '.$fileName.': '.$errorMessage);
- }
- }
- if (false === $result && false !== strpos($errorMessage, 'Peer certificate') && PHP_VERSION_ID < 50600) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if (TlsHelper::isOpensslParseSafe()) {
- $certDetails = $this->getCertificateCnAndFp($this->fileUrl, $options);
- if ($certDetails) {
- $this->peerCertificateMap[$this->getUrlAuthority($this->fileUrl)] = $certDetails;
- $this->retry = true;
- }
- } else {
- $this->io->writeError(sprintf(
- '<error>Your version of PHP, %s, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.</error>',
- PHP_VERSION
- ));
- }
- }
- if ($this->retry) {
- $this->retry = false;
- $result = $this->get($this->originUrl, $this->fileUrl, $additionalOptions, $this->fileName, $this->progress);
- if ($this->storeAuth && $this->config) {
- $authHelper = new AuthHelper($this->io, $this->config);
- $authHelper->storeAuth($this->originUrl, $this->storeAuth);
- $this->storeAuth = false;
- }
- return $result;
- }
- if (false === $result) {
- $e = new TransportException('The "'.$this->fileUrl.'" file could not be downloaded: '.$errorMessage, $errorCode);
- if (!empty($http_response_header[0])) {
- $e->setHeaders($http_response_header);
- }
- if (!$this->degradedMode && false !== strpos($e->getMessage(), 'Operation timed out')) {
- $this->degradedMode = true;
- $this->io->writeError(array(
- '<error>'.$e->getMessage().'</error>',
- '<error>Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info</error>',
- ));
- return $this->get($this->originUrl, $this->fileUrl, $additionalOptions, $this->fileName, $this->progress);
- }
- throw $e;
- }
- if (!empty($http_response_header[0])) {
- $this->lastHeaders = $http_response_header;
- }
- return $result;
- }
- protected function callbackGet($notificationCode, $severity, $message, $messageCode, $bytesTransferred, $bytesMax)
- {
- switch ($notificationCode) {
- case STREAM_NOTIFY_FAILURE:
- if (400 === $messageCode) {
-
- throw new TransportException("The '" . $this->fileUrl . "' URL could not be accessed: " . $message, $messageCode);
- }
-
- case STREAM_NOTIFY_AUTH_REQUIRED:
- if (401 === $messageCode) {
- if (!$this->retryAuthFailure) {
- break;
- }
- $this->promptAuthAndRetry($messageCode);
- }
- break;
- case STREAM_NOTIFY_AUTH_RESULT:
- if (403 === $messageCode) {
- if (!$this->retryAuthFailure) {
- break;
- }
- $this->promptAuthAndRetry($messageCode, $message);
- }
- break;
- case STREAM_NOTIFY_FILE_SIZE_IS:
- if ($this->bytesMax < $bytesMax) {
- $this->bytesMax = $bytesMax;
- }
- break;
- case STREAM_NOTIFY_PROGRESS:
- if ($this->bytesMax > 0 && $this->progress) {
- $progression = round($bytesTransferred / $this->bytesMax * 100);
- if ((0 === $progression % 5) && 100 !== $progression && $progression !== $this->lastProgress) {
- $this->lastProgress = $progression;
- $this->io->overwriteError(" Downloading: <comment>$progression%</comment>", false);
- }
- }
- break;
- default:
- break;
- }
- }
- protected function promptAuthAndRetry($httpStatus, $reason = null)
- {
- if ($this->config && in_array($this->originUrl, $this->config->get('github-domains'), true)) {
- $message = "\n".'Could not fetch '.$this->fileUrl.', please create a GitHub OAuth token '.($httpStatus === 404 ? 'to access private repos' : 'to go over the API rate limit');
- $gitHubUtil = new GitHub($this->io, $this->config, null);
- if (!$gitHubUtil->authorizeOAuth($this->originUrl)
- && (!$this->io->isInteractive() || !$gitHubUtil->authorizeOAuthInteractively($this->originUrl, $message))
- ) {
- throw new TransportException('Could not authenticate against '.$this->originUrl, 401);
- }
- } elseif ($this->config && in_array($this->originUrl, $this->config->get('gitlab-domains'), true)) {
- $message = "\n".'Could not fetch '.$this->fileUrl.', enter your ' . $this->originUrl . ' credentials ' .($httpStatus === 401 ? 'to access private repos' : 'to go over the API rate limit');
- $gitLabUtil = new GitLab($this->io, $this->config, null);
- if (!$gitLabUtil->authorizeOAuth($this->originUrl)
- && (!$this->io->isInteractive() || !$gitLabUtil->authorizeOAuthInteractively($this->scheme, $this->originUrl, $message))
- ) {
- throw new TransportException('Could not authenticate against '.$this->originUrl, 401);
- }
- } else {
- if ($httpStatus === 404) {
- return;
- }
- if (!$this->io->isInteractive()) {
- if ($httpStatus === 401) {
- $message = "The '" . $this->fileUrl . "' URL required authentication.\nYou must be using the interactive console to authenticate";
- }
- if ($httpStatus === 403) {
- $message = "The '" . $this->fileUrl . "' URL could not be accessed: " . $reason;
- }
- throw new TransportException($message, $httpStatus);
- }
- if ($this->io->hasAuthentication($this->originUrl)) {
- throw new TransportException("Invalid credentials for '" . $this->fileUrl . "', aborting.", $httpStatus);
- }
- $this->io->overwriteError(' Authentication required (<info>'.parse_url($this->fileUrl, PHP_URL_HOST).'</info>):');
- $username = $this->io->ask(' Username: ');
- $password = $this->io->askAndHideAnswer(' Password: ');
- $this->io->setAuthentication($this->originUrl, $username, $password);
- $this->storeAuth = $this->config->get('store-auths');
- }
- $this->retry = true;
- throw new TransportException('RETRY');
- }
- protected function getOptionsForUrl($originUrl, $additionalOptions)
- {
- $tlsOptions = array();
- if ($this->disableTls === false && PHP_VERSION_ID < 50600 && !stream_is_local($this->fileUrl)) {
- $host = parse_url($this->fileUrl, PHP_URL_HOST);
- if (PHP_VERSION_ID >= 50304) {
-
- $userlandFollow = true;
- } else {
-
-
-
- if ($host === 'github.com' || $host === 'api.github.com') {
- $host = '*.github.com';
- }
- }
- $tlsOptions['ssl']['CN_match'] = $host;
- $tlsOptions['ssl']['SNI_server_name'] = $host;
- $urlAuthority = $this->getUrlAuthority($this->fileUrl);
- if (isset($this->peerCertificateMap[$urlAuthority])) {
- $certMap = $this->peerCertificateMap[$urlAuthority];
- $this->io->writeError(sprintf(
- 'Using <info>%s</info> as CN for subjectAltName enabled host <info>%s</info>',
- $certMap['cn'],
- $urlAuthority
- ), true, IOInterface::DEBUG);
- $tlsOptions['ssl']['CN_match'] = $certMap['cn'];
- $tlsOptions['ssl']['peer_fingerprint'] = $certMap['fp'];
- }
- }
- $headers = array();
- if (extension_loaded('zlib')) {
- $headers[] = 'Accept-Encoding: gzip';
- }
- $options = array_replace_recursive($this->options, $tlsOptions, $additionalOptions);
- if (!$this->degradedMode) {
-
- $options['http']['protocol_version'] = 1.1;
- $headers[] = 'Connection: close';
- }
- if (isset($userlandFollow)) {
- $options['http']['follow_location'] = 0;
- }
- if ($this->io->hasAuthentication($originUrl)) {
- $auth = $this->io->getAuthentication($originUrl);
- if ('github.com' === $originUrl && 'x-oauth-basic' === $auth['password']) {
- $options['github-token'] = $auth['username'];
- } elseif ($this->config && in_array($originUrl, $this->config->get('gitlab-domains'), true)) {
- if ($auth['password'] === 'oauth2') {
- $headers[] = 'Authorization: Bearer '.$auth['username'];
- }
- } else {
- $authStr = base64_encode($auth['username'] . ':' . $auth['password']);
- $headers[] = 'Authorization: Basic '.$authStr;
- }
- }
- if (isset($options['http']['header']) && !is_array($options['http']['header'])) {
- $options['http']['header'] = explode("\r\n", trim($options['http']['header'], "\r\n"));
- }
- foreach ($headers as $header) {
- $options['http']['header'][] = $header;
- }
- return $options;
- }
- private function handleRedirect(array $http_response_header, array $additionalOptions, $result)
- {
- if ($locationHeader = $this->findHeaderValue($http_response_header, 'location')) {
- if (parse_url($locationHeader, PHP_URL_SCHEME)) {
- $targetUrl = $locationHeader;
- } elseif (parse_url($locationHeader, PHP_URL_HOST)) {
- $targetUrl = $this->scheme.':'.$locationHeader;
- } elseif ('/' === $locationHeader[0]) {
- $urlHost = parse_url($this->fileUrl, PHP_URL_HOST);
- $targetUrl = preg_replace('{^(.+(?://|@)'.preg_quote($urlHost).'(?::\d+)?)(?:[/\?].*)?$}', '\1'.$locationHeader, $this->fileUrl);
- } else {
-
- $targetUrl = preg_replace('{^(.+/)[^/?]*(?:\?.*)?$}', '\1'.$locationHeader, $this->fileUrl);
- }
- }
- if (!empty($targetUrl)) {
- $this->redirects++;
- $this->io->writeError(sprintf('Following redirect (%u) %s', $this->redirects, $targetUrl), true, IOInterface::DEBUG);
- $additionalOptions['redirects'] = $this->redirects;
- return $this->get($this->originUrl, $targetUrl, $additionalOptions, $this->fileName, $this->progress);
- }
- if (!$this->retry) {
- $e = new TransportException('The "'.$this->fileUrl.'" file could not be downloaded, got redirect without Location ('.$http_response_header[0].')');
- $e->setHeaders($http_response_header);
- $e->setResponse($result);
- throw $e;
- }
- return false;
- }
- private function getTlsDefaults(array $options)
- {
- $ciphers = implode(':', array(
- 'ECDHE-RSA-AES128-GCM-SHA256',
- 'ECDHE-ECDSA-AES128-GCM-SHA256',
- 'ECDHE-RSA-AES256-GCM-SHA384',
- 'ECDHE-ECDSA-AES256-GCM-SHA384',
- 'DHE-RSA-AES128-GCM-SHA256',
- 'DHE-DSS-AES128-GCM-SHA256',
- 'kEDH+AESGCM',
- 'ECDHE-RSA-AES128-SHA256',
- 'ECDHE-ECDSA-AES128-SHA256',
- 'ECDHE-RSA-AES128-SHA',
- 'ECDHE-ECDSA-AES128-SHA',
- 'ECDHE-RSA-AES256-SHA384',
- 'ECDHE-ECDSA-AES256-SHA384',
- 'ECDHE-RSA-AES256-SHA',
- 'ECDHE-ECDSA-AES256-SHA',
- 'DHE-RSA-AES128-SHA256',
- 'DHE-RSA-AES128-SHA',
- 'DHE-DSS-AES128-SHA256',
- 'DHE-RSA-AES256-SHA256',
- 'DHE-DSS-AES256-SHA',
- 'DHE-RSA-AES256-SHA',
- 'AES128-GCM-SHA256',
- 'AES256-GCM-SHA384',
- 'ECDHE-RSA-RC4-SHA',
- 'ECDHE-ECDSA-RC4-SHA',
- 'AES128',
- 'AES256',
- 'RC4-SHA',
- 'HIGH',
- '!aNULL',
- '!eNULL',
- '!EXPORT',
- '!DES',
- '!3DES',
- '!MD5',
- '!PSK',
- ));
- $defaults = array(
- 'ssl' => array(
- 'ciphers' => $ciphers,
- 'verify_peer' => true,
- 'verify_depth' => 7,
- 'SNI_enabled' => true,
- 'capture_peer_cert' => true,
- ),
- );
- if (isset($options['ssl'])) {
- $defaults['ssl'] = array_replace_recursive($defaults['ssl'], $options['ssl']);
- }
- if (!isset($defaults['ssl']['cafile']) && !isset($defaults['ssl']['capath'])) {
- $result = $this->getSystemCaRootBundlePath();
- if (preg_match('{^phar://}', $result)) {
- $hash = hash_file('sha256', $result);
- $targetPath = rtrim(sys_get_temp_dir(), '\\/') . '/composer-cacert-' . $hash . '.pem';
- if (!file_exists($targetPath) || $hash !== hash_file('sha256', $targetPath)) {
- $this->streamCopy($result, $targetPath);
- chmod($targetPath, 0666);
- }
- $defaults['ssl']['cafile'] = $targetPath;
- } elseif (is_dir($result)) {
- $defaults['ssl']['capath'] = $result;
- } else {
- $defaults['ssl']['cafile'] = $result;
- }
- }
- if (isset($defaults['ssl']['cafile']) && (!is_readable($defaults['ssl']['cafile']) || !$this->validateCaFile($defaults['ssl']['cafile']))) {
- throw new TransportException('The configured cafile was not valid or could not be read.');
- }
- if (isset($defaults['ssl']['capath']) && (!is_dir($defaults['ssl']['capath']) || !is_readable($defaults['ssl']['capath']))) {
- throw new TransportException('The configured capath was not valid or could not be read.');
- }
- if (PHP_VERSION_ID >= 50413) {
- $defaults['ssl']['disable_compression'] = true;
- }
- return $defaults;
- }
- private function getSystemCaRootBundlePath()
- {
- static $caPath = null;
- if ($caPath !== null) {
- return $caPath;
- }
-
- $envCertFile = getenv('SSL_CERT_FILE');
- if ($envCertFile && is_readable($envCertFile) && $this->validateCaFile($envCertFile)) {
- return $caPath = $envCertFile;
- }
- $configured = ini_get('openssl.cafile');
- if ($configured && strlen($configured) > 0 && is_readable($configured) && $this->validateCaFile($configured)) {
- return $caPath = $configured;
- }
- $caBundlePaths = array(
- '/etc/pki/tls/certs/ca-bundle.crt',
- '/etc/ssl/certs/ca-certificates.crt',
- '/etc/ssl/ca-bundle.pem',
- '/usr/local/share/certs/ca-root-nss.crt',
- '/usr/ssl/certs/ca-bundle.crt',
- '/opt/local/share/curl/curl-ca-bundle.crt',
- '/usr/local/share/curl/curl-ca-bundle.crt',
- '/usr/share/ssl/certs/ca-bundle.crt',
- '/etc/ssl/cert.pem',
- '/usr/local/etc/ssl/cert.pem',
- );
- foreach ($caBundlePaths as $caBundle) {
- if (Silencer::call('is_readable', $caBundle) && $this->validateCaFile($caBundle)) {
- return $caPath = $caBundle;
- }
- }
- foreach ($caBundlePaths as $caBundle) {
- $caBundle = dirname($caBundle);
- if (is_dir($caBundle) && glob($caBundle.'/*')) {
- return $caPath = $caBundle;
- }
- }
- return $caPath = __DIR__.'/../../../res/cacert.pem';
- }
- private function validateCaFile($filename)
- {
- static $files = array();
- if (isset($files[$filename])) {
- return $files[$filename];
- }
- $this->io->writeError('Checking CA file '.realpath($filename), true, IOInterface::DEBUG);
- $contents = file_get_contents($filename);
-
- if (!TlsHelper::isOpensslParseSafe()) {
- $this->io->writeError(sprintf(
- '<error>Your version of PHP, %s, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.</error>',
- PHP_VERSION
- ));
- return $files[$filename] = !empty($contents);
- }
- return $files[$filename] = (bool) openssl_x509_parse($contents);
- }
- private function streamCopy($source, $target)
- {
- $source = fopen($source, 'r');
- $target = fopen($target, 'w+');
- stream_copy_to_stream($source, $target);
- fclose($source);
- fclose($target);
- unset($source, $target);
- }
- private function getCertificateCnAndFp($url, $options)
- {
- if (PHP_VERSION_ID >= 50600) {
- throw new \BadMethodCallException(sprintf(
- '%s must not be used on PHP >= 5.6',
- __METHOD__
- ));
- }
- $context = StreamContextFactory::getContext($url, $options, array('options' => array(
- 'ssl' => array(
- 'capture_peer_cert' => true,
- 'verify_peer' => false,
- ), ),
- ));
-
- if (false === $handle = @fopen($url, 'rb', false, $context)) {
- return;
- }
- fclose($handle);
- $handle = null;
- $params = stream_context_get_params($context);
- if (!empty($params['options']['ssl']['peer_certificate'])) {
- $peerCertificate = $params['options']['ssl']['peer_certificate'];
- if (TlsHelper::checkCertificateHost($peerCertificate, parse_url($url, PHP_URL_HOST), $commonName)) {
- return array(
- 'cn' => $commonName,
- 'fp' => TlsHelper::getCertificateFingerprint($peerCertificate),
- );
- }
- }
- }
- private function getUrlAuthority($url)
- {
- $defaultPorts = array(
- 'ftp' => 21,
- 'http' => 80,
- 'https' => 443,
- 'ssh2.sftp' => 22,
- 'ssh2.scp' => 22,
- );
- $scheme = parse_url($url, PHP_URL_SCHEME);
- if (!isset($defaultPorts[$scheme])) {
- throw new \InvalidArgumentException(sprintf(
- 'Could not get default port for unknown scheme: %s',
- $scheme
- ));
- }
- $defaultPort = $defaultPorts[$scheme];
- $port = parse_url($url, PHP_URL_PORT) ?: $defaultPort;
- return parse_url($url, PHP_URL_HOST).':'.$port;
- }
- }
- <?php
- namespace Composer\Util;
- class Silencer
- {
- private static $stack = array();
- public static function suppress($mask = null)
- {
- if (!isset($mask)) {
- $mask = E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED | E_STRICT;
- }
- $old = error_reporting();
- array_push(self::$stack, $old);
- error_reporting($old & ~$mask);
- return $old;
- }
- public static function restore()
- {
- if (!empty(self::$stack)) {
- error_reporting(array_pop(self::$stack));
- }
- }
- public static function call($callable )
- {
- try {
- self::suppress();
- $result = call_user_func_array($callable, array_slice(func_get_args(), 1));
- self::restore();
- return $result;
- } catch (\Exception $e) {
- self::restore();
- throw $e;
- }
- }
- }
- <?php
- namespace Composer\Util;
- use Composer\Spdx\SpdxLicenses;
- trigger_error('The ' . __NAMESPACE__ . '\SpdxLicense class is deprecated, use Composer\Spdx\SpdxLicenses instead.', E_USER_DEPRECATED);
- class SpdxLicense extends SpdxLicenses
- {
- }
- <?php
- namespace Composer\Util;
- use Composer\Composer;
- final class StreamContextFactory
- {
- public static function getContext($url, array $defaultOptions = array(), array $defaultParams = array())
- {
- $options = array('http' => array(
- 'follow_location' => 1,
- 'max_redirects' => 20,
- ));
- if (!empty($_SERVER['HTTP_PROXY']) || !empty($_SERVER['http_proxy'])) {
- $proxy = parse_url(!empty($_SERVER['http_proxy']) ? $_SERVER['http_proxy'] : $_SERVER['HTTP_PROXY']);
- }
- if (preg_match('{^https://}i', $url) && (!empty($_SERVER['HTTPS_PROXY']) || !empty($_SERVER['https_proxy']))) {
- $proxy = parse_url(!empty($_SERVER['https_proxy']) ? $_SERVER['https_proxy'] : $_SERVER['HTTPS_PROXY']);
- }
- if (!empty($_SERVER['no_proxy']) && parse_url($url, PHP_URL_HOST)) {
- $pattern = new NoProxyPattern($_SERVER['no_proxy']);
- if ($pattern->test($url)) {
- unset($proxy);
- }
- }
- if (!empty($proxy)) {
- $proxyURL = isset($proxy['scheme']) ? $proxy['scheme'] . '://' : '';
- $proxyURL .= isset($proxy['host']) ? $proxy['host'] : '';
- if (isset($proxy['port'])) {
- $proxyURL .= ":" . $proxy['port'];
- } elseif ('http://' == substr($proxyURL, 0, 7)) {
- $proxyURL .= ":80";
- } elseif ('https://' == substr($proxyURL, 0, 8)) {
- $proxyURL .= ":443";
- }
- $proxyURL = str_replace(array('http://', 'https://'), array('tcp://', 'ssl://'), $proxyURL);
- if (0 === strpos($proxyURL, 'ssl:') && !extension_loaded('openssl')) {
- throw new \RuntimeException('You must enable the openssl extension to use a proxy over https');
- }
- $options['http']['proxy'] = $proxyURL;
- switch (parse_url($url, PHP_URL_SCHEME)) {
- case 'http':
- $reqFullUriEnv = getenv('HTTP_PROXY_REQUEST_FULLURI');
- if ($reqFullUriEnv === false || $reqFullUriEnv === '' || (strtolower($reqFullUriEnv) !== 'false' && (bool) $reqFullUriEnv)) {
- $options['http']['request_fulluri'] = true;
- }
- break;
- case 'https':
- $reqFullUriEnv = getenv('HTTPS_PROXY_REQUEST_FULLURI');
- if ($reqFullUriEnv === false || $reqFullUriEnv === '' || (strtolower($reqFullUriEnv) !== 'false' && (bool) $reqFullUriEnv)) {
- $options['http']['request_fulluri'] = true;
- }
- break;
- }
- if ('https' === parse_url($url, PHP_URL_SCHEME)) {
- $options['ssl']['SNI_enabled'] = true;
- if (PHP_VERSION_ID < 50600) {
- $options['ssl']['SNI_server_name'] = parse_url($url, PHP_URL_HOST);
- }
- }
- if (isset($proxy['user'])) {
- $auth = urldecode($proxy['user']);
- if (isset($proxy['pass'])) {
- $auth .= ':' . urldecode($proxy['pass']);
- }
- $auth = base64_encode($auth);
- if (isset($defaultOptions['http']['header'])) {
- if (is_string($defaultOptions['http']['header'])) {
- $defaultOptions['http']['header'] = array($defaultOptions['http']['header']);
- }
- $defaultOptions['http']['header'][] = "Proxy-Authorization: Basic {$auth}";
- } else {
- $options['http']['header'] = array("Proxy-Authorization: Basic {$auth}");
- }
- }
- }
- $options = array_replace_recursive($options, $defaultOptions);
- if (isset($options['http']['header'])) {
- $options['http']['header'] = self::fixHttpHeaderField($options['http']['header']);
- }
- if (defined('HHVM_VERSION')) {
- $phpVersion = 'HHVM ' . HHVM_VERSION;
- } else {
- $phpVersion = 'PHP ' . PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION;
- }
- if (!isset($options['http']['header']) || false === strpos(strtolower(implode('', $options['http']['header'])), 'user-agent')) {
- $options['http']['header'][] = sprintf(
- 'User-Agent: Composer/%s (%s; %s; %s)',
- Composer::VERSION === '@package_version@' ? 'source' : Composer::VERSION,
- php_uname('s'),
- php_uname('r'),
- $phpVersion
- );
- }
- return stream_context_create($options, $defaultParams);
- }
- private static function fixHttpHeaderField($header)
- {
- if (!is_array($header)) {
- $header = explode("\r\n", $header);
- }
- uasort($header, function ($el) {
- return preg_match('{^content-type}i', $el) ? 1 : -1;
- });
- return $header;
- }
- }
- <?php
- namespace Composer\Util;
- use Composer\Config;
- use Composer\IO\IOInterface;
- class Svn
- {
- const MAX_QTY_AUTH_TRIES = 5;
- protected $credentials;
- protected $hasAuth;
- protected $io;
- protected $url;
- protected $cacheCredentials = true;
- protected $process;
- protected $qtyAuthTries = 0;
- protected $config;
- public function __construct($url, IOInterface $io, Config $config, ProcessExecutor $process = null)
- {
- $this->url = $url;
- $this->io = $io;
- $this->config = $config;
- $this->process = $process ?: new ProcessExecutor;
- }
- public static function cleanEnv()
- {
- putenv("DYLD_LIBRARY_PATH");
- unset($_SERVER['DYLD_LIBRARY_PATH']);
- }
- public function execute($command, $url, $cwd = null, $path = null, $verbose = false)
- {
- $svnCommand = $this->getCommand($command, $url, $path);
- $output = null;
- $io = $this->io;
- $handler = function ($type, $buffer) use (&$output, $io, $verbose) {
- if ($type !== 'out') {
- return;
- }
- if ('Redirecting to URL ' === substr($buffer, 0, 19)) {
- return;
- }
- $output .= $buffer;
- if ($verbose) {
- $io->writeError($buffer, false);
- }
- };
- $status = $this->process->execute($svnCommand, $handler, $cwd);
- if (0 === $status) {
- return $output;
- }
- $errorOutput = $this->process->getErrorOutput();
- $fullOutput = implode("\n", array($output, $errorOutput));
- if (false === stripos($fullOutput, 'Could not authenticate to server:')
- && false === stripos($fullOutput, 'authorization failed')
- && false === stripos($fullOutput, 'svn: E170001:')
- && false === stripos($fullOutput, 'svn: E215004:')) {
- throw new \RuntimeException($fullOutput);
- }
- if (!$this->hasAuth()) {
- $this->doAuthDance();
- }
- if ($this->qtyAuthTries++ < self::MAX_QTY_AUTH_TRIES) {
- return $this->execute($command, $url, $cwd, $path, $verbose);
- }
- throw new \RuntimeException(
- 'wrong credentials provided ('.$fullOutput.')'
- );
- }
- public function setCacheCredentials($cacheCredentials)
- {
- $this->cacheCredentials = $cacheCredentials;
- }
- protected function doAuthDance()
- {
- if (!$this->io->isInteractive()) {
- throw new \RuntimeException(
- 'can not ask for authentication in non interactive mode'
- );
- }
- $this->io->writeError("The Subversion server ({$this->url}) requested credentials:");
- $this->hasAuth = true;
- $this->credentials['username'] = $this->io->ask("Username: ");
- $this->credentials['password'] = $this->io->askAndHideAnswer("Password: ");
- $this->cacheCredentials = $this->io->askConfirmation("Should Subversion cache these credentials? (yes/no) ", true);
- return $this;
- }
- protected function getCommand($cmd, $url, $path = null)
- {
- $cmd = sprintf('%s %s%s %s',
- $cmd,
- '--non-interactive ',
- $this->getCredentialString(),
- ProcessExecutor::escape($url)
- );
- if ($path) {
- $cmd .= ' ' . ProcessExecutor::escape($path);
- }
- return $cmd;
- }
- protected function getCredentialString()
- {
- if (!$this->hasAuth()) {
- return '';
- }
- return sprintf(
- ' %s--username %s --password %s ',
- $this->getAuthCache(),
- ProcessExecutor::escape($this->getUsername()),
- ProcessExecutor::escape($this->getPassword())
- );
- }
- protected function getPassword()
- {
- if ($this->credentials === null) {
- throw new \LogicException("No svn auth detected.");
- }
- return isset($this->credentials['password']) ? $this->credentials['password'] : '';
- }
- protected function getUsername()
- {
- if ($this->credentials === null) {
- throw new \LogicException("No svn auth detected.");
- }
- return $this->credentials['username'];
- }
- protected function hasAuth()
- {
- if (null !== $this->hasAuth) {
- return $this->hasAuth;
- }
- if (false === $this->createAuthFromConfig()) {
- $this->createAuthFromUrl();
- }
- return $this->hasAuth;
- }
- protected function getAuthCache()
- {
- return $this->cacheCredentials ? '' : '--no-auth-cache ';
- }
- private function createAuthFromConfig()
- {
- if (!$this->config->has('http-basic')) {
- return $this->hasAuth = false;
- }
- $authConfig = $this->config->get('http-basic');
- $host = parse_url($this->url, PHP_URL_HOST);
- if (isset($authConfig[$host])) {
- $this->credentials['username'] = $authConfig[$host]['username'];
- $this->credentials['password'] = $authConfig[$host]['password'];
- return $this->hasAuth = true;
- }
- return $this->hasAuth = false;
- }
- private function createAuthFromUrl()
- {
- $uri = parse_url($this->url);
- if (empty($uri['user'])) {
- return $this->hasAuth = false;
- }
- $this->credentials['username'] = $uri['user'];
- if (!empty($uri['pass'])) {
- $this->credentials['password'] = $uri['pass'];
- }
- return $this->hasAuth = true;
- }
- }
- <?php
- namespace Composer\Util;
- use Symfony\Component\Process\PhpProcess;
- final class TlsHelper
- {
- private static $useOpensslParse;
- public static function checkCertificateHost($certificate, $hostname, &$cn = null)
- {
- $names = self::getCertificateNames($certificate);
- if (empty($names)) {
- return false;
- }
- $combinedNames = array_merge($names['san'], array($names['cn']));
- $hostname = strtolower($hostname);
- foreach ($combinedNames as $certName) {
- $matcher = self::certNameMatcher($certName);
- if ($matcher && $matcher($hostname)) {
- $cn = $names['cn'];
- return true;
- }
- }
- return false;
- }
- public static function getCertificateNames($certificate)
- {
- if (is_array($certificate)) {
- $info = $certificate;
- } elseif (self::isOpensslParseSafe()) {
- $info = openssl_x509_parse($certificate, false);
- }
- if (!isset($info['subject']['commonName'])) {
- return;
- }
- $commonName = strtolower($info['subject']['commonName']);
- $subjectAltNames = array();
- if (isset($info['extensions']['subjectAltName'])) {
- $subjectAltNames = preg_split('{\s*,\s*}', $info['extensions']['subjectAltName']);
- $subjectAltNames = array_filter(array_map(function ($name) {
- if (0 === strpos($name, 'DNS:')) {
- return strtolower(ltrim(substr($name, 4)));
- }
- }, $subjectAltNames));
- $subjectAltNames = array_values($subjectAltNames);
- }
- return array(
- 'cn' => $commonName,
- 'san' => $subjectAltNames,
- );
- }
- public static function getCertificateFingerprint($certificate)
- {
- $pubkeydetails = openssl_pkey_get_details(openssl_get_publickey($certificate));
- $pubkeypem = $pubkeydetails['key'];
- $start = '-----BEGIN PUBLIC KEY-----';
- $end = '-----END PUBLIC KEY-----';
- $pemtrim = substr($pubkeypem, (strpos($pubkeypem, $start) + strlen($start)), (strlen($pubkeypem) - strpos($pubkeypem, $end)) * (-1));
- $der = base64_decode($pemtrim);
- return sha1($der);
- }
- public static function isOpensslParseSafe()
- {
- if (null !== self::$useOpensslParse) {
- return self::$useOpensslParse;
- }
- if (PHP_VERSION_ID >= 50600) {
- return self::$useOpensslParse = true;
- }
-
-
-
- if (
- (PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50328)
- || (PHP_VERSION_ID < 50500 && PHP_VERSION_ID >= 50423)
- || (PHP_VERSION_ID < 50600 && PHP_VERSION_ID >= 50507)
- ) {
- return self::$useOpensslParse = true;
- }
- if (Platform::isWindows()) {
- return self::$useOpensslParse = false;
- }
- $compareDistroVersionPrefix = function ($prefix, $fixedVersion) {
- $regex = '{^'.preg_quote($prefix).'([0-9]+)$}';
- if (preg_match($regex, PHP_VERSION, $m)) {
- return ((int) $m[1]) >= $fixedVersion;
- }
- return false;
- };
- if (
- $compareDistroVersionPrefix('5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ZFYnY3S1ZRNmJkaGc1cDVTanBXSDErTXEwM3VSM1pYUEJZZHlWODMxOQpvMGxWajFLRkkyRENML2xpV2lzSlJvb2YrMWNSMzVDdGQwd1lCY3BCNlRac2xNY09QbDc2ZHdLd0pnZUpvMlFnClpzZm1jMnZDMS9xT2xOdU5xLzBUenprVkd2OEVUVDNDZ2FVK1VYZTRYT1Z2a2NjZWJKbjJkZz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K';
- $script = <<<'EOT'
- error_reporting(-1);
- $info = openssl_x509_parse(base64_decode('%s'));
- var_dump(PHP_VERSION, $info['issuer']['emailAddress'], $info['validFrom_time_t']);
- EOT;
- $script = '<'."?php\n".sprintf($script, $cert);
- try {
- $process = new PhpProcess($script);
- $process->mustRun();
- } catch (\Exception $e) {
-
- return self::$useOpensslParse = false;
- }
- $output = preg_split('{\r?\n}', trim($process->getOutput()));
- $errorOutput = trim($process->getErrorOutput());
- if (
- count($output) === 3
- && $output[0] === sprintf('string(%d) "%s"', strlen(PHP_VERSION), PHP_VERSION)
- && $output[1] === 'string(27) "stefan.esser@sektioneins.de"'
- && $output[2] === 'int(-1)'
- && preg_match('{openssl_x509_parse\(\): illegal (?:ASN1 data type for|length in) timestamp in - on line \d+}', $errorOutput)
- ) {
- return self::$useOpensslParse = true;
- }
- return self::$useOpensslParse = false;
- }
- private static function certNameMatcher($certName)
- {
- $wildcards = substr_count($certName, '*');
- if (0 === $wildcards) {
- return function ($hostname) use ($certName) {
- return $hostname === $certName;
- };
- }
- if (1 === $wildcards) {
- $components = explode('.', $certName);
- if (3 > count($components)) {
- return;
- }
- $firstComponent = $components[0];
- if ('*' !== $firstComponent[strlen($firstComponent) - 1]) {
- return;
- }
- $wildcardRegex = preg_quote($certName);
- $wildcardRegex = str_replace('\\*', '[a-z0-9-]+', $wildcardRegex);
- $wildcardRegex = "{^{$wildcardRegex}$}";
- return function ($hostname) use ($wildcardRegex) {
- return 1 === preg_match($wildcardRegex, $hostname);
- };
- }
- }
- }
- <?php
- function includeIfExists($file)
- {
- return file_exists($file) ? include $file : false;
- }
- if ((!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../../autoload.php'))) {
- echo 'You must set up the project dependencies using `composer install`'.PHP_EOL.
- 'See https://getcomposer.org/download/ for instructions on installing Composer'.PHP_EOL;
- exit(1);
- }
- return $loader;
- <?php
- /*
- * This file is part of Composer.
- *
- * (c) Nils Adermann <naderman@naderman.de>
- * Jordi Boggiano <j.boggiano@seld.be>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace Composer\Autoload;
- /**
- * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
- *
- * $loader = new \Composer\Autoload\ClassLoader();
- *
- * // register classes with namespaces
- * $loader->add('Symfony\Component', __DIR__.'/component');
- * $loader->add('Symfony', __DIR__.'/framework');
- *
- * // activate the autoloader
- * $loader->register();
- *
- * // to enable searching the include path (eg. for PEAR packages)
- * $loader->setUseIncludePath(true);
- *
- * In this example, if you try to use a class in the Symfony\Component
- * namespace or one of its children (Symfony\Component\Console for instance),
- * the autoloader will first look for the class under the component/
- * directory, and it will then fallback to the framework/ directory if not
- * found before giving up.
- *
- * This class is loosely based on the Symfony UniversalClassLoader.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- * @author Jordi Boggiano <j.boggiano@seld.be>
- * @see http://www.php-fig.org/psr/psr-0/
- * @see http://www.php-fig.org/psr/psr-4/
- */
- class ClassLoader
- {
- // PSR-4
- private $prefixLengthsPsr4 = array();
- private $prefixDirsPsr4 = array();
- private $fallbackDirsPsr4 = array();
- // PSR-0
- private $prefixesPsr0 = array();
- private $fallbackDirsPsr0 = array();
- private $useIncludePath = false;
- private $classMap = array();
- private $classMapAuthoritative = false;
- public function getPrefixes()
- {
- if (!empty($this->prefixesPsr0)) {
- return call_user_func_array('array_merge', $this->prefixesPsr0);
- }
- return array();
- }
- public function getPrefixesPsr4()
- {
- return $this->prefixDirsPsr4;
- }
- public function getFallbackDirs()
- {
- return $this->fallbackDirsPsr0;
- }
- public function getFallbackDirsPsr4()
- {
- return $this->fallbackDirsPsr4;
- }
- public function getClassMap()
- {
- return $this->classMap;
- }
- /**
- * @param array $classMap Class to filename map
- */
- public function addClassMap(array $classMap)
- {
- if ($this->classMap) {
- $this->classMap = array_merge($this->classMap, $classMap);
- } else {
- $this->classMap = $classMap;
- }
- }
- /**
- * Registers a set of PSR-0 directories for a given prefix, either
- * appending or prepending to the ones previously set for this prefix.
- *
- * @param string $prefix The prefix
- * @param array|string $paths The PSR-0 root directories
- * @param bool $prepend Whether to prepend the directories
- */
- public function add($prefix, $paths, $prepend = false)
- {
- if (!$prefix) {
- if ($prepend) {
- $this->fallbackDirsPsr0 = array_merge(
- (array) $paths,
- $this->fallbackDirsPsr0
- );
- } else {
- $this->fallbackDirsPsr0 = array_merge(
- $this->fallbackDirsPsr0,
- (array) $paths
- );
- }
- return;
- }
- $first = $prefix[0];
- if (!isset($this->prefixesPsr0[$first][$prefix])) {
- $this->prefixesPsr0[$first][$prefix] = (array) $paths;
- return;
- }
- if ($prepend) {
- $this->prefixesPsr0[$first][$prefix] = array_merge(
- (array) $paths,
- $this->prefixesPsr0[$first][$prefix]
- );
- } else {
- $this->prefixesPsr0[$first][$prefix] = array_merge(
- $this->prefixesPsr0[$first][$prefix],
- (array) $paths
- );
- }
- }
- /**
- * Registers a set of PSR-4 directories for a given namespace, either
- * appending or prepending to the ones previously set for this namespace.
- *
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param array|string $paths The PSR-4 base directories
- * @param bool $prepend Whether to prepend the directories
- *
- * @throws \InvalidArgumentException
- */
- public function addPsr4($prefix, $paths, $prepend = false)
- {
- if (!$prefix) {
- // Register directories for the root namespace.
- if ($prepend) {
- $this->fallbackDirsPsr4 = array_merge(
- (array) $paths,
- $this->fallbackDirsPsr4
- );
- } else {
- $this->fallbackDirsPsr4 = array_merge(
- $this->fallbackDirsPsr4,
- (array) $paths
- );
- }
- } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
- // Register directories for a new namespace.
- $length = strlen($prefix);
- if ('\\' !== $prefix[$length - 1]) {
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
- }
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
- } elseif ($prepend) {
- // Prepend directories for an already registered namespace.
- $this->prefixDirsPsr4[$prefix] = array_merge(
- (array) $paths,
- $this->prefixDirsPsr4[$prefix]
- );
- } else {
- // Append directories for an already registered namespace.
- $this->prefixDirsPsr4[$prefix] = array_merge(
- $this->prefixDirsPsr4[$prefix],
- (array) $paths
- );
- }
- }
- /**
- * Registers a set of PSR-0 directories for a given prefix,
- * replacing any others previously set for this prefix.
- *
- * @param string $prefix The prefix
- * @param array|string $paths The PSR-0 base directories
- */
- public function set($prefix, $paths)
- {
- if (!$prefix) {
- $this->fallbackDirsPsr0 = (array) $paths;
- } else {
- $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
- }
- }
- /**
- * Registers a set of PSR-4 directories for a given namespace,
- * replacing any others previously set for this namespace.
- *
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param array|string $paths The PSR-4 base directories
- *
- * @throws \InvalidArgumentException
- */
- public function setPsr4($prefix, $paths)
- {
- if (!$prefix) {
- $this->fallbackDirsPsr4 = (array) $paths;
- } else {
- $length = strlen($prefix);
- if ('\\' !== $prefix[$length - 1]) {
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
- }
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
- }
- }
- /**
- * Turns on searching the include path for class files.
- *
- * @param bool $useIncludePath
- */
- public function setUseIncludePath($useIncludePath)
- {
- $this->useIncludePath = $useIncludePath;
- }
- /**
- * Can be used to check if the autoloader uses the include path to check
- * for classes.
- *
- * @return bool
- */
- public function getUseIncludePath()
- {
- return $this->useIncludePath;
- }
- /**
- * Turns off searching the prefix and fallback directories for classes
- * that have not been registered with the class map.
- *
- * @param bool $classMapAuthoritative
- */
- public function setClassMapAuthoritative($classMapAuthoritative)
- {
- $this->classMapAuthoritative = $classMapAuthoritative;
- }
- /**
- * Should class lookup fail if not found in the current class map?
- *
- * @return bool
- */
- public function isClassMapAuthoritative()
- {
- return $this->classMapAuthoritative;
- }
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
- /**
- * Unregisters this instance as an autoloader.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- * @return bool|null True if loaded, null otherwise
- */
- public function loadClass($class)
- {
- if ($file = $this->findFile($class)) {
- includeFile($file);
- return true;
- }
- }
- /**
- * Finds the path to the file where the class is defined.
- *
- * @param string $class The name of the class
- *
- * @return string|false The path if found, false otherwise
- */
- public function findFile($class)
- {
- // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
- if ('\\' == $class[0]) {
- $class = substr($class, 1);
- }
- // class map lookup
- if (isset($this->classMap[$class])) {
- return $this->classMap[$class];
- }
- if ($this->classMapAuthoritative) {
- return false;
- }
- $file = $this->findFileWithExtension($class, '.php');
- // Search for Hack files if we are running on HHVM
- if ($file === null && defined('HHVM_VERSION')) {
- $file = $this->findFileWithExtension($class, '.hh');
- }
- if ($file === null) {
- // Remember that this class does not exist.
- return $this->classMap[$class] = false;
- }
- return $file;
- }
- private function findFileWithExtension($class, $ext)
- {
- // PSR-4 lookup
- $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
- $first = $class[0];
- if (isset($this->prefixLengthsPsr4[$first])) {
- foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
- if (0 === strpos($class, $prefix)) {
- foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
- return $file;
- }
- }
- }
- }
- }
- // PSR-4 fallback dirs
- foreach ($this->fallbackDirsPsr4 as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
- return $file;
- }
- }
- // PSR-0 lookup
- if (false !== $pos = strrpos($class, '\\')) {
- // namespaced class name
- $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
- . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
- } else {
- // PEAR-like class name
- $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
- }
- if (isset($this->prefixesPsr0[$first])) {
- foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
- if (0 === strpos($class, $prefix)) {
- foreach ($dirs as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
- return $file;
- }
- }
- }
- }
- }
- // PSR-0 fallback dirs
- foreach ($this->fallbackDirsPsr0 as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
- return $file;
- }
- }
- // PSR-0 include paths.
- if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
- return $file;
- }
- }
- }
- /**
- * Scope isolated include.
- *
- * Prevents access to $this/self from included files.
- */
- function includeFile($file)
- {
- include $file;
- }
- {
- "$schema": "http://json-schema.org/draft-04/schema#",
- "name": "Package",
- "type": "object",
- "additionalProperties": false,
- "required": [ "name", "description" ],
- "properties": {
- "name": {
- "type": "string",
- "description": "Package name, including 'vendor-name/' prefix."
- },
- "type": {
- "description": "Package type, either 'library' for common packages, 'composer-plugin' for plugins, 'metapackage' for empty packages, or a custom type ([a-z0-9-]+) defined by whatever project this package applies to.",
- "type": "string"
- },
- "target-dir": {
- "description": "DEPRECATED: Forces the package to be installed into the given subdirectory path. This is used for autoloading PSR-0 packages that do not contain their full path. Use forward slashes for cross-platform compatibility.",
- "type": "string"
- },
- "description": {
- "type": "string",
- "description": "Short package description."
- },
- "keywords": {
- "type": "array",
- "items": {
- "type": "string",
- "description": "A tag/keyword that this package relates to."
- }
- },
- "homepage": {
- "type": "string",
- "description": "Homepage URL for the project.",
- "format": "uri"
- },
- "version": {
- "type": "string",
- "description": "Package version, see https://getcomposer.org/doc/04-schema.md#version for more info on valid schemes."
- },
- "time": {
- "type": "string",
- "description": "Package release date, in 'YYYY-MM-DD', 'YYYY-MM-DD HH:MM:SS' or 'YYYY-MM-DDTHH:MM:SSZ' format."
- },
- "license": {
- "type": ["string", "array"],
- "description": "License name. Or an array of license names."
- },
- "authors": {
- "type": "array",
- "description": "List of authors that contributed to the package. This is typically the main maintainers, not the full list.",
- "items": {
- "type": "object",
- "additionalProperties": false,
- "required": [ "name"],
- "properties": {
- "name": {
- "type": "string",
- "description": "Full name of the author."
- },
- "email": {
- "type": "string",
- "description": "Email address of the author.",
- "format": "email"
- },
- "homepage": {
- "type": "string",
- "description": "Homepage URL for the author.",
- "format": "uri"
- },
- "role": {
- "type": "string",
- "description": "Author's role in the project."
- }
- }
- }
- },
- "require": {
- "type": "object",
- "description": "This is a hash of package name (keys) and version constraints (values) that are required to run this package.",
- "additionalProperties": true
- },
- "replace": {
- "type": "object",
- "description": "This is a hash of package name (keys) and version constraints (values) that can be replaced by this package.",
- "additionalProperties": true
- },
- "conflict": {
- "type": "object",
- "description": "This is a hash of package name (keys) and version constraints (values) that conflict with this package.",
- "additionalProperties": true
- },
- "provide": {
- "type": "object",
- "description": "This is a hash of package name (keys) and version constraints (values) that this package provides in addition to this package's name.",
- "additionalProperties": true
- },
- "require-dev": {
- "type": "object",
- "description": "This is a hash of package name (keys) and version constraints (values) that this package requires for developing it (testing tools and such).",
- "additionalProperties": true
- },
- "suggest": {
- "type": "object",
- "description": "This is a hash of package name (keys) and descriptions (values) that this package suggests work well with it (this will be suggested to the user during installation).",
- "additionalProperties": true
- },
- "config": {
- "type": "object",
- "description": "Composer options.",
- "properties": {
- "process-timeout": {
- "type": "integer",
- "description": "The timeout in seconds for process executions, defaults to 300 (5mins)."
- },
- "use-include-path": {
- "type": "boolean",
- "description": "If true, the Composer autoloader will also look for classes in the PHP include path."
- },
- "preferred-install": {
- "type": "string",
- "description": "The install method Composer will prefer to use, defaults to auto and can be any of source, dist or auto."
- },
- "notify-on-install": {
- "type": "boolean",
- "description": "Composer allows repositories to define a notification URL, so that they get notified whenever a package from that repository is installed. This option allows you to disable that behaviour, defaults to true."
- },
- "github-protocols": {
- "type": "array",
- "description": "A list of protocols to use for github.com clones, in priority order, defaults to [\"git\", \"https\", \"http\"].",
- "items": {
- "type": "string"
- }
- },
- "github-oauth": {
- "type": "object",
- "description": "A hash of domain name => github API oauth tokens, typically {\"github.com\":\"<token>\"}.",
- "additionalProperties": true
- },
- "gitlab-oauth": {
- "type": "object",
- "description": "A hash of domain name => gitlab API oauth tokens, typically {\"gitlab.com\":\"<token>\"}.",
- "additionalProperties": true
- },
- "disable-tls": {
- "type": "boolean",
- "description": "Defaults to `false`. If set to true all HTTPS URLs will be tried with HTTP instead and no network level encryption is performed. Enabling this is a security risk and is NOT recommended. The better way is to enable the php_openssl extension in php.ini."
- },
- "cafile": {
- "type": "string",
- "description": "A way to set the path to the openssl CA file. In PHP 5.6+ you should rather set this via openssl.cafile in php.ini, although PHP 5.6+ should be able to detect your system CA file automatically."
- },
- "capath": {
- "type": "string",
- "description": "If cafile is not specified or if the certificate is not found there, the directory pointed to by capath is searched for a suitable certificate. capath must be a correctly hashed certificate directory."
- },
- "http-basic": {
- "type": "object",
- "description": "A hash of domain name => {\"username\": \"...\", \"password\": \"...\"}.",
- "additionalProperties": true
- },
- "store-auths": {
- "type": ["string", "boolean"],
- "description": "What to do after prompting for authentication, one of: true (store), false (do not store) or \"prompt\" (ask every time), defaults to prompt."
- },
- "platform": {
- "type": "object",
- "description": "This is a hash of package name (keys) and version (values) that will be used to mock the platform packages on this machine.",
- "additionalProperties": true
- },
- "vendor-dir": {
- "type": "string",
- "description": "The location where all packages are installed, defaults to \"vendor\"."
- },
- "bin-dir": {
- "type": "string",
- "description": "The location where all binaries are linked, defaults to \"vendor/bin\"."
- },
- "data-dir": {
- "type": "string",
- "description": "The location where old phar files are stored, defaults to \"$home\" except on XDG Base Directory compliant unixes."
- },
- "cache-dir": {
- "type": "string",
- "description": "The location where all caches are located, defaults to \"~/.composer/cache\" on *nix and \"%LOCALAPPDATA%\\Composer\" on windows."
- },
- "cache-files-dir": {
- "type": "string",
- "description": "The location where files (zip downloads) are cached, defaults to \"{$cache-dir}/files\"."
- },
- "cache-repo-dir": {
- "type": "string",
- "description": "The location where repo (git/hg repo clones) are cached, defaults to \"{$cache-dir}/repo\"."
- },
- "cache-vcs-dir": {
- "type": "string",
- "description": "The location where vcs infos (git clones, github api calls, etc. when reading vcs repos) are cached, defaults to \"{$cache-dir}/vcs\"."
- },
- "cache-ttl": {
- "type": "integer",
- "description": "The default cache time-to-live, defaults to 15552000 (6 months)."
- },
- "cache-files-ttl": {
- "type": "integer",
- "description": "The cache time-to-live for files, defaults to the value of cache-ttl."
- },
- "cache-files-maxsize": {
- "type": ["string", "integer"],
- "description": "The cache max size for the files cache, defaults to \"300MiB\"."
- },
- "bin-compat": {
- "enum": ["auto", "full"],
- "description": "The compatibility of the binaries, defaults to \"auto\" (automatically guessed) and can be \"full\" (compatible with both Windows and Unix-based systems)."
- },
- "discard-changes": {
- "type": ["string", "boolean"],
- "description": "The default style of handling dirty updates, defaults to false and can be any of true, false or \"stash\"."
- },
- "autoloader-suffix": {
- "type": "string",
- "description": "Optional string to be used as a suffix for the generated Composer autoloader. When null a random one will be generated."
- },
- "optimize-autoloader": {
- "type": "boolean",
- "description": "Always optimize when dumping the autoloader."
- },
- "prepend-autoloader": {
- "type": "boolean",
- "description": "If false, the composer autoloader will not be prepended to existing autoloaders, defaults to true."
- },
- "classmap-authoritative": {
- "type": "boolean",
- "description": "If true, the composer autoloader will not scan the filesystem for classes that are not found in the class map, defaults to false."
- },
- "github-domains": {
- "type": "array",
- "description": "A list of domains to use in github mode. This is used for GitHub Enterprise setups, defaults to [\"github.com\"].",
- "items": {
- "type": "string"
- }
- },
- "github-expose-hostname": {
- "type": "boolean",
- "description": "Defaults to true. If set to false, the OAuth tokens created to access the github API will have a date instead of the machine hostname."
- },
- "gitlab-domains": {
- "type": "array",
- "description": "A list of domains to use in gitlab mode. This is used for custom GitLab setups, defaults to [\"gitlab.com\"].",
- "items": {
- "type": "string"
- }
- },
- "archive-format": {
- "type": "string",
- "description": "The default archiving format when not provided on cli, defaults to \"tar\"."
- },
- "archive-dir": {
- "type": "string",
- "description": "The default archive path when not provided on cli, defaults to \".\"."
- }
- }
- },
- "extra": {
- "type": ["object", "array"],
- "description": "Arbitrary extra data that can be used by plugins, for example, package of type composer-plugin may have a 'class' key defining an installer class name.",
- "additionalProperties": true
- },
- "autoload": {
- "type": "object",
- "description": "Description of how the package can be autoloaded.",
- "properties": {
- "psr-0": {
- "type": "object",
- "description": "This is a hash of namespaces (keys) and the directories they can be found into (values, can be arrays of paths) by the autoloader.",
- "additionalProperties": true
- },
- "psr-4": {
- "type": "object",
- "description": "This is a hash of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.",
- "additionalProperties": true
- },
- "classmap": {
- "type": "array",
- "description": "This is an array of directories that contain classes to be included in the class-map generation process."
- },
- "files": {
- "type": "array",
- "description": "This is an array of files that are always required on every request."
- },
- "exclude-from-classmap": {
- "type": "array",
- "description": "This is an array of patterns to exclude from autoload classmap generation. (e.g. \"exclude-from-classmap\": [\"/test/\", \"/tests/\", \"/Tests/\"]"
- }
- }
- },
- "autoload-dev": {
- "type": "object",
- "description": "Description of additional autoload rules for development purpose (eg. a test suite).",
- "properties": {
- "psr-0": {
- "type": "object",
- "description": "This is a hash of namespaces (keys) and the directories they can be found into (values, can be arrays of paths) by the autoloader.",
- "additionalProperties": true
- },
- "psr-4": {
- "type": "object",
- "description": "This is a hash of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.",
- "additionalProperties": true
- },
- "classmap": {
- "type": "array",
- "description": "This is an array of directories that contain classes to be included in the class-map generation process."
- },
- "files": {
- "type": "array",
- "description": "This is an array of files that are always required on every request."
- }
- }
- },
- "archive": {
- "type": ["object"],
- "description": "Options for creating package archives for distribution.",
- "properties": {
- "exclude": {
- "type": "array",
- "description": "A list of patterns for paths to exclude or include if prefixed with an exclamation mark."
- }
- }
- },
- "repositories": {
- "type": ["object", "array"],
- "description": "A set of additional repositories where packages can be found.",
- "additionalProperties": true
- },
- "minimum-stability": {
- "type": ["string"],
- "description": "The minimum stability the packages must have to be install-able. Possible values are: dev, alpha, beta, RC, stable.",
- "pattern": "^dev|alpha|beta|rc|RC|stable$"
- },
- "prefer-stable": {
- "type": ["boolean"],
- "description": "If set to true, stable packages will be preferred to dev packages when possible, even if the minimum-stability allows unstable packages."
- },
- "bin": {
- "type": ["array"],
- "description": "A set of files that should be treated as binaries and symlinked into bin-dir (from config).",
- "items": {
- "type": "string"
- }
- },
- "include-path": {
- "type": ["array"],
- "description": "DEPRECATED: A list of directories which should get added to PHP's include path. This is only present to support legacy projects, and all new code should preferably use autoloading.",
- "items": {
- "type": "string"
- }
- },
- "scripts": {
- "type": ["object"],
- "description": "Scripts listeners that will be executed before/after some events.",
- "properties": {
- "pre-install-cmd": {
- "type": ["array", "string"],
- "description": "Occurs before the install command is executed, contains one or more Class::method callables or shell commands."
- },
- "post-install-cmd": {
- "type": ["array", "string"],
- "description": "Occurs after the install command is executed, contains one or more Class::method callables or shell commands."
- },
- "pre-update-cmd": {
- "type": ["array", "string"],
- "description": "Occurs before the update command is executed, contains one or more Class::method callables or shell commands."
- },
- "post-update-cmd": {
- "type": ["array", "string"],
- "description": "Occurs after the update command is executed, contains one or more Class::method callables or shell commands."
- },
- "pre-status-cmd": {
- "type": ["array", "string"],
- "description": "Occurs before the status command is executed, contains one or more Class::method callables or shell commands."
- },
- "post-status-cmd": {
- "type": ["array", "string"],
- "description": "Occurs after the status command is executed, contains one or more Class::method callables or shell commands."
- },
- "pre-package-install": {
- "type": ["array", "string"],
- "description": "Occurs before a package is installed, contains one or more Class::method callables or shell commands."
- },
- "post-package-install": {
- "type": ["array", "string"],
- "description": "Occurs after a package is installed, contains one or more Class::method callables or shell commands."
- },
- "pre-package-update": {
- "type": ["array", "string"],
- "description": "Occurs before a package is updated, contains one or more Class::method callables or shell commands."
- },
- "post-package-update": {
- "type": ["array", "string"],
- "description": "Occurs after a package is updated, contains one or more Class::method callables or shell commands."
- },
- "pre-package-uninstall": {
- "type": ["array", "string"],
- "description": "Occurs before a package has been uninstalled, contains one or more Class::method callables or shell commands."
- },
- "post-package-uninstall": {
- "type": ["array", "string"],
- "description": "Occurs after a package has been uninstalled, contains one or more Class::method callables or shell commands."
- },
- "pre-autoload-dump": {
- "type": ["array", "string"],
- "description": "Occurs before the autoloader is dumped, contains one or more Class::method callables or shell commands."
- },
- "post-autoload-dump": {
- "type": ["array", "string"],
- "description": "Occurs after the autoloader is dumped, contains one or more Class::method callables or shell commands."
- },
- "post-root-package-install": {
- "type": ["array", "string"],
- "description": "Occurs after the root-package is installed, contains one or more Class::method callables or shell commands."
- },
- "post-create-project-cmd": {
- "type": ["array", "string"],
- "description": "Occurs after the create-project command is executed, contains one or more Class::method callables or shell commands."
- }
- }
- },
- "support": {
- "type": "object",
- "properties": {
- "email": {
- "type": "string",
- "description": "Email address for support.",
- "format": "email"
- },
- "issues": {
- "type": "string",
- "description": "URL to the issue tracker.",
- "format": "uri"
- },
- "forum": {
- "type": "string",
- "description": "URL to the forum.",
- "format": "uri"
- },
- "wiki": {
- "type": "string",
- "description": "URL to the wiki.",
- "format": "uri"
- },
- "irc": {
- "type": "string",
- "description": "IRC channel for support, as irc://server/channel.",
- "format": "uri"
- },
- "source": {
- "type": "string",
- "description": "URL to browse or download the sources.",
- "format": "uri"
- },
- "docs": {
- "type": "string",
- "description": "URL to the documentation.",
- "format": "uri"
- }
- }
- },
- "non-feature-branches": {
- "type": ["array"],
- "description": "A set of string or regex patterns for non-numeric branch names that will not be handled as feature branches.",
- "items": {
- "type": "string"
- }
- },
- "abandoned": {
- "type": ["boolean", "string"],
- "description": "Indicates whether this package has been abandoned, it can be boolean or a package name/URL pointing to a recommended alternative. Defaults to false."
- }
- }
- }
- {
- "389-exception": [
- "389 Directory Server\nException"
- ],
- "Autoconf-exception-2.0": [
- "Autoconf exception 2.0"
- ],
- "Autoconf-exception-3.0": [
- "Autoconf exception 3.0"
- ],
- "Bison-exception-2.2": [
- "Bison exception 2.2"
- ],
- "Classpath-exception-2.0": [
- "Classpath exception 2.0"
- ],
- "CLISP-exception-2.0": [
- "CLISP exception 2.0"
- ],
- "DigiRule-FOSS-exception": [
- "DigiRule FOSS License Exception"
- ],
- "eCos-exception-2.0": [
- "eCos exception 2.0"
- ],
- "Fawkes-Runtime-exception": [
- "Fawkes Runtime Exception"
- ],
- "FLTK-exception": [
- "FLTK exception"
- ],
- "Font-exception-2.0": [
- "Font exception 2.0"
- ],
- "freertos-exception-2.0": [
- "FreeRTOS Exception 2.0"
- ],
- "GCC-exception-2.0": [
- "GCC Runtime Library exception 2.0"
- ],
- "GCC-exception-3.1": [
- "GCC Runtime Library exception 3.1"
- ],
- "gnu-javamail-exception": [
- "GNU JavaMail exception"
- ],
- "i2p-gpl-java-exception": [
- "i2p GPL+Java Exception"
- ],
- "Libtool-exception": [
- "Libtool Exception"
- ],
- "LZMA-exception": [
- "LZMA exception"
- ],
- "mif-exception": [
- "Macros and Inline Functions Exception"
- ],
- "Nokia-Qt-exception-1.1": [
- "Nokia Qt LGPL exception 1.1"
- ],
- "openvpn-openssl-exception": [
- "OpenVPN OpenSSL Exception"
- ],
- "Qwt-exception-1.0": [
- "Qwt exception 1.0"
- ],
- "u-boot-exception-2.0": [
- "U-Boot exception 2.0"
- ],
- "WxWindows-exception-3.1": [
- "WxWindows Library Exception 3.1"
- ]
- }{
- "0BSD": [
- "BSD Zero Clause License",
- false
- ],
- "AAL": [
- "Attribution Assurance License",
- true
- ],
- "Abstyles": [
- "Abstyles License",
- false
- ],
- "Adobe-2006": [
- "Adobe Systems Incorporated Source Code License Agreement",
- false
- ],
- "Adobe-Glyph": [
- "Adobe Glyph List License",
- false
- ],
- "ADSL": [
- "Amazon Digital Services License",
- false
- ],
- "AFL-1.1": [
- "Academic Free License v1.1",
- true
- ],
- "AFL-1.2": [
- "Academic Free License v1.2",
- true
- ],
- "AFL-2.0": [
- "Academic Free License v2.0",
- true
- ],
- "AFL-2.1": [
- "Academic Free License v2.1",
- true
- ],
- "AFL-3.0": [
- "Academic Free License v3.0",
- true
- ],
- "Afmparse": [
- "Afmparse License",
- false
- ],
- "AGPL-1.0": [
- "Affero General Public License v1.0",
- false
- ],
- "AGPL-3.0": [
- "GNU Affero General Public License v3.0",
- true
- ],
- "Aladdin": [
- "Aladdin Free Public License",
- false
- ],
- "AMDPLPA": [
- "AMD's plpa_map.c License",
- false
- ],
- "AML": [
- "Apple MIT License",
- false
- ],
- "AMPAS": [
- "Academy of Motion Picture Arts and Sciences BSD",
- false
- ],
- "ANTLR-PD": [
- "ANTLR Software Rights Notice",
- false
- ],
- "Apache-1.0": [
- "Apache License 1.0",
- false
- ],
- "Apache-1.1": [
- "Apache License 1.1",
- true
- ],
- "Apache-2.0": [
- "Apache License 2.0",
- true
- ],
- "APAFML": [
- "Adobe Postscript AFM License",
- false
- ],
- "APL-1.0": [
- "Adaptive Public License 1.0",
- true
- ],
- "APSL-1.0": [
- "Apple Public Source License 1.0",
- true
- ],
- "APSL-1.1": [
- "Apple Public Source License 1.1",
- true
- ],
- "APSL-1.2": [
- "Apple Public Source License 1.2",
- true
- ],
- "APSL-2.0": [
- "Apple Public Source License 2.0",
- true
- ],
- "Artistic-1.0": [
- "Artistic License 1.0",
- true
- ],
- "Artistic-1.0-cl8": [
- "Artistic License 1.0 w/clause 8",
- true
- ],
- "Artistic-1.0-Perl": [
- "Artistic License 1.0 (Perl)",
- true
- ],
- "Artistic-2.0": [
- "Artistic License 2.0",
- true
- ],
- "Bahyph": [
- "Bahyph License",
- false
- ],
- "Barr": [
- "Barr License",
- false
- ],
- "Beerware": [
- "Beerware License",
- false
- ],
- "BitTorrent-1.0": [
- "BitTorrent Open Source License v1.0",
- false
- ],
- "BitTorrent-1.1": [
- "BitTorrent Open Source License v1.1",
- false
- ],
- "Borceux": [
- "Borceux license",
- false
- ],
- "BSD-2-Clause": [
- "BSD 2-clause \"Simplified\" License",
- true
- ],
- "BSD-2-Clause-FreeBSD": [
- "BSD 2-clause FreeBSD License",
- false
- ],
- "BSD-2-Clause-NetBSD": [
- "BSD 2-clause NetBSD License",
- false
- ],
- "BSD-3-Clause": [
- "BSD 3-clause \"New\" or \"Revised\" License",
- true
- ],
- "BSD-3-Clause-Attribution": [
- "BSD with attribution",
- false
- ],
- "BSD-3-Clause-Clear": [
- "BSD 3-clause Clear License",
- false
- ],
- "BSD-3-Clause-LBNL": [
- "Lawrence Berkeley National Labs BSD variant license",
- false
- ],
- "BSD-4-Clause": [
- "BSD 4-clause \"Original\" or \"Old\" License",
- false
- ],
- "BSD-4-Clause-UC": [
- "BSD-4-Clause (University of California-Specific)",
- false
- ],
- "BSD-Protection": [
- "BSD Protection License",
- false
- ],
- "BSL-1.0": [
- "Boost Software License 1.0",
- true
- ],
- "bzip2-1.0.5": [
- "bzip2 and libbzip2 License v1.0.5",
- false
- ],
- "bzip2-1.0.6": [
- "bzip2 and libbzip2 License v1.0.6",
- false
- ],
- "Caldera": [
- "Caldera License",
- false
- ],
- "CATOSL-1.1": [
- "Computer Associates Trusted Open Source License 1.1",
- true
- ],
- "CC-BY-1.0": [
- "Creative Commons Attribution 1.0",
- false
- ],
- "CC-BY-2.0": [
- "Creative Commons Attribution 2.0",
- false
- ],
- "CC-BY-2.5": [
- "Creative Commons Attribution 2.5",
- false
- ],
- "CC-BY-3.0": [
- "Creative Commons Attribution 3.0",
- false
- ],
- "CC-BY-4.0": [
- "Creative Commons Attribution 4.0",
- false
- ],
- "CC-BY-NC-1.0": [
- "Creative Commons Attribution Non Commercial 1.0",
- false
- ],
- "CC-BY-NC-2.0": [
- "Creative Commons Attribution Non Commercial 2.0",
- false
- ],
- "CC-BY-NC-2.5": [
- "Creative Commons Attribution Non Commercial 2.5",
- false
- ],
- "CC-BY-NC-3.0": [
- "Creative Commons Attribution Non Commercial 3.0",
- false
- ],
- "CC-BY-NC-4.0": [
- "Creative Commons Attribution Non Commercial 4.0",
- false
- ],
- "CC-BY-NC-ND-1.0": [
- "Creative Commons Attribution Non Commercial No Derivatives 1.0",
- false
- ],
- "CC-BY-NC-ND-2.0": [
- "Creative Commons Attribution Non Commercial No Derivatives 2.0",
- false
- ],
- "CC-BY-NC-ND-2.5": [
- "Creative Commons Attribution Non Commercial No Derivatives 2.5",
- false
- ],
- "CC-BY-NC-ND-3.0": [
- "Creative Commons Attribution Non Commercial No Derivatives 3.0",
- false
- ],
- "CC-BY-NC-ND-4.0": [
- "Creative Commons Attribution Non Commercial No Derivatives 4.0",
- false
- ],
- "CC-BY-NC-SA-1.0": [
- "Creative Commons Attribution Non Commercial Share Alike 1.0",
- false
- ],
- "CC-BY-NC-SA-2.0": [
- "Creative Commons Attribution Non Commercial Share Alike 2.0",
- false
- ],
- "CC-BY-NC-SA-2.5": [
- "Creative Commons Attribution Non Commercial Share Alike 2.5",
- false
- ],
- "CC-BY-NC-SA-3.0": [
- "Creative Commons Attribution Non Commercial Share Alike 3.0",
- false
- ],
- "CC-BY-NC-SA-4.0": [
- "Creative Commons Attribution Non Commercial Share Alike 4.0",
- false
- ],
- "CC-BY-ND-1.0": [
- "Creative Commons Attribution No Derivatives 1.0",
- false
- ],
- "CC-BY-ND-2.0": [
- "Creative Commons Attribution No Derivatives 2.0",
- false
- ],
- "CC-BY-ND-2.5": [
- "Creative Commons Attribution No Derivatives 2.5",
- false
- ],
- "CC-BY-ND-3.0": [
- "Creative Commons Attribution No Derivatives 3.0",
- false
- ],
- "CC-BY-ND-4.0": [
- "Creative Commons Attribution No Derivatives 4.0",
- false
- ],
- "CC-BY-SA-1.0": [
- "Creative Commons Attribution Share Alike 1.0",
- false
- ],
- "CC-BY-SA-2.0": [
- "Creative Commons Attribution Share Alike 2.0",
- false
- ],
- "CC-BY-SA-2.5": [
- "Creative Commons Attribution Share Alike 2.5",
- false
- ],
- "CC-BY-SA-3.0": [
- "Creative Commons Attribution Share Alike 3.0",
- false
- ],
- "CC-BY-SA-4.0": [
- "Creative Commons Attribution Share Alike 4.0",
- false
- ],
- "CC0-1.0": [
- "Creative Commons Zero v1.0 Universal",
- false
- ],
- "CDDL-1.0": [
- "Common Development and Distribution License 1.0",
- true
- ],
- "CDDL-1.1": [
- "Common Development and Distribution License 1.1",
- false
- ],
- "CECILL-1.0": [
- "CeCILL Free Software License Agreement v1.0",
- false
- ],
- "CECILL-1.1": [
- "CeCILL Free Software License Agreement v1.1",
- false
- ],
- "CECILL-2.0": [
- "CeCILL Free Software License Agreement v2.0",
- false
- ],
- "CECILL-2.1": [
- "CeCILL Free Software License Agreement v2.1",
- true
- ],
- "CECILL-B": [
- "CeCILL-B Free Software License Agreement",
- false
- ],
- "CECILL-C": [
- "CeCILL-C Free Software License Agreement",
- false
- ],
- "ClArtistic": [
- "Clarified Artistic License",
- false
- ],
- "CNRI-Jython": [
- "CNRI Jython License",
- false
- ],
- "CNRI-Python": [
- "CNRI Python License",
- true
- ],
- "CNRI-Python-GPL-Compatible": [
- "CNRI Python Open Source GPL Compatible License Agreement",
- false
- ],
- "Condor-1.1": [
- "Condor Public License v1.1",
- false
- ],
- "CPAL-1.0": [
- "Common Public Attribution License 1.0",
- true
- ],
- "CPL-1.0": [
- "Common Public License 1.0",
- true
- ],
- "CPOL-1.02": [
- "Code Project Open License 1.02",
- false
- ],
- "Crossword": [
- "Crossword License",
- false
- ],
- "CrystalStacker": [
- "CrystalStacker License",
- false
- ],
- "CUA-OPL-1.0": [
- "CUA Office Public License v1.0",
- true
- ],
- "Cube": [
- "Cube License",
- false
- ],
- "D-FSL-1.0": [
- "Deutsche Freie Software Lizenz",
- false
- ],
- "diffmark": [
- "diffmark license",
- false
- ],
- "DOC": [
- "DOC License",
- false
- ],
- "Dotseqn": [
- "Dotseqn License",
- false
- ],
- "DSDP": [
- "DSDP License",
- false
- ],
- "dvipdfm": [
- "dvipdfm License",
- false
- ],
- "ECL-1.0": [
- "Educational Community License v1.0",
- true
- ],
- "ECL-2.0": [
- "Educational Community License v2.0",
- true
- ],
- "EFL-1.0": [
- "Eiffel Forum License v1.0",
- true
- ],
- "EFL-2.0": [
- "Eiffel Forum License v2.0",
- true
- ],
- "eGenix": [
- "eGenix.com Public License 1.1.0",
- false
- ],
- "Entessa": [
- "Entessa Public License v1.0",
- true
- ],
- "EPL-1.0": [
- "Eclipse Public License 1.0",
- true
- ],
- "ErlPL-1.1": [
- "Erlang Public License v1.1",
- false
- ],
- "EUDatagrid": [
- "EU DataGrid Software License",
- true
- ],
- "EUPL-1.0": [
- "European Union Public License 1.0",
- false
- ],
- "EUPL-1.1": [
- "European Union Public License 1.1",
- true
- ],
- "Eurosym": [
- "Eurosym License",
- false
- ],
- "Fair": [
- "Fair License",
- true
- ],
- "Frameworx-1.0": [
- "Frameworx Open License 1.0",
- true
- ],
- "FreeImage": [
- "FreeImage Public License v1.0",
- false
- ],
- "FSFUL": [
- "FSF Unlimited License",
- false
- ],
- "FSFULLR": [
- "FSF Unlimited License (with License Retention)",
- false
- ],
- "FTL": [
- "Freetype Project License",
- false
- ],
- "GFDL-1.1": [
- "GNU Free Documentation License v1.1",
- false
- ],
- "GFDL-1.2": [
- "GNU Free Documentation License v1.2",
- false
- ],
- "GFDL-1.3": [
- "GNU Free Documentation License v1.3",
- false
- ],
- "Giftware": [
- "Giftware License",
- false
- ],
- "GL2PS": [
- "GL2PS License",
- false
- ],
- "Glide": [
- "3dfx Glide License",
- false
- ],
- "Glulxe": [
- "Glulxe License",
- false
- ],
- "gnuplot": [
- "gnuplot License",
- false
- ],
- "GPL-1.0": [
- "GNU General Public License v1.0 only",
- false
- ],
- "GPL-2.0": [
- "GNU General Public License v2.0 only",
- true
- ],
- "GPL-3.0": [
- "GNU General Public License v3.0 only",
- true
- ],
- "gSOAP-1.3b": [
- "gSOAP Public License v1.3b",
- false
- ],
- "HaskellReport": [
- "Haskell Language Report License",
- false
- ],
- "HPND": [
- "Historic Permission Notice and Disclaimer",
- true
- ],
- "IBM-pibs": [
- "IBM PowerPC Initialization and Boot Software",
- false
- ],
- "ICU": [
- "ICU License",
- false
- ],
- "IJG": [
- "Independent JPEG Group License",
- false
- ],
- "ImageMagick": [
- "ImageMagick License",
- false
- ],
- "iMatix": [
- "iMatix Standard Function Library Agreement",
- false
- ],
- "Imlib2": [
- "Imlib2 License",
- false
- ],
- "Intel": [
- "Intel Open Source License",
- true
- ],
- "Intel-ACPI": [
- "Intel ACPI Software License Agreement",
- false
- ],
- "Interbase-1.0": [
- "Interbase Public License v1.0",
- false
- ],
- "IPA": [
- "IPA Font License",
- true
- ],
- "IPL-1.0": [
- "IBM Public License v1.0",
- true
- ],
- "ISC": [
- "ISC License",
- true
- ],
- "JasPer-2.0": [
- "JasPer License",
- false
- ],
- "JSON": [
- "JSON License",
- false
- ],
- "Latex2e": [
- "Latex2e License",
- false
- ],
- "Leptonica": [
- "Leptonica License",
- false
- ],
- "LGPL-2.0": [
- "GNU Library General Public License v2 only",
- true
- ],
- "LGPL-2.1": [
- "GNU Lesser General Public License v2.1 only",
- true
- ],
- "LGPL-3.0": [
- "GNU Lesser General Public License v3.0 only",
- true
- ],
- "LGPLLR": [
- "Lesser General Public License For Linguistic Resources",
- false
- ],
- "Libpng": [
- "libpng License",
- false
- ],
- "libtiff": [
- "libtiff License",
- false
- ],
- "LPL-1.0": [
- "Lucent Public License Version 1.0",
- true
- ],
- "LPL-1.02": [
- "Lucent Public License v1.02",
- true
- ],
- "LPPL-1.0": [
- "LaTeX Project Public License v1.0",
- false
- ],
- "LPPL-1.1": [
- "LaTeX Project Public License v1.1",
- false
- ],
- "LPPL-1.2": [
- "LaTeX Project Public License v1.2",
- false
- ],
- "LPPL-1.3a": [
- "LaTeX Project Public License 1.3a",
- false
- ],
- "LPPL-1.3c": [
- "LaTeX Project Public License v1.3c",
- true
- ],
- "MakeIndex": [
- "MakeIndex License",
- false
- ],
- "MirOS": [
- "MirOS Licence",
- true
- ],
- "MIT": [
- "MIT License",
- true
- ],
- "MIT-advertising": [
- "Enlightenment License (e16)",
- false
- ],
- "MIT-CMU": [
- "CMU License",
- false
- ],
- "MIT-enna": [
- "enna License",
- false
- ],
- "MIT-feh": [
- "feh License",
- false
- ],
- "MITNFA": [
- "MIT +no-false-attribs license",
- false
- ],
- "Motosoto": [
- "Motosoto License",
- true
- ],
- "mpich2": [
- "mpich2 License",
- false
- ],
- "MPL-1.0": [
- "Mozilla Public License 1.0",
- true
- ],
- "MPL-1.1": [
- "Mozilla Public License 1.1",
- true
- ],
- "MPL-2.0": [
- "Mozilla Public License 2.0",
- true
- ],
- "MPL-2.0-no-copyleft-exception": [
- "Mozilla Public License 2.0 (no copyleft exception)",
- true
- ],
- "MS-PL": [
- "Microsoft Public License",
- true
- ],
- "MS-RL": [
- "Microsoft Reciprocal License",
- true
- ],
- "MTLL": [
- "Matrix Template Library License",
- false
- ],
- "Multics": [
- "Multics License",
- true
- ],
- "Mup": [
- "Mup License",
- false
- ],
- "NASA-1.3": [
- "NASA Open Source Agreement 1.3",
- true
- ],
- "Naumen": [
- "Naumen Public License",
- true
- ],
- "NBPL-1.0": [
- "Net Boolean Public License v1",
- false
- ],
- "NCSA": [
- "University of Illinois/NCSA Open Source License",
- true
- ],
- "NetCDF": [
- "NetCDF license",
- false
- ],
- "Newsletr": [
- "Newsletr License",
- false
- ],
- "NGPL": [
- "Nethack General Public License",
- true
- ],
- "NLPL": [
- "No Limit Public License",
- false
- ],
- "Nokia": [
- "Nokia Open Source License",
- true
- ],
- "NOSL": [
- "Netizen Open Source License",
- false
- ],
- "Noweb": [
- "Noweb License",
- false
- ],
- "NPL-1.0": [
- "Netscape Public License v1.0",
- false
- ],
- "NPL-1.1": [
- "Netscape Public License v1.1",
- false
- ],
- "NPOSL-3.0": [
- "Non-Profit Open Software License 3.0",
- true
- ],
- "NRL": [
- "NRL License",
- false
- ],
- "NTP": [
- "NTP License",
- true
- ],
- "Nunit": [
- "Nunit License",
- false
- ],
- "OCLC-2.0": [
- "OCLC Research Public License 2.0",
- true
- ],
- "ODbL-1.0": [
- "ODC Open Database License v1.0",
- false
- ],
- "OFL-1.0": [
- "SIL Open Font License 1.0",
- false
- ],
- "OFL-1.1": [
- "SIL Open Font License 1.1",
- true
- ],
- "OGTSL": [
- "Open Group Test Suite License",
- true
- ],
- "OLDAP-1.1": [
- "Open LDAP Public License v1.1",
- false
- ],
- "OLDAP-1.2": [
- "Open LDAP Public License v1.2",
- false
- ],
- "OLDAP-1.3": [
- "Open LDAP Public License v1.3",
- false
- ],
- "OLDAP-1.4": [
- "Open LDAP Public License v1.4",
- false
- ],
- "OLDAP-2.0": [
- "Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)",
- false
- ],
- "OLDAP-2.0.1": [
- "Open LDAP Public License v2.0.1",
- false
- ],
- "OLDAP-2.1": [
- "Open LDAP Public License v2.1",
- false
- ],
- "OLDAP-2.2": [
- "Open LDAP Public License v2.2",
- false
- ],
- "OLDAP-2.2.1": [
- "Open LDAP Public License v2.2.1",
- false
- ],
- "OLDAP-2.2.2": [
- "Open LDAP Public License 2.2.2",
- false
- ],
- "OLDAP-2.3": [
- "Open LDAP Public License v2.3",
- false
- ],
- "OLDAP-2.4": [
- "Open LDAP Public License v2.4",
- false
- ],
- "OLDAP-2.5": [
- "Open LDAP Public License v2.5",
- false
- ],
- "OLDAP-2.6": [
- "Open LDAP Public License v2.6",
- false
- ],
- "OLDAP-2.7": [
- "Open LDAP Public License v2.7",
- false
- ],
- "OLDAP-2.8": [
- "Open LDAP Public License v2.8",
- false
- ],
- "OML": [
- "Open Market License",
- false
- ],
- "OpenSSL": [
- "OpenSSL License",
- false
- ],
- "OPL-1.0": [
- "Open Public License v1.0",
- false
- ],
- "OSL-1.0": [
- "Open Software License 1.0",
- true
- ],
- "OSL-1.1": [
- "Open Software License 1.1",
- false
- ],
- "OSL-2.0": [
- "Open Software License 2.0",
- true
- ],
- "OSL-2.1": [
- "Open Software License 2.1",
- true
- ],
- "OSL-3.0": [
- "Open Software License 3.0",
- true
- ],
- "PDDL-1.0": [
- "ODC Public Domain Dedication & License 1.0",
- false
- ],
- "PHP-3.0": [
- "PHP License v3.0",
- true
- ],
- "PHP-3.01": [
- "PHP License v3.01",
- false
- ],
- "Plexus": [
- "Plexus Classworlds License",
- false
- ],
- "PostgreSQL": [
- "PostgreSQL License",
- true
- ],
- "psfrag": [
- "psfrag License",
- false
- ],
- "psutils": [
- "psutils License",
- false
- ],
- "Python-2.0": [
- "Python License 2.0",
- true
- ],
- "Qhull": [
- "Qhull License",
- false
- ],
- "QPL-1.0": [
- "Q Public License 1.0",
- true
- ],
- "Rdisc": [
- "Rdisc License",
- false
- ],
- "RHeCos-1.1": [
- "Red Hat eCos Public License v1.1",
- false
- ],
- "RPL-1.1": [
- "Reciprocal Public License 1.1",
- true
- ],
- "RPL-1.5": [
- "Reciprocal Public License 1.5",
- true
- ],
- "RPSL-1.0": [
- "RealNetworks Public Source License v1.0",
- true
- ],
- "RSA-MD": [
- "RSA Message-Digest License",
- false
- ],
- "RSCPL": [
- "Ricoh Source Code Public License",
- true
- ],
- "Ruby": [
- "Ruby License",
- false
- ],
- "SAX-PD": [
- "Sax Public Domain Notice",
- false
- ],
- "Saxpath": [
- "Saxpath License",
- false
- ],
- "SCEA": [
- "SCEA Shared Source License",
- false
- ],
- "Sendmail": [
- "Sendmail License",
- false
- ],
- "SGI-B-1.0": [
- "SGI Free Software License B v1.0",
- false
- ],
- "SGI-B-1.1": [
- "SGI Free Software License B v1.1",
- false
- ],
- "SGI-B-2.0": [
- "SGI Free Software License B v2.0",
- false
- ],
- "SimPL-2.0": [
- "Simple Public License 2.0",
- true
- ],
- "SISSL": [
- "Sun Industry Standards Source License v1.1",
- true
- ],
- "SISSL-1.2": [
- "Sun Industry Standards Source License v1.2",
- false
- ],
- "Sleepycat": [
- "Sleepycat License",
- true
- ],
- "SMLNJ": [
- "Standard ML of New Jersey License",
- false
- ],
- "SNIA": [
- "SNIA Public License 1.1",
- false
- ],
- "Spencer-86": [
- "Spencer License 86",
- false
- ],
- "Spencer-94": [
- "Spencer License 94",
- false
- ],
- "Spencer-99": [
- "Spencer License 99",
- false
- ],
- "SPL-1.0": [
- "Sun Public License v1.0",
- true
- ],
- "SugarCRM-1.1.3": [
- "SugarCRM Public License v1.1.3",
- false
- ],
- "SWL": [
- "Scheme Widget Library (SWL) Software License Agreement",
- false
- ],
- "TCL": [
- "TCL/TK License",
- false
- ],
- "TMate": [
- "TMate Open Source License",
- false
- ],
- "TORQUE-1.1": [
- "TORQUE v2.5+ Software License v1.1",
- false
- ],
- "TOSL": [
- "Trusster Open Source License",
- false
- ],
- "Unicode-TOU": [
- "Unicode Terms of Use",
- false
- ],
- "Unlicense": [
- "The Unlicense",
- false
- ],
- "UPL-1.0": [
- "Universal Permissive License v1.0",
- true
- ],
- "Vim": [
- "Vim License",
- false
- ],
- "VOSTROM": [
- "VOSTROM Public License for Open Source",
- false
- ],
- "VSL-1.0": [
- "Vovida Software License v1.0",
- true
- ],
- "W3C": [
- "W3C Software Notice and License (2002-12-31)",
- true
- ],
- "W3C-19980720": [
- "W3C Software Notice and License (1998-07-20)",
- false
- ],
- "Watcom-1.0": [
- "Sybase Open Watcom Public License 1.0",
- true
- ],
- "Wsuipa": [
- "Wsuipa License",
- false
- ],
- "WTFPL": [
- "Do What The F*ck You Want To Public License",
- false
- ],
- "X11": [
- "X11 License",
- false
- ],
- "Xerox": [
- "Xerox License",
- false
- ],
- "XFree86-1.1": [
- "XFree86 License 1.1",
- false
- ],
- "xinetd": [
- "xinetd License",
- false
- ],
- "Xnet": [
- "X.Net License",
- true
- ],
- "xpp": [
- "XPP License",
- false
- ],
- "XSkat": [
- "XSkat License",
- false
- ],
- "YPL-1.0": [
- "Yahoo! Public License v1.0",
- false
- ],
- "YPL-1.1": [
- "Yahoo! Public License v1.1",
- false
- ],
- "Zed": [
- "Zed License",
- false
- ],
- "Zend-2.0": [
- "Zend License v2.0",
- false
- ],
- "Zimbra-1.3": [
- "Zimbra Public License v1.3",
- false
- ],
- "Zimbra-1.4": [
- "Zimbra Public License v1.4",
- false
- ],
- "Zlib": [
- "zlib License",
- true
- ],
- "zlib-acknowledgement": [
- "zlib/libpng License with Acknowledgement",
- false
- ],
- "ZPL-1.1": [
- "Zope Public License 1.1",
- false
- ],
- "ZPL-2.0": [
- "Zope Public License 2.0",
- true
- ],
- "ZPL-2.1": [
- "Zope Public License 2.1",
- false
- ]
- }MZ��������ÿÿ��¸�������@�����������������������������������è���º�´ Í!¸LÍ!This program cannot be run in DOS mode.
- $�������Æ,Í;§Bž;§Bž;§Bž2ßמ:§Bž2ßÁž-§Bž2ßÆž9§Bž2ßÑž?§Bža9ž8§Bž;§Cž§Bž2ßÈž:§Bž2ßÖž:§Bž2ßÓž:§BžRich;§Bž��������PE��L�¬MoO��������à� ��
- ���������8������ ����@����������������������`�����?œ���@�����������������������������"��P����@�� �������������������P��p���!�����������������������������8!��@������������ ��Ø���������������������������.text��� ������
- ����������������� ��`.rdata����� ���
- �����������������@��@.data�������0��������������������@��À.rsrc��� ���@��������������������@��@.reloc��Ì���P������"��������������@��B��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������j$¸æ@�èx��jöÿ @�ƒeÐ�‹ð�EÐPVÿ� @�‹EЃàûPVÿ @��MÔÿX @�ƒeü��EÔPÿ5H @�ÿL @�YYÿ5\ @��EÔPÿ5` @�ÿD @�YY‹ÈÿP @�ƒMüÿ�MÔÿT @�3ÀèH��Ã;
�0@�uóÃé¬��h€@�è£��¡l3@�Ç$40@�ÿ5h3@�£40@�h$0@�h(0@�h 0@�ÿ @�ƒÄ£00@�…À}jè¹��YÃjh"@�è��3Û‰]üd¡���‹p‰]ä¿€3@�SVWÿ0 @�;Ãt;Æu3öF‰uäëhè��ÿ4 @�ëÚ3öF¡|3@�;Æu
- jè\��Yë;¡|3@�…Àu,‰5|3@�hð @�hä @�è§��YY…ÀtÇEüþÿÿÿ¸ÿ���éÝ���‰5<0@�¡|3@�;Æuhà @�hØ @�èl��YYÇ|3@����9]äuSWÿ8 @�9Œ3@�thŒ3@�èƒ��Y…Àt
- SjSÿŒ3@�¡$0@�‹
¼ @�‰ÿ5$0@�ÿ5(0@�ÿ5 0@�èþÿÿƒÄ£80@�9,0@�u7PÿÀ @�‹Eì‹‹ ‰MàPQèŽ��YYËeè‹Eà£80@�3Û9,0@�uPÿh @�9<0@�uÿœ @�ÇEüþÿÿÿ¡80@�èû��øMZ��f9��@�t3ÀëM¡<�@��€��@��8PE��ué·H�ù��t�ù��uÕƒ¸„���vÌ3É9ˆø���ëƒxtv¼3É9ˆè���•Á‹Áj£,0@�ÿp @�jÿÿl @�YY£„3@�£ˆ3@�ÿÌ @�‹
t3@�‰ÿˆ @�‹
p3@�‰¡¨ @�‹�£x3@�èV��è¬��ƒ=0@��uhµ@�ÿ¬ @�Yèg��ƒ=0@�ÿu jÿÿ° @�Y3ÀÃè{��éŸýÿÿ‹ÿU‹ì�ì(��£H1@�‰
D1@�‰@1@�‰<1@�‰581@�‰=41@�fŒ`1@�fŒ
T1@�fŒ01@�fŒ,1@�fŒ%(1@�fŒ-$1@�œ�X1@�‹E�£L1@�‹E£P1@��E£\1@�‹…àüÿÿǘ0@���¡P1@�£L0@�Ç@0@� �ÀÇD0@����¡�0@�‰…Øüÿÿ¡0@�‰…Üüÿÿÿ @�£�0@�jè?��Yj�ÿ @�h!@�ÿ$ @�ƒ=�0@��ujè��Yh �Àÿ( @�Pÿ, @�ÉËÿU‹ì‹E‹��8csmàu*ƒxu$‹@= “t=!“t="“t=�@™uèÐ��3À]Â�hH@�ÿ @�3ÀÃÿ%¤ @�jh("@�èb��ÿ5ˆ3@�‹5Œ @�ÿÖY‰EäƒøÿuÿuÿÄ @�Yëgjè’��Yƒeü�ÿ5ˆ3@�ÿÖ‰Eäÿ5„3@�ÿÖYY‰Eà�EàP�EäPÿu‹5l @�ÿÖYPèU��‰EÜÿuäÿÖ£ˆ3@�ÿuàÿփģ„3@�ÇEüþÿÿÿè ���‹EÜè��Ãjè��YËÿU‹ìÿuèNÿÿÿ÷ØÀ÷ØYH]ËÿV¸ü!@�¾ü!@�W‹ø;Æs‹…ÀtÿЃÇ;þrñ_^ËÿV¸"@�¾"@�W‹ø;Æs‹…ÀtÿЃÇ;þrñ_^Ãÿ%È @�ÌÌÌÌ‹ÿU‹ì‹M¸MZ��f9t3À]ËA<Á�8PE��uï3Ò¹��f9H”‹Â]ÃÌÌÌÌÌÌÌÌÌÌÌ‹ÿU‹ì‹E‹H<È·ASV·q3ÒW�D…öv‹}‹H;ùr ‹XÙ;ûr
- BƒÀ(;Örè3À_^[]ÃÌÌÌÌÌÌÌÌÌÌÌÌ‹ÿU‹ìjþhH"@�he@�d¡����PƒìSVW¡�0@�1Eø3ÅP�Eðd£����‰eèÇEü����h��@�è*ÿÿÿƒÄ…ÀtU‹E-��@�Ph��@�èPÿÿÿƒÄ…Àt;‹@$Áè÷ЃàÇEüþÿÿÿ‹Mðd‰
����Y_^[‹å]ËEì‹‹3Ò=��À”‹ÂËeèÇEüþÿÿÿ3À‹Mðd‰
����Y_^[‹å]ÃÌÿ%¸ @�ÿ%´ @�ÌÌhe@�dÿ5����‹D$‰l$�l$+àSVW¡�0@�1Eü3ÅP‰eèÿuø‹EüÇEüþÿÿÿ‰Eø�Eðd£����ËMðd‰
����Y__^[‹å]QËÿU‹ìÿuÿuÿuÿuh‡@�h�0@�èç���ƒÄ]ËÿVh���h���3öVèÙ���ƒÄ…Àt
VVVVVèÂ���ƒÄ^Ã3ÀËÿU‹ìƒì¡�0@�ƒeø�ƒeü�SW¿Næ@»»��ÿÿ;Çt
…Ãt ÷У0@�ë`V�EøPÿ< @�‹uü3uøÿ @�3ðÿ @�3ðÿ @�3ð�EðPÿ @�‹Eô3Eð3ð;÷u¾Oæ@»ë…óu‹ÆÁàð‰5�0@�÷Ö‰50@�^_[ÉÃÿ%t @�ÿ%x @�ÿ%| @�ÿ%€ @�ÿ%„ @�ÿ%� @�ÿ%” @�ÿ%˜ @�ÿ%Ð @�Pdÿ5�����D$+d$SVW‰(‹è¡�0@�3ÅP‰EðÿuüÇEüÿÿÿÿ�Eôd£����ËMôd‰
����Y__^[‹å]QËMð3Íè¯÷ÿÿéÝÿÿÿ�MÔÿ%T @�‹T$�B‹JÌ3Èè�÷ÿÿ‹Jü3Èè†÷ÿÿ¸l"@�ésÿÿÿ�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������¸#��Ê#��Ü#��ˆ)��r)��b)��H)��4)��)��ú(��æ(��Ò(��´(��¬(��–(��ž)������ú#��à$��%��Ê%��&��d&��®&��¤$������('��Ä'��Ö'��è'��þ'��(��((��6(��¦'��H(��Z(��t(��†(��'��'���'��–'��‚'��l'��^'��R'��F'��>'��>(��0'��¶'��¸)����������–@���������W@�Š@���������������������¬MoO�������l���€!��€��@0@�˜0@�bad allocation������H������������������������������������������������������������0@�ð!@����RSDSÑŒ³´�J¨!öÌëLZ����c:\users\seld\documents\visual studio 2010\Projects\hiddeninp\Release\hiddeninp.pdb�����e��æ������������������þÿÿÿ����Ðÿÿÿ����þÿÿÿ@�@�����þÿÿÿ����Ìÿÿÿ����þÿÿÿ����:@�����þÿÿÿ����Øÿÿÿ����þÿÿÿË@�ß@�ÿÿÿÿÝ@�"“���d"@������������������������à"����������ì#��� ��$#����������ô&��D ��H#����������(��h ����������������������¸#��Ê#��Ü#��ˆ)��r)��b)��H)��4)��)��ú(��æ(��Ò(��´(��¬(��–(��ž)������ú#��à$��%��Ê%��&��d&��®&��¤$������('��Ä'��Ö'��è'��þ'��(��((��6(��¦'��H(��Z(��t(��†(��'��'���'��–'��‚'��l'��^'��R'��F'��>'��>(��0'��¶'��¸)������•GetConsoleMode��·SetConsoleMode��;GetStdHandle��KERNEL32.dll���??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z�‘?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A��J?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A�Â�??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z�??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z��_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ��{??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ��³?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z��MSVCP90.dll�_amsg_exit��Ÿ�__getmainargs�,_cexit��|_exit�f�_XcptFilter�Ìexit�� �__initenv�_initterm�_initterm_e�<_configthreadlocale�ã�__setusermatherr��_adjust_fdiv��Ë�__p__commode��Ï�__p__fmode��j_encode_pointer�à�__set_app_type��K_crt_debugger_hook��C�?terminate@@YAXXZ�MSVCR90.dll�æ_unlock�–�__dllonexit�v_lock�_onexit�`_decode_pointer�s_except_handler4_common�_invoke_watson��?_controlfp_s��½InterlockedExchange�!Sleep�ºInterlockedCompareExchange��-TerminateProcess��©GetCurrentProcess�>UnhandledExceptionFilter��SetUnhandledExceptionFilter�ÑIsDebuggerPresent�TQueryPerformanceCounter�fGetTickCount��GetCurrentThreadId��ªGetCurrentProcessId�OGetSystemTimeAsFileTime�s�__CxxFrameHandler3����������������������������������������������������Næ@»±¿Dÿÿÿÿÿÿÿÿþÿÿÿ���$!@���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ��€���8��€�����������������P��€�����������������h��€�������������� ��€����������������� ������ @��(��ä������ÈC��V��ä������(4���V�S�_�V�E�R�S�I�O�N�_�I�N�F�O�����½ïþ������������������������������������������†���S�t�r�i�n�g�F�i�l�e�I�n�f�o���b���0�4�0�9�0�4�b�0���Ê�Q��F�i�l�e�D�e�s�c�r�i�p�t�i�o�n�����R�e�a�d�s� �f�r�o�m� �s�t�d�i�n� �w�i�t�h�o�u�t� �l�e�a�k�i�n�g� �i�n�f�o� �t�o� �t�h�e� �t�e�r�m�i�n�a�l� �a�n�d� �o�u�t�p�u�t�s� �b�a�c�k� �t�o� �s�t�d�o�u�t�����6���F�i�l�e�V�e�r�s�i�o�n�����1�,� �0�,� �0�,� �0�����8���I�n�t�e�r�n�a�l�N�a�m�e���h�i�d�d�e�n�i�n�p�u�t���P���L�e�g�a�l�C�o�p�y�r�i�g�h�t���J�o�r�d�i� �B�o�g�g�i�a�n�o� �-� �2�0�1�2���H���O�r�i�g�i�n�a�l�F�i�l�e�n�a�m�e���h�i�d�d�e�n�i�n�p�u�t�.�e�x�e���:�
��P�r�o�d�u�c�t�N�a�m�e�����H�i�d�d�e�n� �I�n�p�u�t�����:���P�r�o�d�u�c�t�V�e�r�s�i�o�n���1�,� �0�,� �0�,� �0�����D����V�a�r�F�i�l�e�I�n�f�o�����$����T�r�a�n�s�l�a�t�i�o�n����� °<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
- <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
- <security>
- <requestedPrivileges>
- <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
- </requestedPrivileges>
- </security>
- </trustInfo>
- <dependency>
- <dependentAssembly>
- <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
- </dependentAssembly>
- </dependency>
- </assembly>PAPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDING���@��00!0/080F0L0T0^0d0n0{0‰0—0¡0¨0®0³0¸0½0Â0È0Ð0ä0ÿ01#1-1@1J1O1T1v1{1„1‰1–1§11´1È1Í1Ó1Û1á1ç1ô1ú12"2*23292A2M2_2j2p2¹2¿2Ç2Î2Ó2Ù2ß2ç2í2ô2û2333%303N3T3Z3`3f3l3s3z3�3ˆ3�3–3�3¥33µ3Á3Ê3Ï3Õ3ß3è3ó3ÿ34444%4;4B4‹4‘4š4¡4¬4²4Æ4Û4æ4þ45!5^5c5„5‰5¨5H6M6_6}6‘6—6�77
7*7w7|7Á7ä7ñ7ý78
88=8E8P8V8\8b8h8n8t8z8€8œ8â89��� ��$���Ü0è0ì01 1t1x12 2@2\2`2h2t2�0�����0��������������������������������������������������������������������������������������������������������������������������������������������������<?php
- namespace Symfony\Component\Console;
- use Symfony\Component\Console\Descriptor\TextDescriptor;
- use Symfony\Component\Console\Descriptor\XmlDescriptor;
- use Symfony\Component\Console\Exception\ExceptionInterface;
- use Symfony\Component\Console\Helper\DebugFormatterHelper;
- use Symfony\Component\Console\Helper\ProcessHelper;
- use Symfony\Component\Console\Helper\QuestionHelper;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\ArgvInput;
- use Symfony\Component\Console\Input\ArrayInput;
- use Symfony\Component\Console\Input\InputDefinition;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputAwareInterface;
- use Symfony\Component\Console\Output\BufferedOutput;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Output\ConsoleOutput;
- use Symfony\Component\Console\Output\ConsoleOutputInterface;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Command\HelpCommand;
- use Symfony\Component\Console\Command\ListCommand;
- use Symfony\Component\Console\Helper\HelperSet;
- use Symfony\Component\Console\Helper\FormatterHelper;
- use Symfony\Component\Console\Helper\DialogHelper;
- use Symfony\Component\Console\Helper\ProgressHelper;
- use Symfony\Component\Console\Helper\TableHelper;
- use Symfony\Component\Console\Event\ConsoleCommandEvent;
- use Symfony\Component\Console\Event\ConsoleExceptionEvent;
- use Symfony\Component\Console\Event\ConsoleTerminateEvent;
- use Symfony\Component\Console\Exception\CommandNotFoundException;
- use Symfony\Component\Console\Exception\LogicException;
- use Symfony\Component\EventDispatcher\EventDispatcherInterface;
- class Application
- {
- private $commands = array();
- private $wantHelps = false;
- private $runningCommand;
- private $name;
- private $version;
- private $catchExceptions = true;
- private $autoExit = true;
- private $definition;
- private $helperSet;
- private $dispatcher;
- private $terminalDimensions;
- private $defaultCommand;
- public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
- {
- $this->name = $name;
- $this->version = $version;
- $this->defaultCommand = 'list';
- $this->helperSet = $this->getDefaultHelperSet();
- $this->definition = $this->getDefaultInputDefinition();
- foreach ($this->getDefaultCommands() as $command) {
- $this->add($command);
- }
- }
- public function setDispatcher(EventDispatcherInterface $dispatcher)
- {
- $this->dispatcher = $dispatcher;
- }
- public function run(InputInterface $input = null, OutputInterface $output = null)
- {
- if (null === $input) {
- $input = new ArgvInput();
- }
- if (null === $output) {
- $output = new ConsoleOutput();
- }
- $this->configureIO($input, $output);
- try {
- $exitCode = $this->doRun($input, $output);
- } catch (\Exception $e) {
- if (!$this->catchExceptions) {
- throw $e;
- }
- if ($output instanceof ConsoleOutputInterface) {
- $this->renderException($e, $output->getErrorOutput());
- } else {
- $this->renderException($e, $output);
- }
- $exitCode = $e->getCode();
- if (is_numeric($exitCode)) {
- $exitCode = (int) $exitCode;
- if (0 === $exitCode) {
- $exitCode = 1;
- }
- } else {
- $exitCode = 1;
- }
- }
- if ($this->autoExit) {
- if ($exitCode > 255) {
- $exitCode = 255;
- }
- exit($exitCode);
- }
- return $exitCode;
- }
- public function doRun(InputInterface $input, OutputInterface $output)
- {
- if (true === $input->hasParameterOption(array('--version', '-V'))) {
- $output->writeln($this->getLongVersion());
- return 0;
- }
- $name = $this->getCommandName($input);
- if (true === $input->hasParameterOption(array('--help', '-h'))) {
- if (!$name) {
- $name = 'help';
- $input = new ArrayInput(array('command' => 'help'));
- } else {
- $this->wantHelps = true;
- }
- }
- if (!$name) {
- $name = $this->defaultCommand;
- $input = new ArrayInput(array('command' => $this->defaultCommand));
- }
- $command = $this->find($name);
- $this->runningCommand = $command;
- $exitCode = $this->doRunCommand($command, $input, $output);
- $this->runningCommand = null;
- return $exitCode;
- }
- public function setHelperSet(HelperSet $helperSet)
- {
- $this->helperSet = $helperSet;
- }
- public function getHelperSet()
- {
- return $this->helperSet;
- }
- public function setDefinition(InputDefinition $definition)
- {
- $this->definition = $definition;
- }
- public function getDefinition()
- {
- return $this->definition;
- }
- public function getHelp()
- {
- return $this->getLongVersion();
- }
- public function setCatchExceptions($boolean)
- {
- $this->catchExceptions = (bool) $boolean;
- }
- public function setAutoExit($boolean)
- {
- $this->autoExit = (bool) $boolean;
- }
- public function getName()
- {
- return $this->name;
- }
- public function setName($name)
- {
- $this->name = $name;
- }
- public function getVersion()
- {
- return $this->version;
- }
- public function setVersion($version)
- {
- $this->version = $version;
- }
- public function getLongVersion()
- {
- if ('UNKNOWN' !== $this->getName()) {
- if ('UNKNOWN' !== $this->getVersion()) {
- return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
- }
- return sprintf('<info>%s</info>', $this->getName());
- }
- return '<info>Console Tool</info>';
- }
- public function register($name)
- {
- return $this->add(new Command($name));
- }
- public function addCommands(array $commands)
- {
- foreach ($commands as $command) {
- $this->add($command);
- }
- }
- public function add(Command $command)
- {
- $command->setApplication($this);
- if (!$command->isEnabled()) {
- $command->setApplication(null);
- return;
- }
- if (null === $command->getDefinition()) {
- throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($command)));
- }
- $this->commands[$command->getName()] = $command;
- foreach ($command->getAliases() as $alias) {
- $this->commands[$alias] = $command;
- }
- return $command;
- }
- public function get($name)
- {
- if (!isset($this->commands[$name])) {
- throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name));
- }
- $command = $this->commands[$name];
- if ($this->wantHelps) {
- $this->wantHelps = false;
- $helpCommand = $this->get('help');
- $helpCommand->setCommand($command);
- return $helpCommand;
- }
- return $command;
- }
- public function has($name)
- {
- return isset($this->commands[$name]);
- }
- public function getNamespaces()
- {
- $namespaces = array();
- foreach ($this->commands as $command) {
- $namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName()));
- foreach ($command->getAliases() as $alias) {
- $namespaces = array_merge($namespaces, $this->extractAllNamespaces($alias));
- }
- }
- return array_values(array_unique(array_filter($namespaces)));
- }
- public function findNamespace($namespace)
- {
- $allNamespaces = $this->getNamespaces();
- $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $namespace);
- $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces);
- if (empty($namespaces)) {
- $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace);
- if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) {
- if (1 == count($alternatives)) {
- $message .= "\n\nDid you mean this?\n ";
- } else {
- $message .= "\n\nDid you mean one of these?\n ";
- }
- $message .= implode("\n ", $alternatives);
- }
- throw new CommandNotFoundException($message, $alternatives);
- }
- $exact = in_array($namespace, $namespaces, true);
- if (count($namespaces) > 1 && !$exact) {
- throw new CommandNotFoundException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces));
- }
- return $exact ? $namespace : reset($namespaces);
- }
- public function find($name)
- {
- $allCommands = array_keys($this->commands);
- $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $name);
- $commands = preg_grep('{^'.$expr.'}', $allCommands);
- if (empty($commands) || count(preg_grep('{^'.$expr.'$}', $commands)) < 1) {
- if (false !== $pos = strrpos($name, ':')) {
- $this->findNamespace(substr($name, 0, $pos));
- }
- $message = sprintf('Command "%s" is not defined.', $name);
- if ($alternatives = $this->findAlternatives($name, $allCommands)) {
- if (1 == count($alternatives)) {
- $message .= "\n\nDid you mean this?\n ";
- } else {
- $message .= "\n\nDid you mean one of these?\n ";
- }
- $message .= implode("\n ", $alternatives);
- }
- throw new CommandNotFoundException($message, $alternatives);
- }
- if (count($commands) > 1) {
- $commandList = $this->commands;
- $commands = array_filter($commands, function ($nameOrAlias) use ($commandList, $commands) {
- $commandName = $commandList[$nameOrAlias]->getName();
- return $commandName === $nameOrAlias || !in_array($commandName, $commands);
- });
- }
- $exact = in_array($name, $commands, true);
- if (count($commands) > 1 && !$exact) {
- $suggestions = $this->getAbbreviationSuggestions(array_values($commands));
- throw new CommandNotFoundException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions), array_values($commands));
- }
- return $this->get($exact ? $name : reset($commands));
- }
- public function all($namespace = null)
- {
- if (null === $namespace) {
- return $this->commands;
- }
- $commands = array();
- foreach ($this->commands as $name => $command) {
- if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) {
- $commands[$name] = $command;
- }
- }
- return $commands;
- }
- public static function getAbbreviations($names)
- {
- $abbrevs = array();
- foreach ($names as $name) {
- for ($len = strlen($name); $len > 0; --$len) {
- $abbrev = substr($name, 0, $len);
- $abbrevs[$abbrev][] = $name;
- }
- }
- return $abbrevs;
- }
- public function asText($namespace = null, $raw = false)
- {
- @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, !$raw);
- $descriptor->describe($output, $this, array('namespace' => $namespace, 'raw_output' => true));
- return $output->fetch();
- }
- public function asXml($namespace = null, $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->getApplicationDocument($this, $namespace);
- }
- $output = new BufferedOutput();
- $descriptor->describe($output, $this, array('namespace' => $namespace));
- return $output->fetch();
- }
- public function renderException($e, $output)
- {
- $output->writeln('', OutputInterface::VERBOSITY_QUIET);
- do {
- $title = sprintf(' [%s] ', get_class($e));
- $len = $this->stringWidth($title);
- $width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : PHP_INT_MAX;
- if (defined('HHVM_VERSION') && $width > 1 << 31) {
- $width = 1 << 31;
- }
- $formatter = $output->getFormatter();
- $lines = array();
- foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
- foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
- $lineLength = $this->stringWidth(preg_replace('/\[[^m]*m/', '', $formatter->format($line))) + 4;
- $lines[] = array($line, $lineLength);
- $len = max($lineLength, $len);
- }
- }
- $messages = array();
- $messages[] = $emptyLine = $formatter->format(sprintf('<error>%s</error>', str_repeat(' ', $len)));
- $messages[] = $formatter->format(sprintf('<error>%s%s</error>', $title, str_repeat(' ', max(0, $len - $this->stringWidth($title)))));
- foreach ($lines as $line) {
- $messages[] = $formatter->format(sprintf('<error> %s %s</error>', $line[0], str_repeat(' ', $len - $line[1])));
- }
- $messages[] = $emptyLine;
- $messages[] = '';
- $output->writeln($messages, OutputInterface::OUTPUT_RAW | OutputInterface::VERBOSITY_QUIET);
- if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
- $output->writeln('<comment>Exception trace:</comment>', OutputInterface::VERBOSITY_QUIET);
- $trace = $e->getTrace();
- array_unshift($trace, array(
- 'function' => '',
- 'file' => $e->getFile() !== null ? $e->getFile() : 'n/a',
- 'line' => $e->getLine() !== null ? $e->getLine() : 'n/a',
- 'args' => array(),
- ));
- for ($i = 0, $count = count($trace); $i < $count; ++$i) {
- $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : '';
- $type = isset($trace[$i]['type']) ? $trace[$i]['type'] : '';
- $function = $trace[$i]['function'];
- $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a';
- $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a';
- $output->writeln(sprintf(' %s%s%s() at <info>%s:%s</info>', $class, $type, $function, $file, $line), OutputInterface::VERBOSITY_QUIET);
- }
- $output->writeln('', OutputInterface::VERBOSITY_QUIET);
- }
- } while ($e = $e->getPrevious());
- if (null !== $this->runningCommand) {
- $output->writeln(sprintf('<info>%s</info>', sprintf($this->runningCommand->getSynopsis(), $this->getName())), OutputInterface::VERBOSITY_QUIET);
- $output->writeln('', OutputInterface::VERBOSITY_QUIET);
- }
- }
- protected function getTerminalWidth()
- {
- $dimensions = $this->getTerminalDimensions();
- return $dimensions[0];
- }
- protected function getTerminalHeight()
- {
- $dimensions = $this->getTerminalDimensions();
- return $dimensions[1];
- }
- public function getTerminalDimensions()
- {
- if ($this->terminalDimensions) {
- return $this->terminalDimensions;
- }
- if ('\\' === DIRECTORY_SEPARATOR) {
- if (preg_match('/^(\d+)x\d+ \(\d+x(\d+)\)$/', trim(getenv('ANSICON')), $matches)) {
- return array((int) $matches[1], (int) $matches[2]);
- }
- if (preg_match('/^(\d+)x(\d+)$/', $this->getConsoleMode(), $matches)) {
- return array((int) $matches[1], (int) $matches[2]);
- }
- }
- if ($sttyString = $this->getSttyColumns()) {
- if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) {
- return array((int) $matches[2], (int) $matches[1]);
- }
- if (preg_match('/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) {
- return array((int) $matches[2], (int) $matches[1]);
- }
- }
- return array(null, null);
- }
- public function setTerminalDimensions($width, $height)
- {
- $this->terminalDimensions = array($width, $height);
- return $this;
- }
- protected function configureIO(InputInterface $input, OutputInterface $output)
- {
- if (true === $input->hasParameterOption(array('--ansi'))) {
- $output->setDecorated(true);
- } elseif (true === $input->hasParameterOption(array('--no-ansi'))) {
- $output->setDecorated(false);
- }
- if (true === $input->hasParameterOption(array('--no-interaction', '-n'))) {
- $input->setInteractive(false);
- } elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('question')) {
- $inputStream = $this->getHelperSet()->get('question')->getInputStream();
- if (!@posix_isatty($inputStream) && false === getenv('SHELL_INTERACTIVE')) {
- $input->setInteractive(false);
- }
- }
- if (true === $input->hasParameterOption(array('--quiet', '-q'))) {
- $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
- } else {
- if ($input->hasParameterOption('-vvv') || $input->hasParameterOption('--verbose=3') || $input->getParameterOption('--verbose') === 3) {
- $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
- } elseif ($input->hasParameterOption('-vv') || $input->hasParameterOption('--verbose=2') || $input->getParameterOption('--verbose') === 2) {
- $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
- } elseif ($input->hasParameterOption('-v') || $input->hasParameterOption('--verbose=1') || $input->hasParameterOption('--verbose') || $input->getParameterOption('--verbose')) {
- $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
- }
- }
- }
- protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
- {
- foreach ($command->getHelperSet() as $helper) {
- if ($helper instanceof InputAwareInterface) {
- $helper->setInput($input);
- }
- }
- if (null === $this->dispatcher) {
- return $command->run($input, $output);
- }
- try {
- $command->mergeApplicationDefinition();
- $input->bind($command->getDefinition());
- } catch (ExceptionInterface $e) {
- }
- $event = new ConsoleCommandEvent($command, $input, $output);
- $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event);
- if ($event->commandShouldRun()) {
- try {
- $exitCode = $command->run($input, $output);
- } catch (\Exception $e) {
- $event = new ConsoleExceptionEvent($command, $input, $output, $e, $e->getCode());
- $this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event);
- $e = $event->getException();
- $event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode());
- $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);
- throw $e;
- }
- } else {
- $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED;
- }
- $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode);
- $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);
- return $event->getExitCode();
- }
- protected function getCommandName(InputInterface $input)
- {
- return $input->getFirstArgument();
- }
- protected function getDefaultInputDefinition()
- {
- return new InputDefinition(array(
- new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'),
- new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'),
- new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'),
- new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'),
- new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'),
- new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'),
- new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'),
- new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'),
- ));
- }
- protected function getDefaultCommands()
- {
- return array(new HelpCommand(), new ListCommand());
- }
- protected function getDefaultHelperSet()
- {
- return new HelperSet(array(
- new FormatterHelper(),
- new DialogHelper(false),
- new ProgressHelper(false),
- new TableHelper(false),
- new DebugFormatterHelper(),
- new ProcessHelper(),
- new QuestionHelper(),
- ));
- }
- private function getSttyColumns()
- {
- if (!function_exists('proc_open')) {
- return;
- }
- $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
- $process = proc_open('stty -a | grep columns', $descriptorspec, $pipes, null, null, array('suppress_errors' => true));
- if (is_resource($process)) {
- $info = stream_get_contents($pipes[1]);
- fclose($pipes[1]);
- fclose($pipes[2]);
- proc_close($process);
- return $info;
- }
- }
- private function getConsoleMode()
- {
- if (!function_exists('proc_open')) {
- return;
- }
- $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
- $process = proc_open('mode CON', $descriptorspec, $pipes, null, null, array('suppress_errors' => true));
- if (is_resource($process)) {
- $info = stream_get_contents($pipes[1]);
- fclose($pipes[1]);
- fclose($pipes[2]);
- proc_close($process);
- if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
- return $matches[2].'x'.$matches[1];
- }
- }
- }
- private function getAbbreviationSuggestions($abbrevs)
- {
- return sprintf('%s, %s%s', $abbrevs[0], $abbrevs[1], count($abbrevs) > 2 ? sprintf(' and %d more', count($abbrevs) - 2) : '');
- }
- public function extractNamespace($name, $limit = null)
- {
- $parts = explode(':', $name);
- array_pop($parts);
- return implode(':', null === $limit ? $parts : array_slice($parts, 0, $limit));
- }
- private function findAlternatives($name, $collection)
- {
- $threshold = 1e3;
- $alternatives = array();
- $collectionParts = array();
- foreach ($collection as $item) {
- $collectionParts[$item] = explode(':', $item);
- }
- foreach (explode(':', $name) as $i => $subname) {
- foreach ($collectionParts as $collectionName => $parts) {
- $exists = isset($alternatives[$collectionName]);
- if (!isset($parts[$i]) && $exists) {
- $alternatives[$collectionName] += $threshold;
- continue;
- } elseif (!isset($parts[$i])) {
- continue;
- }
- $lev = levenshtein($subname, $parts[$i]);
- if ($lev <= strlen($subname) / 3 || '' !== $subname && false !== strpos($parts[$i], $subname)) {
- $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev;
- } elseif ($exists) {
- $alternatives[$collectionName] += $threshold;
- }
- }
- }
- foreach ($collection as $item) {
- $lev = levenshtein($name, $item);
- if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) {
- $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev;
- }
- }
- $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; });
- asort($alternatives);
- return array_keys($alternatives);
- }
- public function setDefaultCommand($commandName)
- {
- $this->defaultCommand = $commandName;
- }
- private function stringWidth($string)
- {
- if (false === $encoding = mb_detect_encoding($string, null, true)) {
- return strlen($string);
- }
- return mb_strwidth($string, $encoding);
- }
- private function splitStringByWidth($string, $width)
- {
-
-
- if (false === $encoding = mb_detect_encoding($string, null, true)) {
- return str_split($string, $width);
- }
- $utf8String = mb_convert_encoding($string, 'utf8', $encoding);
- $lines = array();
- $line = '';
- foreach (preg_split('//u', $utf8String) as $char) {
- if (mb_strwidth($line.$char, 'utf8') <= $width) {
- $line .= $char;
- continue;
- }
- $lines[] = str_pad($line, $width);
- $line = $char;
- }
- if ('' !== $line) {
- $lines[] = count($lines) ? str_pad($line, $width) : $line;
- }
- mb_convert_variables($encoding, 'utf8', $lines);
- return $lines;
- }
- private function extractAllNamespaces($name)
- {
- $parts = explode(':', $name, -1);
- $namespaces = array();
- foreach ($parts as $part) {
- if (count($namespaces)) {
- $namespaces[] = end($namespaces).':'.$part;
- } else {
- $namespaces[] = $part;
- }
- }
- return $namespaces;
- }
- }
- <?php
- namespace Symfony\Component\Console\Command;
- use Symfony\Component\Console\Descriptor\TextDescriptor;
- use Symfony\Component\Console\Descriptor\XmlDescriptor;
- use Symfony\Component\Console\Exception\ExceptionInterface;
- use Symfony\Component\Console\Input\InputDefinition;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\BufferedOutput;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Application;
- use Symfony\Component\Console\Helper\HelperSet;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- use Symfony\Component\Console\Exception\LogicException;
- class Command
- {
- private $application;
- private $name;
- private $processTitle;
- private $aliases = array();
- private $definition;
- private $help;
- private $description;
- private $ignoreValidationErrors = false;
- private $applicationDefinitionMerged = false;
- private $applicationDefinitionMergedWithArgs = false;
- private $code;
- private $synopsis = array();
- private $usages = array();
- private $helperSet;
- public function __construct($name = null)
- {
- $this->definition = new InputDefinition();
- if (null !== $name) {
- $this->setName($name);
- }
- $this->configure();
- if (!$this->name) {
- throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_class($this)));
- }
- }
- public function ignoreValidationErrors()
- {
- $this->ignoreValidationErrors = true;
- }
- public function setApplication(Application $application = null)
- {
- $this->application = $application;
- if ($application) {
- $this->setHelperSet($application->getHelperSet());
- } else {
- $this->helperSet = null;
- }
- }
- public function setHelperSet(HelperSet $helperSet)
- {
- $this->helperSet = $helperSet;
- }
- public function getHelperSet()
- {
- return $this->helperSet;
- }
- public function getApplication()
- {
- return $this->application;
- }
- public function isEnabled()
- {
- return true;
- }
- protected function configure()
- {
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- throw new LogicException('You must override the execute() method in the concrete command class.');
- }
- protected function interact(InputInterface $input, OutputInterface $output)
- {
- }
- protected function initialize(InputInterface $input, OutputInterface $output)
- {
- }
- public function run(InputInterface $input, OutputInterface $output)
- {
- $this->getSynopsis(true);
- $this->getSynopsis(false);
- $this->mergeApplicationDefinition();
- try {
- $input->bind($this->definition);
- } catch (ExceptionInterface $e) {
- if (!$this->ignoreValidationErrors) {
- throw $e;
- }
- }
- $this->initialize($input, $output);
- if (null !== $this->processTitle) {
- if (function_exists('cli_set_process_title')) {
- cli_set_process_title($this->processTitle);
- } elseif (function_exists('setproctitle')) {
- setproctitle($this->processTitle);
- } elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) {
- $output->writeln('<comment>Install the proctitle PECL to be able to change the process title.</comment>');
- }
- }
- if ($input->isInteractive()) {
- $this->interact($input, $output);
- }
-
-
- if ($input->hasArgument('command') && null === $input->getArgument('command')) {
- $input->setArgument('command', $this->getName());
- }
- $input->validate();
- if ($this->code) {
- $statusCode = call_user_func($this->code, $input, $output);
- } else {
- $statusCode = $this->execute($input, $output);
- }
- return is_numeric($statusCode) ? (int) $statusCode : 0;
- }
- public function setCode($code)
- {
- if (!is_callable($code)) {
- throw new InvalidArgumentException('Invalid callable provided to Command::setCode.');
- }
- if (PHP_VERSION_ID >= 50400 && $code instanceof \Closure) {
- $r = new \ReflectionFunction($code);
- if (null === $r->getClosureThis()) {
- $code = \Closure::bind($code, $this);
- }
- }
- $this->code = $code;
- return $this;
- }
- public function mergeApplicationDefinition($mergeArgs = true)
- {
- if (null === $this->application || (true === $this->applicationDefinitionMerged && ($this->applicationDefinitionMergedWithArgs || !$mergeArgs))) {
- return;
- }
- if ($mergeArgs) {
- $currentArguments = $this->definition->getArguments();
- $this->definition->setArguments($this->application->getDefinition()->getArguments());
- $this->definition->addArguments($currentArguments);
- }
- $this->definition->addOptions($this->application->getDefinition()->getOptions());
- $this->applicationDefinitionMerged = true;
- if ($mergeArgs) {
- $this->applicationDefinitionMergedWithArgs = true;
- }
- }
- public function setDefinition($definition)
- {
- if ($definition instanceof InputDefinition) {
- $this->definition = $definition;
- } else {
- $this->definition->setDefinition($definition);
- }
- $this->applicationDefinitionMerged = false;
- return $this;
- }
- public function getDefinition()
- {
- return $this->definition;
- }
- public function getNativeDefinition()
- {
- return $this->getDefinition();
- }
- public function addArgument($name, $mode = null, $description = '', $default = null)
- {
- $this->definition->addArgument(new InputArgument($name, $mode, $description, $default));
- return $this;
- }
- public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)
- {
- $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default));
- return $this;
- }
- public function setName($name)
- {
- $this->validateName($name);
- $this->name = $name;
- return $this;
- }
- public function setProcessTitle($title)
- {
- $this->processTitle = $title;
- return $this;
- }
- public function getName()
- {
- return $this->name;
- }
- public function setDescription($description)
- {
- $this->description = $description;
- return $this;
- }
- public function getDescription()
- {
- return $this->description;
- }
- public function setHelp($help)
- {
- $this->help = $help;
- return $this;
- }
- public function getHelp()
- {
- return $this->help;
- }
- public function getProcessedHelp()
- {
- $name = $this->name;
- $placeholders = array(
- '%command.name%',
- '%command.full_name%',
- );
- $replacements = array(
- $name,
- $_SERVER['PHP_SELF'].' '.$name,
- );
- return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription());
- }
- public function setAliases($aliases)
- {
- if (!is_array($aliases) && !$aliases instanceof \Traversable) {
- throw new InvalidArgumentException('$aliases must be an array or an instance of \Traversable');
- }
- foreach ($aliases as $alias) {
- $this->validateName($alias);
- }
- $this->aliases = $aliases;
- return $this;
- }
- public function getAliases()
- {
- return $this->aliases;
- }
- public function getSynopsis($short = false)
- {
- $key = $short ? 'short' : 'long';
- if (!isset($this->synopsis[$key])) {
- $this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short)));
- }
- return $this->synopsis[$key];
- }
- public function addUsage($usage)
- {
- if (0 !== strpos($usage, $this->name)) {
- $usage = sprintf('%s %s', $this->name, $usage);
- }
- $this->usages[] = $usage;
- return $this;
- }
- public function getUsages()
- {
- return $this->usages;
- }
- public function getHelper($name)
- {
- return $this->helperSet->get($name);
- }
- 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();
- }
- 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->getCommandDocument($this);
- }
- $output = new BufferedOutput();
- $descriptor->describe($output, $this);
- return $output->fetch();
- }
- private function validateName($name)
- {
- if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) {
- throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name));
- }
- }
- }
- <?php
- namespace Symfony\Component\Console\Command;
- use Symfony\Component\Console\Helper\DescriptorHelper;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class HelpCommand extends Command
- {
- private $command;
- protected function configure()
- {
- $this->ignoreValidationErrors();
- $this
- ->setName('help')
- ->setDefinition(array(
- new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
- new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'),
- new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
- new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'),
- ))
- ->setDescription('Displays help for a command')
- ->setHelp(<<<'EOF'
- The <info>%command.name%</info> command displays help for a given command:
- <info>php %command.full_name% list</info>
- You can also output the help in other formats by using the <comment>--format</comment> option:
- <info>php %command.full_name% --format=xml list</info>
- To display the list of available commands, please use the <info>list</info> command.
- EOF
- )
- ;
- }
- public function setCommand(Command $command)
- {
- $this->command = $command;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- if (null === $this->command) {
- $this->command = $this->getApplication()->find($input->getArgument('command_name'));
- }
- if ($input->getOption('xml')) {
- @trigger_error('The --xml option was deprecated in version 2.7 and will be removed in version 3.0. Use the --format option instead.', E_USER_DEPRECATED);
- $input->setOption('format', 'xml');
- }
- $helper = new DescriptorHelper();
- $helper->describe($output, $this->command, array(
- 'format' => $input->getOption('format'),
- 'raw_text' => $input->getOption('raw'),
- ));
- $this->command = null;
- }
- }
- <?php
- namespace Symfony\Component\Console\Command;
- use Symfony\Component\Console\Helper\DescriptorHelper;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Input\InputDefinition;
- class ListCommand extends Command
- {
- protected function configure()
- {
- $this
- ->setName('list')
- ->setDefinition($this->createDefinition())
- ->setDescription('Lists commands')
- ->setHelp(<<<'EOF'
- The <info>%command.name%</info> command lists all commands:
- <info>php %command.full_name%</info>
- You can also display the commands for a specific namespace:
- <info>php %command.full_name% test</info>
- You can also output the information in other formats by using the <comment>--format</comment> option:
- <info>php %command.full_name% --format=xml</info>
- It's also possible to get raw list of commands (useful for embedding command runner):
- <info>php %command.full_name% --raw</info>
- EOF
- )
- ;
- }
- public function getNativeDefinition()
- {
- return $this->createDefinition();
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- if ($input->getOption('xml')) {
- @trigger_error('The --xml option was deprecated in version 2.7 and will be removed in version 3.0. Use the --format option instead.', E_USER_DEPRECATED);
- $input->setOption('format', 'xml');
- }
- $helper = new DescriptorHelper();
- $helper->describe($output, $this->getApplication(), array(
- 'format' => $input->getOption('format'),
- 'raw_text' => $input->getOption('raw'),
- 'namespace' => $input->getArgument('namespace'),
- ));
- }
- private function createDefinition()
- {
- return new InputDefinition(array(
- new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'),
- new InputOption('xml', null, InputOption::VALUE_NONE, 'To output list as XML'),
- new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'),
- new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
- ));
- }
- }
- <?php
- namespace Symfony\Component\Console;
- final class ConsoleEvents
- {
- const COMMAND = 'console.command';
- const TERMINATE = 'console.terminate';
- const EXCEPTION = 'console.exception';
- }
- <?php
- namespace Symfony\Component\Console\Descriptor;
- use Symfony\Component\Console\Application;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Exception\CommandNotFoundException;
- class ApplicationDescription
- {
- const GLOBAL_NAMESPACE = '_global';
- private $application;
- private $namespace;
- private $namespaces;
- private $commands;
- private $aliases;
- public function __construct(Application $application, $namespace = null)
- {
- $this->application = $application;
- $this->namespace = $namespace;
- }
- public function getNamespaces()
- {
- if (null === $this->namespaces) {
- $this->inspectApplication();
- }
- return $this->namespaces;
- }
- public function getCommands()
- {
- if (null === $this->commands) {
- $this->inspectApplication();
- }
- return $this->commands;
- }
- public function getCommand($name)
- {
- if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) {
- throw new CommandNotFoundException(sprintf('Command %s does not exist.', $name));
- }
- return isset($this->commands[$name]) ? $this->commands[$name] : $this->aliases[$name];
- }
- private function inspectApplication()
- {
- $this->commands = array();
- $this->namespaces = array();
- $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null);
- foreach ($this->sortCommands($all) as $namespace => $commands) {
- $names = array();
- foreach ($commands as $name => $command) {
- if (!$command->getName()) {
- continue;
- }
- if ($command->getName() === $name) {
- $this->commands[$name] = $command;
- } else {
- $this->aliases[$name] = $command;
- }
- $names[] = $name;
- }
- $this->namespaces[$namespace] = array('id' => $namespace, 'commands' => $names);
- }
- }
- private function sortCommands(array $commands)
- {
- $namespacedCommands = array();
- $globalCommands = array();
- foreach ($commands as $name => $command) {
- $key = $this->application->extractNamespace($name, 1);
- if (!$key) {
- $globalCommands['_global'][$name] = $command;
- } else {
- $namespacedCommands[$key][$name] = $command;
- }
- }
- ksort($namespacedCommands);
- $namespacedCommands = array_merge($globalCommands, $namespacedCommands);
- foreach ($namespacedCommands as &$commandsSet) {
- ksort($commandsSet);
- }
- unset($commandsSet);
- return $namespacedCommands;
- }
- }
- <?php
- namespace Symfony\Component\Console\Descriptor;
- use Symfony\Component\Console\Application;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputDefinition;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- abstract class Descriptor implements DescriptorInterface
- {
- private $output;
- public function describe(OutputInterface $output, $object, array $options = array())
- {
- $this->output = $output;
- switch (true) {
- case $object instanceof InputArgument:
- $this->describeInputArgument($object, $options);
- break;
- case $object instanceof InputOption:
- $this->describeInputOption($object, $options);
- break;
- case $object instanceof InputDefinition:
- $this->describeInputDefinition($object, $options);
- break;
- case $object instanceof Command:
- $this->describeCommand($object, $options);
- break;
- case $object instanceof Application:
- $this->describeApplication($object, $options);
- break;
- default:
- throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_class($object)));
- }
- }
- protected function write($content, $decorated = false)
- {
- $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW);
- }
- abstract protected function describeInputArgument(InputArgument $argument, array $options = array());
- abstract protected function describeInputOption(InputOption $option, array $options = array());
- abstract protected function describeInputDefinition(InputDefinition $definition, array $options = array());
- abstract protected function describeCommand(Command $command, array $options = array());
- abstract protected function describeApplication(Application $application, array $options = array());
- }
- <?php
- namespace Symfony\Component\Console\Descriptor;
- use Symfony\Component\Console\Output\OutputInterface;
- interface DescriptorInterface
- {
- public function describe(OutputInterface $output, $object, array $options = array());
- }
- <?php
- namespace Symfony\Component\Console\Descriptor;
- use Symfony\Component\Console\Application;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputDefinition;
- use Symfony\Component\Console\Input\InputOption;
- class JsonDescriptor extends Descriptor
- {
- protected function describeInputArgument(InputArgument $argument, array $options = array())
- {
- $this->writeData($this->getInputArgumentData($argument), $options);
- }
- protected function describeInputOption(InputOption $option, array $options = array())
- {
- $this->writeData($this->getInputOptionData($option), $options);
- }
- protected function describeInputDefinition(InputDefinition $definition, array $options = array())
- {
- $this->writeData($this->getInputDefinitionData($definition), $options);
- }
- protected function describeCommand(Command $command, array $options = array())
- {
- $this->writeData($this->getCommandData($command), $options);
- }
- protected function describeApplication(Application $application, array $options = array())
- {
- $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
- $description = new ApplicationDescription($application, $describedNamespace);
- $commands = array();
- foreach ($description->getCommands() as $command) {
- $commands[] = $this->getCommandData($command);
- }
- $data = $describedNamespace
- ? array('commands' => $commands, 'namespace' => $describedNamespace)
- : array('commands' => $commands, 'namespaces' => array_values($description->getNamespaces()));
- $this->writeData($data, $options);
- }
- private function writeData(array $data, array $options)
- {
- $this->write(json_encode($data, isset($options['json_encoding']) ? $options['json_encoding'] : 0));
- }
- private function getInputArgumentData(InputArgument $argument)
- {
- return array(
- 'name' => $argument->getName(),
- 'is_required' => $argument->isRequired(),
- 'is_array' => $argument->isArray(),
- 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()),
- 'default' => $argument->getDefault(),
- );
- }
- private function getInputOptionData(InputOption $option)
- {
- return array(
- 'name' => '--'.$option->getName(),
- 'shortcut' => $option->getShortcut() ? '-'.implode('|-', explode('|', $option->getShortcut())) : '',
- 'accept_value' => $option->acceptValue(),
- 'is_value_required' => $option->isValueRequired(),
- 'is_multiple' => $option->isArray(),
- 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()),
- 'default' => $option->getDefault(),
- );
- }
- private function getInputDefinitionData(InputDefinition $definition)
- {
- $inputArguments = array();
- foreach ($definition->getArguments() as $name => $argument) {
- $inputArguments[$name] = $this->getInputArgumentData($argument);
- }
- $inputOptions = array();
- foreach ($definition->getOptions() as $name => $option) {
- $inputOptions[$name] = $this->getInputOptionData($option);
- }
- return array('arguments' => $inputArguments, 'options' => $inputOptions);
- }
- private function getCommandData(Command $command)
- {
- $command->getSynopsis();
- $command->mergeApplicationDefinition(false);
- return array(
- 'name' => $command->getName(),
- 'usage' => array_merge(array($command->getSynopsis()), $command->getUsages(), $command->getAliases()),
- 'description' => $command->getDescription(),
- 'help' => $command->getProcessedHelp(),
- 'definition' => $this->getInputDefinitionData($command->getNativeDefinition()),
- );
- }
- }
- <?php
- namespace Symfony\Component\Console\Descriptor;
- use Symfony\Component\Console\Application;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputDefinition;
- use Symfony\Component\Console\Input\InputOption;
- class MarkdownDescriptor extends Descriptor
- {
- protected function describeInputArgument(InputArgument $argument, array $options = array())
- {
- $this->write(
- '**'.$argument->getName().':**'."\n\n"
- .'* Name: '.($argument->getName() ?: '<none>')."\n"
- .'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n"
- .'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n"
- .'* Description: '.preg_replace('/\s*[\r\n]\s*/', "\n ", $argument->getDescription() ?: '<none>')."\n"
- .'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`'
- );
- }
- protected function describeInputOption(InputOption $option, array $options = array())
- {
- $this->write(
- '**'.$option->getName().':**'."\n\n"
- .'* Name: `--'.$option->getName().'`'."\n"
- .'* Shortcut: '.($option->getShortcut() ? '`-'.implode('|-', explode('|', $option->getShortcut())).'`' : '<none>')."\n"
- .'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n"
- .'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n"
- .'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n"
- .'* Description: '.preg_replace('/\s*[\r\n]\s*/', "\n ", $option->getDescription() ?: '<none>')."\n"
- .'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`'
- );
- }
- protected function describeInputDefinition(InputDefinition $definition, array $options = array())
- {
- if ($showArguments = count($definition->getArguments()) > 0) {
- $this->write('### Arguments:');
- foreach ($definition->getArguments() as $argument) {
- $this->write("\n\n");
- $this->write($this->describeInputArgument($argument));
- }
- }
- if (count($definition->getOptions()) > 0) {
- if ($showArguments) {
- $this->write("\n\n");
- }
- $this->write('### Options:');
- foreach ($definition->getOptions() as $option) {
- $this->write("\n\n");
- $this->write($this->describeInputOption($option));
- }
- }
- }
- protected function describeCommand(Command $command, array $options = array())
- {
- $command->getSynopsis();
- $command->mergeApplicationDefinition(false);
- $this->write(
- $command->getName()."\n"
- .str_repeat('-', strlen($command->getName()))."\n\n"
- .'* Description: '.($command->getDescription() ?: '<none>')."\n"
- .'* Usage:'."\n\n"
- .array_reduce(array_merge(array($command->getSynopsis()), $command->getAliases(), $command->getUsages()), function ($carry, $usage) {
- return $carry .= ' * `'.$usage.'`'."\n";
- })
- );
- if ($help = $command->getProcessedHelp()) {
- $this->write("\n");
- $this->write($help);
- }
- if ($command->getNativeDefinition()) {
- $this->write("\n\n");
- $this->describeInputDefinition($command->getNativeDefinition());
- }
- }
- protected function describeApplication(Application $application, array $options = array())
- {
- $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
- $description = new ApplicationDescription($application, $describedNamespace);
- $this->write($application->getName()."\n".str_repeat('=', strlen($application->getName())));
- foreach ($description->getNamespaces() as $namespace) {
- if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) {
- $this->write("\n\n");
- $this->write('**'.$namespace['id'].':**');
- }
- $this->write("\n\n");
- $this->write(implode("\n", array_map(function ($commandName) {
- return '* '.$commandName;
- }, $namespace['commands'])));
- }
- foreach ($description->getCommands() as $command) {
- $this->write("\n\n");
- $this->write($this->describeCommand($command));
- }
- }
- }
- <?php
- namespace Symfony\Component\Console\Descriptor;
- use Symfony\Component\Console\Application;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputDefinition;
- use Symfony\Component\Console\Input\InputOption;
- class TextDescriptor extends Descriptor
- {
- protected function describeInputArgument(InputArgument $argument, array $options = array())
- {
- if (null !== $argument->getDefault() && (!is_array($argument->getDefault()) || count($argument->getDefault()))) {
- $default = sprintf('<comment> [default: %s]</comment>', $this->formatDefaultValue($argument->getDefault()));
- } else {
- $default = '';
- }
- $totalWidth = isset($options['total_width']) ? $options['total_width'] : strlen($argument->getName());
- $spacingWidth = $totalWidth - strlen($argument->getName()) + 2;
- $this->writeText(sprintf(' <info>%s</info>%s%s%s',
- $argument->getName(),
- str_repeat(' ', $spacingWidth),
- preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 17), $argument->getDescription()),
- $default
- ), $options);
- }
- protected function describeInputOption(InputOption $option, array $options = array())
- {
- if ($option->acceptValue() && null !== $option->getDefault() && (!is_array($option->getDefault()) || count($option->getDefault()))) {
- $default = sprintf('<comment> [default: %s]</comment>', $this->formatDefaultValue($option->getDefault()));
- } else {
- $default = '';
- }
- $value = '';
- if ($option->acceptValue()) {
- $value = '='.strtoupper($option->getName());
- if ($option->isValueOptional()) {
- $value = '['.$value.']';
- }
- }
- $totalWidth = isset($options['total_width']) ? $options['total_width'] : $this->calculateTotalWidthForOptions(array($option));
- $synopsis = sprintf('%s%s',
- $option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ',
- sprintf('--%s%s', $option->getName(), $value)
- );
- $spacingWidth = $totalWidth - strlen($synopsis) + 2;
- $this->writeText(sprintf(' <info>%s</info>%s%s%s%s',
- $synopsis,
- str_repeat(' ', $spacingWidth),
- preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 17), $option->getDescription()),
- $default,
- $option->isArray() ? '<comment> (multiple values allowed)</comment>' : ''
- ), $options);
- }
- protected function describeInputDefinition(InputDefinition $definition, array $options = array())
- {
- $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions());
- foreach ($definition->getArguments() as $argument) {
- $totalWidth = max($totalWidth, strlen($argument->getName()));
- }
- if ($definition->getArguments()) {
- $this->writeText('<comment>Arguments:</comment>', $options);
- $this->writeText("\n");
- foreach ($definition->getArguments() as $argument) {
- $this->describeInputArgument($argument, array_merge($options, array('total_width' => $totalWidth)));
- $this->writeText("\n");
- }
- }
- if ($definition->getArguments() && $definition->getOptions()) {
- $this->writeText("\n");
- }
- if ($definition->getOptions()) {
- $laterOptions = array();
- $this->writeText('<comment>Options:</comment>', $options);
- foreach ($definition->getOptions() as $option) {
- if (strlen($option->getShortcut()) > 1) {
- $laterOptions[] = $option;
- continue;
- }
- $this->writeText("\n");
- $this->describeInputOption($option, array_merge($options, array('total_width' => $totalWidth)));
- }
- foreach ($laterOptions as $option) {
- $this->writeText("\n");
- $this->describeInputOption($option, array_merge($options, array('total_width' => $totalWidth)));
- }
- }
- }
- protected function describeCommand(Command $command, array $options = array())
- {
- $command->getSynopsis(true);
- $command->getSynopsis(false);
- $command->mergeApplicationDefinition(false);
- $this->writeText('<comment>Usage:</comment>', $options);
- foreach (array_merge(array($command->getSynopsis(true)), $command->getAliases(), $command->getUsages()) as $usage) {
- $this->writeText("\n");
- $this->writeText(' '.$usage, $options);
- }
- $this->writeText("\n");
- $definition = $command->getNativeDefinition();
- if ($definition->getOptions() || $definition->getArguments()) {
- $this->writeText("\n");
- $this->describeInputDefinition($definition, $options);
- $this->writeText("\n");
- }
- if ($help = $command->getProcessedHelp()) {
- $this->writeText("\n");
- $this->writeText('<comment>Help:</comment>', $options);
- $this->writeText("\n");
- $this->writeText(' '.str_replace("\n", "\n ", $help), $options);
- $this->writeText("\n");
- }
- }
- protected function describeApplication(Application $application, array $options = array())
- {
- $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
- $description = new ApplicationDescription($application, $describedNamespace);
- if (isset($options['raw_text']) && $options['raw_text']) {
- $width = $this->getColumnWidth($description->getCommands());
- foreach ($description->getCommands() as $command) {
- $this->writeText(sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options);
- $this->writeText("\n");
- }
- } else {
- if ('' != $help = $application->getHelp()) {
- $this->writeText("$help\n\n", $options);
- }
- $this->writeText("<comment>Usage:</comment>\n", $options);
- $this->writeText(" command [options] [arguments]\n\n", $options);
- $this->describeInputDefinition(new InputDefinition($application->getDefinition()->getOptions()), $options);
- $this->writeText("\n");
- $this->writeText("\n");
- $width = $this->getColumnWidth($description->getCommands());
- if ($describedNamespace) {
- $this->writeText(sprintf('<comment>Available commands for the "%s" namespace:</comment>', $describedNamespace), $options);
- } else {
- $this->writeText('<comment>Available commands:</comment>', $options);
- }
- foreach ($description->getNamespaces() as $namespace) {
- if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) {
- $this->writeText("\n");
- $this->writeText(' <comment>'.$namespace['id'].'</comment>', $options);
- }
- foreach ($namespace['commands'] as $name) {
- $this->writeText("\n");
- $spacingWidth = $width - strlen($name);
- $this->writeText(sprintf(' <info>%s</info>%s%s', $name, str_repeat(' ', $spacingWidth), $description->getCommand($name)->getDescription()), $options);
- }
- }
- $this->writeText("\n");
- }
- }
- private function writeText($content, array $options = array())
- {
- $this->write(
- isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content,
- isset($options['raw_output']) ? !$options['raw_output'] : true
- );
- }
- private function formatDefaultValue($default)
- {
- if (PHP_VERSION_ID < 50400) {
- return str_replace(array('\/', '\\\\'), array('/', '\\'), json_encode($default));
- }
- return str_replace('\\\\', '\\', json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
- }
- private function getColumnWidth(array $commands)
- {
- $widths = array();
- foreach ($commands as $command) {
- $widths[] = strlen($command->getName());
- foreach ($command->getAliases() as $alias) {
- $widths[] = strlen($alias);
- }
- }
- return max($widths) + 2;
- }
- private function calculateTotalWidthForOptions($options)
- {
- $totalWidth = 0;
- foreach ($options as $option) {
- $nameLength = 1 + max(strlen($option->getShortcut()), 1) + 4 + strlen($option->getName());
- if ($option->acceptValue()) {
- $valueLength = 1 + strlen($option->getName());
- $valueLength += $option->isValueOptional() ? 2 : 0;
- $nameLength += $valueLength;
- }
- $totalWidth = max($totalWidth, $nameLength);
- }
- return $totalWidth;
- }
- }
- <?php
- namespace Symfony\Component\Console\Descriptor;
- use Symfony\Component\Console\Application;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputDefinition;
- use Symfony\Component\Console\Input\InputOption;
- class XmlDescriptor extends Descriptor
- {
- public function getInputDefinitionDocument(InputDefinition $definition)
- {
- $dom = new \DOMDocument('1.0', 'UTF-8');
- $dom->appendChild($definitionXML = $dom->createElement('definition'));
- $definitionXML->appendChild($argumentsXML = $dom->createElement('arguments'));
- foreach ($definition->getArguments() as $argument) {
- $this->appendDocument($argumentsXML, $this->getInputArgumentDocument($argument));
- }
- $definitionXML->appendChild($optionsXML = $dom->createElement('options'));
- foreach ($definition->getOptions() as $option) {
- $this->appendDocument($optionsXML, $this->getInputOptionDocument($option));
- }
- return $dom;
- }
- public function getCommandDocument(Command $command)
- {
- $dom = new \DOMDocument('1.0', 'UTF-8');
- $dom->appendChild($commandXML = $dom->createElement('command'));
- $command->getSynopsis();
- $command->mergeApplicationDefinition(false);
- $commandXML->setAttribute('id', $command->getName());
- $commandXML->setAttribute('name', $command->getName());
- $commandXML->appendChild($usagesXML = $dom->createElement('usages'));
- foreach (array_merge(array($command->getSynopsis()), $command->getAliases(), $command->getUsages()) as $usage) {
- $usagesXML->appendChild($dom->createElement('usage', $usage));
- }
- $commandXML->appendChild($descriptionXML = $dom->createElement('description'));
- $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getDescription())));
- $commandXML->appendChild($helpXML = $dom->createElement('help'));
- $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getProcessedHelp())));
- $definitionXML = $this->getInputDefinitionDocument($command->getNativeDefinition());
- $this->appendDocument($commandXML, $definitionXML->getElementsByTagName('definition')->item(0));
- return $dom;
- }
- public function getApplicationDocument(Application $application, $namespace = null)
- {
- $dom = new \DOMDocument('1.0', 'UTF-8');
- $dom->appendChild($rootXml = $dom->createElement('symfony'));
- if ($application->getName() !== 'UNKNOWN') {
- $rootXml->setAttribute('name', $application->getName());
- if ($application->getVersion() !== 'UNKNOWN') {
- $rootXml->setAttribute('version', $application->getVersion());
- }
- }
- $rootXml->appendChild($commandsXML = $dom->createElement('commands'));
- $description = new ApplicationDescription($application, $namespace);
- if ($namespace) {
- $commandsXML->setAttribute('namespace', $namespace);
- }
- foreach ($description->getCommands() as $command) {
- $this->appendDocument($commandsXML, $this->getCommandDocument($command));
- }
- if (!$namespace) {
- $rootXml->appendChild($namespacesXML = $dom->createElement('namespaces'));
- foreach ($description->getNamespaces() as $namespaceDescription) {
- $namespacesXML->appendChild($namespaceArrayXML = $dom->createElement('namespace'));
- $namespaceArrayXML->setAttribute('id', $namespaceDescription['id']);
- foreach ($namespaceDescription['commands'] as $name) {
- $namespaceArrayXML->appendChild($commandXML = $dom->createElement('command'));
- $commandXML->appendChild($dom->createTextNode($name));
- }
- }
- }
- return $dom;
- }
- protected function describeInputArgument(InputArgument $argument, array $options = array())
- {
- $this->writeDocument($this->getInputArgumentDocument($argument));
- }
- protected function describeInputOption(InputOption $option, array $options = array())
- {
- $this->writeDocument($this->getInputOptionDocument($option));
- }
- protected function describeInputDefinition(InputDefinition $definition, array $options = array())
- {
- $this->writeDocument($this->getInputDefinitionDocument($definition));
- }
- protected function describeCommand(Command $command, array $options = array())
- {
- $this->writeDocument($this->getCommandDocument($command));
- }
- protected function describeApplication(Application $application, array $options = array())
- {
- $this->writeDocument($this->getApplicationDocument($application, isset($options['namespace']) ? $options['namespace'] : null));
- }
- private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent)
- {
- foreach ($importedParent->childNodes as $childNode) {
- $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true));
- }
- }
- private function writeDocument(\DOMDocument $dom)
- {
- $dom->formatOutput = true;
- $this->write($dom->saveXML());
- }
- private function getInputArgumentDocument(InputArgument $argument)
- {
- $dom = new \DOMDocument('1.0', 'UTF-8');
- $dom->appendChild($objectXML = $dom->createElement('argument'));
- $objectXML->setAttribute('name', $argument->getName());
- $objectXML->setAttribute('is_required', $argument->isRequired() ? 1 : 0);
- $objectXML->setAttribute('is_array', $argument->isArray() ? 1 : 0);
- $objectXML->appendChild($descriptionXML = $dom->createElement('description'));
- $descriptionXML->appendChild($dom->createTextNode($argument->getDescription()));
- $objectXML->appendChild($defaultsXML = $dom->createElement('defaults'));
- $defaults = is_array($argument->getDefault()) ? $argument->getDefault() : (is_bool($argument->getDefault()) ? array(var_export($argument->getDefault(), true)) : ($argument->getDefault() ? array($argument->getDefault()) : array()));
- foreach ($defaults as $default) {
- $defaultsXML->appendChild($defaultXML = $dom->createElement('default'));
- $defaultXML->appendChild($dom->createTextNode($default));
- }
- return $dom;
- }
- private function getInputOptionDocument(InputOption $option)
- {
- $dom = new \DOMDocument('1.0', 'UTF-8');
- $dom->appendChild($objectXML = $dom->createElement('option'));
- $objectXML->setAttribute('name', '--'.$option->getName());
- $pos = strpos($option->getShortcut(), '|');
- if (false !== $pos) {
- $objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos));
- $objectXML->setAttribute('shortcuts', '-'.implode('|-', explode('|', $option->getShortcut())));
- } else {
- $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : '');
- }
- $objectXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0);
- $objectXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0);
- $objectXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0);
- $objectXML->appendChild($descriptionXML = $dom->createElement('description'));
- $descriptionXML->appendChild($dom->createTextNode($option->getDescription()));
- if ($option->acceptValue()) {
- $defaults = is_array($option->getDefault()) ? $option->getDefault() : (is_bool($option->getDefault()) ? array(var_export($option->getDefault(), true)) : ($option->getDefault() ? array($option->getDefault()) : array()));
- $objectXML->appendChild($defaultsXML = $dom->createElement('defaults'));
- if (!empty($defaults)) {
- foreach ($defaults as $default) {
- $defaultsXML->appendChild($defaultXML = $dom->createElement('default'));
- $defaultXML->appendChild($dom->createTextNode($default));
- }
- }
- }
- return $dom;
- }
- }
- <?php
- namespace Symfony\Component\Console\Event;
- class ConsoleCommandEvent extends ConsoleEvent
- {
- const RETURN_CODE_DISABLED = 113;
- private $commandShouldRun = true;
- public function disableCommand()
- {
- return $this->commandShouldRun = false;
- }
- public function enableCommand()
- {
- return $this->commandShouldRun = true;
- }
- public function commandShouldRun()
- {
- return $this->commandShouldRun;
- }
- }
- <?php
- namespace Symfony\Component\Console\Event;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\EventDispatcher\Event;
- class ConsoleEvent extends Event
- {
- protected $command;
- private $input;
- private $output;
- public function __construct(Command $command, InputInterface $input, OutputInterface $output)
- {
- $this->command = $command;
- $this->input = $input;
- $this->output = $output;
- }
- public function getCommand()
- {
- return $this->command;
- }
- public function getInput()
- {
- return $this->input;
- }
- public function getOutput()
- {
- return $this->output;
- }
- }
- <?php
- namespace Symfony\Component\Console\Event;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class ConsoleExceptionEvent extends ConsoleEvent
- {
- private $exception;
- private $exitCode;
- public function __construct(Command $command, InputInterface $input, OutputInterface $output, \Exception $exception, $exitCode)
- {
- parent::__construct($command, $input, $output);
- $this->setException($exception);
- $this->exitCode = (int) $exitCode;
- }
- public function getException()
- {
- return $this->exception;
- }
- public function setException(\Exception $exception)
- {
- $this->exception = $exception;
- }
- public function getExitCode()
- {
- return $this->exitCode;
- }
- }
- <?php
- namespace Symfony\Component\Console\Event;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class ConsoleTerminateEvent extends ConsoleEvent
- {
- private $exitCode;
- public function __construct(Command $command, InputInterface $input, OutputInterface $output, $exitCode)
- {
- parent::__construct($command, $input, $output);
- $this->setExitCode($exitCode);
- }
- public function setExitCode($exitCode)
- {
- $this->exitCode = (int) $exitCode;
- }
- public function getExitCode()
- {
- return $this->exitCode;
- }
- }
- <?php
- namespace Symfony\Component\Console\Exception;
- class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface
- {
- private $alternatives;
- public function __construct($message, array $alternatives = array(), $code = 0, \Exception $previous = null)
- {
- parent::__construct($message, $code, $previous);
- $this->alternatives = $alternatives;
- }
- public function getAlternatives()
- {
- return $this->alternatives;
- }
- }
- <?php
- namespace Symfony\Component\Console\Exception;
- interface ExceptionInterface
- {
- }
- <?php
- namespace Symfony\Component\Console\Exception;
- class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
- {
- }
- <?php
- namespace Symfony\Component\Console\Exception;
- class InvalidOptionException extends \InvalidArgumentException implements ExceptionInterface
- {
- }
- <?php
- namespace Symfony\Component\Console\Exception;
- class LogicException extends \LogicException implements ExceptionInterface
- {
- }
- <?php
- namespace Symfony\Component\Console\Exception;
- class RuntimeException extends \RuntimeException implements ExceptionInterface
- {
- }
- <?php
- namespace Symfony\Component\Console\Formatter;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- class OutputFormatter implements OutputFormatterInterface
- {
- private $decorated;
- private $styles = array();
- private $styleStack;
- public static function escape($text)
- {
- return preg_replace('/([^\\\\]?)</', '$1\\<', $text);
- }
- public function __construct($decorated = false, array $styles = array())
- {
- $this->decorated = (bool) $decorated;
- $this->setStyle('error', new OutputFormatterStyle('white', 'red'));
- $this->setStyle('info', new OutputFormatterStyle('green'));
- $this->setStyle('comment', new OutputFormatterStyle('yellow'));
- $this->setStyle('question', new OutputFormatterStyle('black', 'cyan'));
- foreach ($styles as $name => $style) {
- $this->setStyle($name, $style);
- }
- $this->styleStack = new OutputFormatterStyleStack();
- }
- public function setDecorated($decorated)
- {
- $this->decorated = (bool) $decorated;
- }
- public function isDecorated()
- {
- return $this->decorated;
- }
- public function setStyle($name, OutputFormatterStyleInterface $style)
- {
- $this->styles[strtolower($name)] = $style;
- }
- public function hasStyle($name)
- {
- return isset($this->styles[strtolower($name)]);
- }
- public function getStyle($name)
- {
- if (!$this->hasStyle($name)) {
- throw new InvalidArgumentException(sprintf('Undefined style: %s', $name));
- }
- return $this->styles[strtolower($name)];
- }
- public function format($message)
- {
- $message = (string) $message;
- $offset = 0;
- $output = '';
- $tagRegex = '[a-z][a-z0-9_=;-]*';
- preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, PREG_OFFSET_CAPTURE);
- foreach ($matches[0] as $i => $match) {
- $pos = $match[1];
- $text = $match[0];
- if (0 != $pos && '\\' == $message[$pos - 1]) {
- continue;
- }
- $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset));
- $offset = $pos + strlen($text);
- if ($open = '/' != $text[1]) {
- $tag = $matches[1][$i][0];
- } else {
- $tag = isset($matches[3][$i][0]) ? $matches[3][$i][0] : '';
- }
- if (!$open && !$tag) {
- $this->styleStack->pop();
- } elseif (false === $style = $this->createStyleFromString(strtolower($tag))) {
- $output .= $this->applyCurrentStyle($text);
- } elseif ($open) {
- $this->styleStack->push($style);
- } else {
- $this->styleStack->pop($style);
- }
- }
- $output .= $this->applyCurrentStyle(substr($message, $offset));
- return str_replace('\\<', '<', $output);
- }
- public function getStyleStack()
- {
- return $this->styleStack;
- }
- private function createStyleFromString($string)
- {
- if (isset($this->styles[$string])) {
- return $this->styles[$string];
- }
- if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) {
- return false;
- }
- $style = new OutputFormatterStyle();
- foreach ($matches as $match) {
- array_shift($match);
- if ('fg' == $match[0]) {
- $style->setForeground($match[1]);
- } elseif ('bg' == $match[0]) {
- $style->setBackground($match[1]);
- } else {
- try {
- $style->setOption($match[1]);
- } catch (\InvalidArgumentException $e) {
- return false;
- }
- }
- }
- return $style;
- }
- private function applyCurrentStyle($text)
- {
- return $this->isDecorated() && strlen($text) > 0 ? $this->styleStack->getCurrent()->apply($text) : $text;
- }
- }
- <?php
- namespace Symfony\Component\Console\Formatter;
- interface OutputFormatterInterface
- {
- public function setDecorated($decorated);
- public function isDecorated();
- public function setStyle($name, OutputFormatterStyleInterface $style);
- public function hasStyle($name);
- public function getStyle($name);
- public function format($message);
- }
- <?php
- namespace Symfony\Component\Console\Formatter;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- class OutputFormatterStyle implements OutputFormatterStyleInterface
- {
- private static $availableForegroundColors = array(
- 'black' => array('set' => 30, 'unset' => 39),
- 'red' => array('set' => 31, 'unset' => 39),
- 'green' => array('set' => 32, 'unset' => 39),
- 'yellow' => array('set' => 33, 'unset' => 39),
- 'blue' => array('set' => 34, 'unset' => 39),
- 'magenta' => array('set' => 35, 'unset' => 39),
- 'cyan' => array('set' => 36, 'unset' => 39),
- 'white' => array('set' => 37, 'unset' => 39),
- 'default' => array('set' => 39, 'unset' => 39),
- );
- private static $availableBackgroundColors = array(
- 'black' => array('set' => 40, 'unset' => 49),
- 'red' => array('set' => 41, 'unset' => 49),
- 'green' => array('set' => 42, 'unset' => 49),
- 'yellow' => array('set' => 43, 'unset' => 49),
- 'blue' => array('set' => 44, 'unset' => 49),
- 'magenta' => array('set' => 45, 'unset' => 49),
- 'cyan' => array('set' => 46, 'unset' => 49),
- 'white' => array('set' => 47, 'unset' => 49),
- 'default' => array('set' => 49, 'unset' => 49),
- );
- private static $availableOptions = array(
- 'bold' => array('set' => 1, 'unset' => 22),
- 'underscore' => array('set' => 4, 'unset' => 24),
- 'blink' => array('set' => 5, 'unset' => 25),
- 'reverse' => array('set' => 7, 'unset' => 27),
- 'conceal' => array('set' => 8, 'unset' => 28),
- );
- private $foreground;
- private $background;
- private $options = array();
- public function __construct($foreground = null, $background = null, array $options = array())
- {
- if (null !== $foreground) {
- $this->setForeground($foreground);
- }
- if (null !== $background) {
- $this->setBackground($background);
- }
- if (count($options)) {
- $this->setOptions($options);
- }
- }
- public function setForeground($color = null)
- {
- if (null === $color) {
- $this->foreground = null;
- return;
- }
- if (!isset(static::$availableForegroundColors[$color])) {
- throw new InvalidArgumentException(sprintf(
- 'Invalid foreground color specified: "%s". Expected one of (%s)',
- $color,
- implode(', ', array_keys(static::$availableForegroundColors))
- ));
- }
- $this->foreground = static::$availableForegroundColors[$color];
- }
- public function setBackground($color = null)
- {
- if (null === $color) {
- $this->background = null;
- return;
- }
- if (!isset(static::$availableBackgroundColors[$color])) {
- throw new InvalidArgumentException(sprintf(
- 'Invalid background color specified: "%s". Expected one of (%s)',
- $color,
- implode(', ', array_keys(static::$availableBackgroundColors))
- ));
- }
- $this->background = static::$availableBackgroundColors[$color];
- }
- public function setOption($option)
- {
- if (!isset(static::$availableOptions[$option])) {
- throw new InvalidArgumentException(sprintf(
- 'Invalid option specified: "%s". Expected one of (%s)',
- $option,
- implode(', ', array_keys(static::$availableOptions))
- ));
- }
- if (!in_array(static::$availableOptions[$option], $this->options)) {
- $this->options[] = static::$availableOptions[$option];
- }
- }
- public function unsetOption($option)
- {
- if (!isset(static::$availableOptions[$option])) {
- throw new InvalidArgumentException(sprintf(
- 'Invalid option specified: "%s". Expected one of (%s)',
- $option,
- implode(', ', array_keys(static::$availableOptions))
- ));
- }
- $pos = array_search(static::$availableOptions[$option], $this->options);
- if (false !== $pos) {
- unset($this->options[$pos]);
- }
- }
- public function setOptions(array $options)
- {
- $this->options = array();
- foreach ($options as $option) {
- $this->setOption($option);
- }
- }
- public function apply($text)
- {
- $setCodes = array();
- $unsetCodes = array();
- if (null !== $this->foreground) {
- $setCodes[] = $this->foreground['set'];
- $unsetCodes[] = $this->foreground['unset'];
- }
- if (null !== $this->background) {
- $setCodes[] = $this->background['set'];
- $unsetCodes[] = $this->background['unset'];
- }
- if (count($this->options)) {
- foreach ($this->options as $option) {
- $setCodes[] = $option['set'];
- $unsetCodes[] = $option['unset'];
- }
- }
- if (0 === count($setCodes)) {
- return $text;
- }
- return sprintf("\033[%sm%s\033[%sm", implode(';', $setCodes), $text, implode(';', $unsetCodes));
- }
- }
- <?php
- namespace Symfony\Component\Console\Formatter;
- interface OutputFormatterStyleInterface
- {
- public function setForeground($color = null);
- public function setBackground($color = null);
- public function setOption($option);
- public function unsetOption($option);
- public function setOptions(array $options);
- public function apply($text);
- }
- <?php
- namespace Symfony\Component\Console\Formatter;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- class OutputFormatterStyleStack
- {
- private $styles;
- private $emptyStyle;
- public function __construct(OutputFormatterStyleInterface $emptyStyle = null)
- {
- $this->emptyStyle = $emptyStyle ?: new OutputFormatterStyle();
- $this->reset();
- }
- public function reset()
- {
- $this->styles = array();
- }
- public function push(OutputFormatterStyleInterface $style)
- {
- $this->styles[] = $style;
- }
- public function pop(OutputFormatterStyleInterface $style = null)
- {
- if (empty($this->styles)) {
- return $this->emptyStyle;
- }
- if (null === $style) {
- return array_pop($this->styles);
- }
- foreach (array_reverse($this->styles, true) as $index => $stackedStyle) {
- if ($style->apply('') === $stackedStyle->apply('')) {
- $this->styles = array_slice($this->styles, 0, $index);
- return $stackedStyle;
- }
- }
- throw new InvalidArgumentException('Incorrectly nested style tag found.');
- }
- public function getCurrent()
- {
- if (empty($this->styles)) {
- return $this->emptyStyle;
- }
- return $this->styles[count($this->styles) - 1];
- }
- public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle)
- {
- $this->emptyStyle = $emptyStyle;
- return $this;
- }
- public function getEmptyStyle()
- {
- return $this->emptyStyle;
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- class DebugFormatterHelper extends Helper
- {
- private $colors = array('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default');
- private $started = array();
- private $count = -1;
- public function start($id, $message, $prefix = 'RUN')
- {
- $this->started[$id] = array('border' => ++$this->count % count($this->colors));
- return sprintf("%s<bg=blue;fg=white> %s </> <fg=blue>%s</>\n", $this->getBorder($id), $prefix, $message);
- }
- public function progress($id, $buffer, $error = false, $prefix = 'OUT', $errorPrefix = 'ERR')
- {
- $message = '';
- if ($error) {
- if (isset($this->started[$id]['out'])) {
- $message .= "\n";
- unset($this->started[$id]['out']);
- }
- if (!isset($this->started[$id]['err'])) {
- $message .= sprintf('%s<bg=red;fg=white> %s </> ', $this->getBorder($id), $errorPrefix);
- $this->started[$id]['err'] = true;
- }
- $message .= str_replace("\n", sprintf("\n%s<bg=red;fg=white> %s </> ", $this->getBorder($id), $errorPrefix), $buffer);
- } else {
- if (isset($this->started[$id]['err'])) {
- $message .= "\n";
- unset($this->started[$id]['err']);
- }
- if (!isset($this->started[$id]['out'])) {
- $message .= sprintf('%s<bg=green;fg=white> %s </> ', $this->getBorder($id), $prefix);
- $this->started[$id]['out'] = true;
- }
- $message .= str_replace("\n", sprintf("\n%s<bg=green;fg=white> %s </> ", $this->getBorder($id), $prefix), $buffer);
- }
- return $message;
- }
- public function stop($id, $message, $successful, $prefix = 'RES')
- {
- $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : '';
- if ($successful) {
- return sprintf("%s%s<bg=green;fg=white> %s </> <fg=green>%s</>\n", $trailingEOL, $this->getBorder($id), $prefix, $message);
- }
- $message = sprintf("%s%s<bg=red;fg=white> %s </> <fg=red>%s</>\n", $trailingEOL, $this->getBorder($id), $prefix, $message);
- unset($this->started[$id]['out'], $this->started[$id]['err']);
- return $message;
- }
- private function getBorder($id)
- {
- return sprintf('<bg=%s> </>', $this->colors[$this->started[$id]['border']]);
- }
- public function getName()
- {
- return 'debug_formatter';
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Descriptor\DescriptorInterface;
- use Symfony\Component\Console\Descriptor\JsonDescriptor;
- use Symfony\Component\Console\Descriptor\MarkdownDescriptor;
- use Symfony\Component\Console\Descriptor\TextDescriptor;
- use Symfony\Component\Console\Descriptor\XmlDescriptor;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- class DescriptorHelper extends Helper
- {
- private $descriptors = array();
- public function __construct()
- {
- $this
- ->register('txt', new TextDescriptor())
- ->register('xml', new XmlDescriptor())
- ->register('json', new JsonDescriptor())
- ->register('md', new MarkdownDescriptor())
- ;
- }
- public function describe(OutputInterface $output, $object, array $options = array())
- {
- $options = array_merge(array(
- 'raw_text' => false,
- 'format' => 'txt',
- ), $options);
- if (!isset($this->descriptors[$options['format']])) {
- throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format']));
- }
- $descriptor = $this->descriptors[$options['format']];
- $descriptor->describe($output, $object, $options);
- }
- public function register($format, DescriptorInterface $descriptor)
- {
- $this->descriptors[$format] = $descriptor;
- return $this;
- }
- public function getName()
- {
- return 'descriptor';
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- use Symfony\Component\Console\Exception\RuntimeException;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Formatter\OutputFormatterStyle;
- class DialogHelper extends InputAwareHelper
- {
- private $inputStream;
- private static $shell;
- private static $stty;
- public function __construct($triggerDeprecationError = true)
- {
- if ($triggerDeprecationError) {
- @trigger_error('"Symfony\Component\Console\Helper\DialogHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\QuestionHelper" instead.', E_USER_DEPRECATED);
- }
- }
- public function select(OutputInterface $output, $question, $choices, $default = null, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false)
- {
- $width = max(array_map('strlen', array_keys($choices)));
- $messages = (array) $question;
- foreach ($choices as $key => $value) {
- $messages[] = sprintf(" [<info>%-{$width}s</info>] %s", $key, $value);
- }
- $output->writeln($messages);
- $result = $this->askAndValidate($output, '> ', function ($picked) use ($choices, $errorMessage, $multiselect) {
- $selectedChoices = str_replace(' ', '', $picked);
- if ($multiselect) {
- if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) {
- throw new InvalidArgumentException(sprintf($errorMessage, $picked));
- }
- $selectedChoices = explode(',', $selectedChoices);
- } else {
- $selectedChoices = array($picked);
- }
- $multiselectChoices = array();
- foreach ($selectedChoices as $value) {
- if (empty($choices[$value])) {
- throw new InvalidArgumentException(sprintf($errorMessage, $value));
- }
- $multiselectChoices[] = $value;
- }
- if ($multiselect) {
- return $multiselectChoices;
- }
- return $picked;
- }, $attempts, $default);
- return $result;
- }
- public function ask(OutputInterface $output, $question, $default = null, array $autocomplete = null)
- {
- if ($this->input && !$this->input->isInteractive()) {
- return $default;
- }
- $output->write($question);
- $inputStream = $this->inputStream ?: STDIN;
- if (null === $autocomplete || !$this->hasSttyAvailable()) {
- $ret = fgets($inputStream, 4096);
- if (false === $ret) {
- throw new RuntimeException('Aborted');
- }
- $ret = trim($ret);
- } else {
- $ret = '';
- $i = 0;
- $ofs = -1;
- $matches = $autocomplete;
- $numMatches = count($matches);
- $sttyMode = shell_exec('stty -g');
- shell_exec('stty -icanon -echo');
- $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white'));
- while (!feof($inputStream)) {
- $c = fread($inputStream, 1);
- if ("\177" === $c) {
- if (0 === $numMatches && 0 !== $i) {
- --$i;
- $output->write("\033[1D");
- }
- if ($i === 0) {
- $ofs = -1;
- $matches = $autocomplete;
- $numMatches = count($matches);
- } else {
- $numMatches = 0;
- }
- $ret = substr($ret, 0, $i);
- } elseif ("\033" === $c) {
- $c .= fread($inputStream, 2);
- if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) {
- if ('A' === $c[2] && -1 === $ofs) {
- $ofs = 0;
- }
- if (0 === $numMatches) {
- continue;
- }
- $ofs += ('A' === $c[2]) ? -1 : 1;
- $ofs = ($numMatches + $ofs) % $numMatches;
- }
- } elseif (ord($c) < 32) {
- if ("\t" === $c || "\n" === $c) {
- if ($numMatches > 0 && -1 !== $ofs) {
- $ret = $matches[$ofs];
- $output->write(substr($ret, $i));
- $i = strlen($ret);
- }
- if ("\n" === $c) {
- $output->write($c);
- break;
- }
- $numMatches = 0;
- }
- continue;
- } else {
- $output->write($c);
- $ret .= $c;
- ++$i;
- $numMatches = 0;
- $ofs = 0;
- foreach ($autocomplete as $value) {
- if (0 === strpos($value, $ret) && $i !== strlen($value)) {
- $matches[$numMatches++] = $value;
- }
- }
- }
- $output->write("\033[K");
- if ($numMatches > 0 && -1 !== $ofs) {
- $output->write("\0337");
- $output->write('<hl>'.substr($matches[$ofs], $i).'</hl>');
- $output->write("\0338");
- }
- }
- shell_exec(sprintf('stty %s', $sttyMode));
- }
- return strlen($ret) > 0 ? $ret : $default;
- }
- public function askConfirmation(OutputInterface $output, $question, $default = true)
- {
- $answer = 'z';
- while ($answer && !in_array(strtolower($answer[0]), array('y', 'n'))) {
- $answer = $this->ask($output, $question);
- }
- if (false === $default) {
- return $answer && 'y' == strtolower($answer[0]);
- }
- return !$answer || 'y' == strtolower($answer[0]);
- }
- public function askHiddenResponse(OutputInterface $output, $question, $fallback = true)
- {
- if ('\\' === DIRECTORY_SEPARATOR) {
- $exe = __DIR__.'/../Resources/bin/hiddeninput.exe';
- if ('phar:' === substr(__FILE__, 0, 5)) {
- $tmpExe = sys_get_temp_dir().'/hiddeninput.exe';
- copy($exe, $tmpExe);
- $exe = $tmpExe;
- }
- $output->write($question);
- $value = rtrim(shell_exec($exe));
- $output->writeln('');
- if (isset($tmpExe)) {
- unlink($tmpExe);
- }
- return $value;
- }
- if ($this->hasSttyAvailable()) {
- $output->write($question);
- $sttyMode = shell_exec('stty -g');
- shell_exec('stty -echo');
- $value = fgets($this->inputStream ?: STDIN, 4096);
- shell_exec(sprintf('stty %s', $sttyMode));
- if (false === $value) {
- throw new RuntimeException('Aborted');
- }
- $value = trim($value);
- $output->writeln('');
- return $value;
- }
- if (false !== $shell = $this->getShell()) {
- $output->write($question);
- $readCmd = $shell === 'csh' ? 'set mypassword = $<' : 'read -r mypassword';
- $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd);
- $value = rtrim(shell_exec($command));
- $output->writeln('');
- return $value;
- }
- if ($fallback) {
- return $this->ask($output, $question);
- }
- throw new RuntimeException('Unable to hide the response');
- }
- public function askAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $default = null, array $autocomplete = null)
- {
- $that = $this;
- $interviewer = function () use ($output, $question, $default, $autocomplete, $that) {
- return $that->ask($output, $question, $default, $autocomplete);
- };
- return $this->validateAttempts($interviewer, $output, $validator, $attempts);
- }
- public function askHiddenResponseAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $fallback = true)
- {
- $that = $this;
- $interviewer = function () use ($output, $question, $fallback, $that) {
- return $that->askHiddenResponse($output, $question, $fallback);
- };
- return $this->validateAttempts($interviewer, $output, $validator, $attempts);
- }
- public function setInputStream($stream)
- {
- $this->inputStream = $stream;
- }
- public function getInputStream()
- {
- return $this->inputStream;
- }
- public function getName()
- {
- return 'dialog';
- }
- private function getShell()
- {
- if (null !== self::$shell) {
- return self::$shell;
- }
- self::$shell = false;
- if (file_exists('/usr/bin/env')) {
- $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null";
- foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) {
- if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) {
- self::$shell = $sh;
- break;
- }
- }
- }
- return self::$shell;
- }
- private function hasSttyAvailable()
- {
- if (null !== self::$stty) {
- return self::$stty;
- }
- exec('stty 2>&1', $output, $exitcode);
- return self::$stty = $exitcode === 0;
- }
- private function validateAttempts($interviewer, OutputInterface $output, $validator, $attempts)
- {
- $e = null;
- while (false === $attempts || $attempts--) {
- if (null !== $e) {
- $output->writeln($this->getHelperSet()->get('formatter')->formatBlock($e->getMessage(), 'error'));
- }
- try {
- return call_user_func($validator, $interviewer());
- } catch (\Exception $e) {
- }
- }
- throw $e;
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Formatter\OutputFormatter;
- class FormatterHelper extends Helper
- {
- public function formatSection($section, $message, $style = 'info')
- {
- return sprintf('<%s>[%s]</%s> %s', $style, $section, $style, $message);
- }
- public function formatBlock($messages, $style, $large = false)
- {
- if (!is_array($messages)) {
- $messages = array($messages);
- }
- $len = 0;
- $lines = array();
- foreach ($messages as $message) {
- $message = OutputFormatter::escape($message);
- $lines[] = sprintf($large ? ' %s ' : ' %s ', $message);
- $len = max($this->strlen($message) + ($large ? 4 : 2), $len);
- }
- $messages = $large ? array(str_repeat(' ', $len)) : array();
- for ($i = 0; isset($lines[$i]); ++$i) {
- $messages[] = $lines[$i].str_repeat(' ', $len - $this->strlen($lines[$i]));
- }
- if ($large) {
- $messages[] = str_repeat(' ', $len);
- }
- for ($i = 0; isset($messages[$i]); ++$i) {
- $messages[$i] = sprintf('<%s>%s</%s>', $style, $messages[$i], $style);
- }
- return implode("\n", $messages);
- }
- public function getName()
- {
- return 'formatter';
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Formatter\OutputFormatterInterface;
- abstract class Helper implements HelperInterface
- {
- protected $helperSet = null;
- public function setHelperSet(HelperSet $helperSet = null)
- {
- $this->helperSet = $helperSet;
- }
- public function getHelperSet()
- {
- return $this->helperSet;
- }
- public static function strlen($string)
- {
- if (false === $encoding = mb_detect_encoding($string, null, true)) {
- return strlen($string);
- }
- return mb_strwidth($string, $encoding);
- }
- public static function formatTime($secs)
- {
- static $timeFormats = array(
- array(0, '< 1 sec'),
- array(2, '1 sec'),
- array(59, 'secs', 1),
- array(60, '1 min'),
- array(3600, 'mins', 60),
- array(5400, '1 hr'),
- array(86400, 'hrs', 3600),
- array(129600, '1 day'),
- array(604800, 'days', 86400),
- );
- foreach ($timeFormats as $format) {
- if ($secs >= $format[0]) {
- continue;
- }
- if (2 == count($format)) {
- return $format[1];
- }
- return ceil($secs / $format[2]).' '.$format[1];
- }
- }
- public static function formatMemory($memory)
- {
- if ($memory >= 1024 * 1024 * 1024) {
- return sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024);
- }
- if ($memory >= 1024 * 1024) {
- return sprintf('%.1f MiB', $memory / 1024 / 1024);
- }
- if ($memory >= 1024) {
- return sprintf('%d KiB', $memory / 1024);
- }
- return sprintf('%d B', $memory);
- }
- public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, $string)
- {
- $isDecorated = $formatter->isDecorated();
- $formatter->setDecorated(false);
- $string = $formatter->format($string);
- $string = preg_replace("/\033\[[^m]*m/", '', $string);
- $formatter->setDecorated($isDecorated);
- return self::strlen($string);
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- interface HelperInterface
- {
- public function setHelperSet(HelperSet $helperSet = null);
- public function getHelperSet();
- public function getName();
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- class HelperSet implements \IteratorAggregate
- {
- private $helpers = array();
- private $command;
- public function __construct(array $helpers = array())
- {
- foreach ($helpers as $alias => $helper) {
- $this->set($helper, is_int($alias) ? null : $alias);
- }
- }
- public function set(HelperInterface $helper, $alias = null)
- {
- $this->helpers[$helper->getName()] = $helper;
- if (null !== $alias) {
- $this->helpers[$alias] = $helper;
- }
- $helper->setHelperSet($this);
- }
- public function has($name)
- {
- return isset($this->helpers[$name]);
- }
- public function get($name)
- {
- if (!$this->has($name)) {
- throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name));
- }
- if ('dialog' === $name && $this->helpers[$name] instanceof DialogHelper) {
- @trigger_error('"Symfony\Component\Console\Helper\DialogHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\QuestionHelper" instead.', E_USER_DEPRECATED);
- } elseif ('progress' === $name && $this->helpers[$name] instanceof ProgressHelper) {
- @trigger_error('"Symfony\Component\Console\Helper\ProgressHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\ProgressBar" instead.', E_USER_DEPRECATED);
- } elseif ('table' === $name && $this->helpers[$name] instanceof TableHelper) {
- @trigger_error('"Symfony\Component\Console\Helper\TableHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\Table" instead.', E_USER_DEPRECATED);
- }
- return $this->helpers[$name];
- }
- public function setCommand(Command $command = null)
- {
- $this->command = $command;
- }
- public function getCommand()
- {
- return $this->command;
- }
- public function getIterator()
- {
- return new \ArrayIterator($this->helpers);
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputAwareInterface;
- abstract class InputAwareHelper extends Helper implements InputAwareInterface
- {
- protected $input;
- public function setInput(InputInterface $input)
- {
- $this->input = $input;
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Output\ConsoleOutputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Process\Exception\ProcessFailedException;
- use Symfony\Component\Process\Process;
- use Symfony\Component\Process\ProcessBuilder;
- class ProcessHelper extends Helper
- {
- public function run(OutputInterface $output, $cmd, $error = null, $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
- {
- if ($output instanceof ConsoleOutputInterface) {
- $output = $output->getErrorOutput();
- }
- $formatter = $this->getHelperSet()->get('debug_formatter');
- if (is_array($cmd)) {
- $process = ProcessBuilder::create($cmd)->getProcess();
- } elseif ($cmd instanceof Process) {
- $process = $cmd;
- } else {
- $process = new Process($cmd);
- }
- if ($verbosity <= $output->getVerbosity()) {
- $output->write($formatter->start(spl_object_hash($process), $this->escapeString($process->getCommandLine())));
- }
- if ($output->isDebug()) {
- $callback = $this->wrapCallback($output, $process, $callback);
- }
- $process->run($callback);
- if ($verbosity <= $output->getVerbosity()) {
- $message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode());
- $output->write($formatter->stop(spl_object_hash($process), $message, $process->isSuccessful()));
- }
- if (!$process->isSuccessful() && null !== $error) {
- $output->writeln(sprintf('<error>%s</error>', $this->escapeString($error)));
- }
- return $process;
- }
- public function mustRun(OutputInterface $output, $cmd, $error = null, $callback = null)
- {
- $process = $this->run($output, $cmd, $error, $callback);
- if (!$process->isSuccessful()) {
- throw new ProcessFailedException($process);
- }
- return $process;
- }
- public function wrapCallback(OutputInterface $output, Process $process, $callback = null)
- {
- if ($output instanceof ConsoleOutputInterface) {
- $output = $output->getErrorOutput();
- }
- $formatter = $this->getHelperSet()->get('debug_formatter');
- $that = $this;
- return function ($type, $buffer) use ($output, $process, $callback, $formatter, $that) {
- $output->write($formatter->progress(spl_object_hash($process), $that->escapeString($buffer), Process::ERR === $type));
- if (null !== $callback) {
- call_user_func($callback, $type, $buffer);
- }
- };
- }
- public function escapeString($str)
- {
- return str_replace('<', '\\<', $str);
- }
- public function getName()
- {
- return 'process';
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Output\ConsoleOutputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Exception\LogicException;
- class ProgressBar
- {
- private $barWidth = 28;
- private $barChar;
- private $emptyBarChar = '-';
- private $progressChar = '>';
- private $format;
- private $internalFormat;
- private $redrawFreq = 1;
- private $output;
- private $step = 0;
- private $max;
- private $startTime;
- private $stepWidth;
- private $percent = 0.0;
- private $lastMessagesLength = 0;
- private $formatLineCount;
- private $messages;
- private $overwrite = true;
- private static $formatters;
- private static $formats;
- public function __construct(OutputInterface $output, $max = 0)
- {
- if ($output instanceof ConsoleOutputInterface) {
- $output = $output->getErrorOutput();
- }
- $this->output = $output;
- $this->setMaxSteps($max);
- if (!$this->output->isDecorated()) {
- $this->overwrite = false;
- $this->setRedrawFrequency($max / 10);
- }
- $this->startTime = time();
- }
- public static function setPlaceholderFormatterDefinition($name, $callable)
- {
- if (!self::$formatters) {
- self::$formatters = self::initPlaceholderFormatters();
- }
- self::$formatters[$name] = $callable;
- }
- public static function getPlaceholderFormatterDefinition($name)
- {
- if (!self::$formatters) {
- self::$formatters = self::initPlaceholderFormatters();
- }
- return isset(self::$formatters[$name]) ? self::$formatters[$name] : null;
- }
- public static function setFormatDefinition($name, $format)
- {
- if (!self::$formats) {
- self::$formats = self::initFormats();
- }
- self::$formats[$name] = $format;
- }
- public static function getFormatDefinition($name)
- {
- if (!self::$formats) {
- self::$formats = self::initFormats();
- }
- return isset(self::$formats[$name]) ? self::$formats[$name] : null;
- }
- public function setMessage($message, $name = 'message')
- {
- $this->messages[$name] = $message;
- }
- public function getMessage($name = 'message')
- {
- return $this->messages[$name];
- }
- public function getStartTime()
- {
- return $this->startTime;
- }
- public function getMaxSteps()
- {
- return $this->max;
- }
- public function getStep()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the getProgress() method instead.', E_USER_DEPRECATED);
- return $this->getProgress();
- }
- public function getProgress()
- {
- return $this->step;
- }
- public function getStepWidth()
- {
- return $this->stepWidth;
- }
- public function getProgressPercent()
- {
- return $this->percent;
- }
- public function setBarWidth($size)
- {
- $this->barWidth = (int) $size;
- }
- public function getBarWidth()
- {
- return $this->barWidth;
- }
- public function setBarCharacter($char)
- {
- $this->barChar = $char;
- }
- public function getBarCharacter()
- {
- if (null === $this->barChar) {
- return $this->max ? '=' : $this->emptyBarChar;
- }
- return $this->barChar;
- }
- public function setEmptyBarCharacter($char)
- {
- $this->emptyBarChar = $char;
- }
- public function getEmptyBarCharacter()
- {
- return $this->emptyBarChar;
- }
- public function setProgressCharacter($char)
- {
- $this->progressChar = $char;
- }
- public function getProgressCharacter()
- {
- return $this->progressChar;
- }
- public function setFormat($format)
- {
- $this->format = null;
- $this->internalFormat = $format;
- }
- public function setRedrawFrequency($freq)
- {
- $this->redrawFreq = max((int) $freq, 1);
- }
- public function start($max = null)
- {
- $this->startTime = time();
- $this->step = 0;
- $this->percent = 0.0;
- if (null !== $max) {
- $this->setMaxSteps($max);
- }
- $this->display();
- }
- public function advance($step = 1)
- {
- $this->setProgress($this->step + $step);
- }
- public function setCurrent($step)
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the setProgress() method instead.', E_USER_DEPRECATED);
- $this->setProgress($step);
- }
- public function setOverwrite($overwrite)
- {
- $this->overwrite = (bool) $overwrite;
- }
- public function setProgress($step)
- {
- $step = (int) $step;
- if ($step < $this->step) {
- throw new LogicException('You can\'t regress the progress bar.');
- }
- if ($this->max && $step > $this->max) {
- $this->max = $step;
- }
- $prevPeriod = (int) ($this->step / $this->redrawFreq);
- $currPeriod = (int) ($step / $this->redrawFreq);
- $this->step = $step;
- $this->percent = $this->max ? (float) $this->step / $this->max : 0;
- if ($prevPeriod !== $currPeriod || $this->max === $step) {
- $this->display();
- }
- }
- public function finish()
- {
- if (!$this->max) {
- $this->max = $this->step;
- }
- if ($this->step === $this->max && !$this->overwrite) {
- return;
- }
- $this->setProgress($this->max);
- }
- public function display()
- {
- if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) {
- return;
- }
- if (null === $this->format) {
- $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat());
- }
- $self = $this;
- $output = $this->output;
- $messages = $this->messages;
- $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) use ($self, $output, $messages) {
- if ($formatter = $self::getPlaceholderFormatterDefinition($matches[1])) {
- $text = call_user_func($formatter, $self, $output);
- } elseif (isset($messages[$matches[1]])) {
- $text = $messages[$matches[1]];
- } else {
- return $matches[0];
- }
- if (isset($matches[2])) {
- $text = sprintf('%'.$matches[2], $text);
- }
- return $text;
- }, $this->format));
- }
- public function clear()
- {
- if (!$this->overwrite) {
- return;
- }
- if (null === $this->format) {
- $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat());
- }
- $this->overwrite(str_repeat("\n", $this->formatLineCount));
- }
- private function setRealFormat($format)
- {
- if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) {
- $this->format = self::getFormatDefinition($format.'_nomax');
- } elseif (null !== self::getFormatDefinition($format)) {
- $this->format = self::getFormatDefinition($format);
- } else {
- $this->format = $format;
- }
- $this->formatLineCount = substr_count($this->format, "\n");
- }
- private function setMaxSteps($max)
- {
- $this->max = max(0, (int) $max);
- $this->stepWidth = $this->max ? Helper::strlen($this->max) : 4;
- }
- private function overwrite($message)
- {
- $lines = explode("\n", $message);
- if (null !== $this->lastMessagesLength) {
- foreach ($lines as $i => $line) {
- if ($this->lastMessagesLength > Helper::strlenWithoutDecoration($this->output->getFormatter(), $line)) {
- $lines[$i] = str_pad($line, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT);
- }
- }
- }
- if ($this->overwrite) {
- $this->output->write("\x0D");
- } elseif ($this->step > 0) {
- $this->output->writeln('');
- }
- if ($this->formatLineCount) {
- $this->output->write(sprintf("\033[%dA", $this->formatLineCount));
- }
- $this->output->write(implode("\n", $lines));
- $this->lastMessagesLength = 0;
- foreach ($lines as $line) {
- $len = Helper::strlenWithoutDecoration($this->output->getFormatter(), $line);
- if ($len > $this->lastMessagesLength) {
- $this->lastMessagesLength = $len;
- }
- }
- }
- private function determineBestFormat()
- {
- switch ($this->output->getVerbosity()) {
- case OutputInterface::VERBOSITY_VERBOSE:
- return $this->max ? 'verbose' : 'verbose_nomax';
- case OutputInterface::VERBOSITY_VERY_VERBOSE:
- return $this->max ? 'very_verbose' : 'very_verbose_nomax';
- case OutputInterface::VERBOSITY_DEBUG:
- return $this->max ? 'debug' : 'debug_nomax';
- default:
- return $this->max ? 'normal' : 'normal_nomax';
- }
- }
- private static function initPlaceholderFormatters()
- {
- return array(
- 'bar' => function (ProgressBar $bar, OutputInterface $output) {
- $completeBars = floor($bar->getMaxSteps() > 0 ? $bar->getProgressPercent() * $bar->getBarWidth() : $bar->getProgress() % $bar->getBarWidth());
- $display = str_repeat($bar->getBarCharacter(), $completeBars);
- if ($completeBars < $bar->getBarWidth()) {
- $emptyBars = $bar->getBarWidth() - $completeBars - Helper::strlenWithoutDecoration($output->getFormatter(), $bar->getProgressCharacter());
- $display .= $bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(), $emptyBars);
- }
- return $display;
- },
- 'elapsed' => function (ProgressBar $bar) {
- return Helper::formatTime(time() - $bar->getStartTime());
- },
- 'remaining' => function (ProgressBar $bar) {
- if (!$bar->getMaxSteps()) {
- throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.');
- }
- if (!$bar->getProgress()) {
- $remaining = 0;
- } else {
- $remaining = round((time() - $bar->getStartTime()) / $bar->getProgress() * ($bar->getMaxSteps() - $bar->getProgress()));
- }
- return Helper::formatTime($remaining);
- },
- 'estimated' => function (ProgressBar $bar) {
- if (!$bar->getMaxSteps()) {
- throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.');
- }
- if (!$bar->getProgress()) {
- $estimated = 0;
- } else {
- $estimated = round((time() - $bar->getStartTime()) / $bar->getProgress() * $bar->getMaxSteps());
- }
- return Helper::formatTime($estimated);
- },
- 'memory' => function (ProgressBar $bar) {
- return Helper::formatMemory(memory_get_usage(true));
- },
- 'current' => function (ProgressBar $bar) {
- return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', STR_PAD_LEFT);
- },
- 'max' => function (ProgressBar $bar) {
- return $bar->getMaxSteps();
- },
- 'percent' => function (ProgressBar $bar) {
- return floor($bar->getProgressPercent() * 100);
- },
- );
- }
- private static function initFormats()
- {
- return array(
- 'normal' => ' %current%/%max% [%bar%] %percent:3s%%',
- 'normal_nomax' => ' %current% [%bar%]',
- 'verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%',
- 'verbose_nomax' => ' %current% [%bar%] %elapsed:6s%',
- 'very_verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%',
- 'very_verbose_nomax' => ' %current% [%bar%] %elapsed:6s%',
- 'debug' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%',
- 'debug_nomax' => ' %current% [%bar%] %elapsed:6s% %memory:6s%',
- );
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Output\NullOutput;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Exception\LogicException;
- class ProgressHelper extends Helper
- {
- const FORMAT_QUIET = ' %percent%%';
- const FORMAT_NORMAL = ' %current%/%max% [%bar%] %percent%%';
- const FORMAT_VERBOSE = ' %current%/%max% [%bar%] %percent%% Elapsed: %elapsed%';
- const FORMAT_QUIET_NOMAX = ' %current%';
- const FORMAT_NORMAL_NOMAX = ' %current% [%bar%]';
- const FORMAT_VERBOSE_NOMAX = ' %current% [%bar%] Elapsed: %elapsed%';
- private $barWidth = 28;
- private $barChar = '=';
- private $emptyBarChar = '-';
- private $progressChar = '>';
- private $format = null;
- private $redrawFreq = 1;
- private $lastMessagesLength;
- private $barCharOriginal;
- private $output;
- private $current;
- private $max;
- private $startTime;
- private $defaultFormatVars = array(
- 'current',
- 'max',
- 'bar',
- 'percent',
- 'elapsed',
- );
- private $formatVars;
- private $widths = array(
- 'current' => 4,
- 'max' => 4,
- 'percent' => 3,
- 'elapsed' => 6,
- );
- private $timeFormats = array(
- array(0, '???'),
- array(2, '1 sec'),
- array(59, 'secs', 1),
- array(60, '1 min'),
- array(3600, 'mins', 60),
- array(5400, '1 hr'),
- array(86400, 'hrs', 3600),
- array(129600, '1 day'),
- array(604800, 'days', 86400),
- );
- public function __construct($triggerDeprecationError = true)
- {
- if ($triggerDeprecationError) {
- @trigger_error('The '.__CLASS__.' class is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\Console\Helper\ProgressBar class instead.', E_USER_DEPRECATED);
- }
- }
- public function setBarWidth($size)
- {
- $this->barWidth = (int) $size;
- }
- public function setBarCharacter($char)
- {
- $this->barChar = $char;
- }
- public function setEmptyBarCharacter($char)
- {
- $this->emptyBarChar = $char;
- }
- public function setProgressCharacter($char)
- {
- $this->progressChar = $char;
- }
- public function setFormat($format)
- {
- $this->format = $format;
- }
- public function setRedrawFrequency($freq)
- {
- $this->redrawFreq = (int) $freq;
- }
- public function start(OutputInterface $output, $max = null)
- {
- $this->startTime = time();
- $this->current = 0;
- $this->max = (int) $max;
- $this->output = $output->isDecorated() ? $output : new NullOutput();
- $this->lastMessagesLength = 0;
- $this->barCharOriginal = '';
- if (null === $this->format) {
- switch ($output->getVerbosity()) {
- case OutputInterface::VERBOSITY_QUIET:
- $this->format = self::FORMAT_QUIET_NOMAX;
- if ($this->max > 0) {
- $this->format = self::FORMAT_QUIET;
- }
- break;
- case OutputInterface::VERBOSITY_VERBOSE:
- case OutputInterface::VERBOSITY_VERY_VERBOSE:
- case OutputInterface::VERBOSITY_DEBUG:
- $this->format = self::FORMAT_VERBOSE_NOMAX;
- if ($this->max > 0) {
- $this->format = self::FORMAT_VERBOSE;
- }
- break;
- default:
- $this->format = self::FORMAT_NORMAL_NOMAX;
- if ($this->max > 0) {
- $this->format = self::FORMAT_NORMAL;
- }
- break;
- }
- }
- $this->initialize();
- }
- public function advance($step = 1, $redraw = false)
- {
- $this->setCurrent($this->current + $step, $redraw);
- }
- public function setCurrent($current, $redraw = false)
- {
- if (null === $this->startTime) {
- throw new LogicException('You must start the progress bar before calling setCurrent().');
- }
- $current = (int) $current;
- if ($current < $this->current) {
- throw new LogicException('You can\'t regress the progress bar');
- }
- if (0 === $this->current) {
- $redraw = true;
- }
- $prevPeriod = (int) ($this->current / $this->redrawFreq);
- $this->current = $current;
- $currPeriod = (int) ($this->current / $this->redrawFreq);
- if ($redraw || $prevPeriod !== $currPeriod || $this->max === $this->current) {
- $this->display();
- }
- }
- public function display($finish = false)
- {
- if (null === $this->startTime) {
- throw new LogicException('You must start the progress bar before calling display().');
- }
- $message = $this->format;
- foreach ($this->generate($finish) as $name => $value) {
- $message = str_replace("%{$name}%", $value, $message);
- }
- $this->overwrite($this->output, $message);
- }
- public function clear()
- {
- $this->overwrite($this->output, '');
- }
- public function finish()
- {
- if (null === $this->startTime) {
- throw new LogicException('You must start the progress bar before calling finish().');
- }
- if (null !== $this->startTime) {
- if (!$this->max) {
- $this->barChar = $this->barCharOriginal;
- $this->display(true);
- }
- $this->startTime = null;
- $this->output->writeln('');
- $this->output = null;
- }
- }
- private function initialize()
- {
- $this->formatVars = array();
- foreach ($this->defaultFormatVars as $var) {
- if (false !== strpos($this->format, "%{$var}%")) {
- $this->formatVars[$var] = true;
- }
- }
- if ($this->max > 0) {
- $this->widths['max'] = $this->strlen($this->max);
- $this->widths['current'] = $this->widths['max'];
- } else {
- $this->barCharOriginal = $this->barChar;
- $this->barChar = $this->emptyBarChar;
- }
- }
- private function generate($finish = false)
- {
- $vars = array();
- $percent = 0;
- if ($this->max > 0) {
- $percent = (float) $this->current / $this->max;
- }
- if (isset($this->formatVars['bar'])) {
- $completeBars = 0;
- if ($this->max > 0) {
- $completeBars = floor($percent * $this->barWidth);
- } else {
- if (!$finish) {
- $completeBars = floor($this->current % $this->barWidth);
- } else {
- $completeBars = $this->barWidth;
- }
- }
- $emptyBars = $this->barWidth - $completeBars - $this->strlen($this->progressChar);
- $bar = str_repeat($this->barChar, $completeBars);
- if ($completeBars < $this->barWidth) {
- $bar .= $this->progressChar;
- $bar .= str_repeat($this->emptyBarChar, $emptyBars);
- }
- $vars['bar'] = $bar;
- }
- if (isset($this->formatVars['elapsed'])) {
- $elapsed = time() - $this->startTime;
- $vars['elapsed'] = str_pad($this->humaneTime($elapsed), $this->widths['elapsed'], ' ', STR_PAD_LEFT);
- }
- if (isset($this->formatVars['current'])) {
- $vars['current'] = str_pad($this->current, $this->widths['current'], ' ', STR_PAD_LEFT);
- }
- if (isset($this->formatVars['max'])) {
- $vars['max'] = $this->max;
- }
- if (isset($this->formatVars['percent'])) {
- $vars['percent'] = str_pad(floor($percent * 100), $this->widths['percent'], ' ', STR_PAD_LEFT);
- }
- return $vars;
- }
- private function humaneTime($secs)
- {
- $text = '';
- foreach ($this->timeFormats as $format) {
- if ($secs < $format[0]) {
- if (count($format) == 2) {
- $text = $format[1];
- break;
- } else {
- $text = ceil($secs / $format[2]).' '.$format[1];
- break;
- }
- }
- }
- return $text;
- }
- private function overwrite(OutputInterface $output, $message)
- {
- $length = $this->strlen($message);
- if (null !== $this->lastMessagesLength && $this->lastMessagesLength > $length) {
- $message = str_pad($message, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT);
- }
- $output->write("\x0D");
- $output->write($message);
- $this->lastMessagesLength = $this->strlen($message);
- }
- public function getName()
- {
- return 'progress';
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Output\OutputInterface;
- class ProgressIndicator
- {
- private $output;
- private $startTime;
- private $format;
- private $message;
- private $indicatorValues;
- private $indicatorCurrent;
- private $indicatorChangeInterval;
- private $indicatorUpdateTime;
- private $lastMessagesLength;
- private $started = false;
- private static $formatters;
- private static $formats;
- public function __construct(OutputInterface $output, $format = null, $indicatorChangeInterval = 100, $indicatorValues = null)
- {
- $this->output = $output;
- if (null === $format) {
- $format = $this->determineBestFormat();
- }
- if (null === $indicatorValues) {
- $indicatorValues = array('-', '\\', '|', '/');
- }
- $indicatorValues = array_values($indicatorValues);
- if (2 > count($indicatorValues)) {
- throw new \InvalidArgumentException('Must have at least 2 indicator value characters.');
- }
- $this->format = self::getFormatDefinition($format);
- $this->indicatorChangeInterval = $indicatorChangeInterval;
- $this->indicatorValues = $indicatorValues;
- $this->startTime = time();
- }
- public function setMessage($message)
- {
- $this->message = $message;
- $this->display();
- }
- public function getMessage()
- {
- return $this->message;
- }
- public function getStartTime()
- {
- return $this->startTime;
- }
- public function getCurrentValue()
- {
- return $this->indicatorValues[$this->indicatorCurrent % count($this->indicatorValues)];
- }
- public function start($message)
- {
- if ($this->started) {
- throw new \LogicException('Progress indicator already started.');
- }
- $this->message = $message;
- $this->started = true;
- $this->lastMessagesLength = 0;
- $this->startTime = time();
- $this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval;
- $this->indicatorCurrent = 0;
- $this->display();
- }
- public function advance()
- {
- if (!$this->started) {
- throw new \LogicException('Progress indicator has not yet been started.');
- }
- if (!$this->output->isDecorated()) {
- return;
- }
- $currentTime = $this->getCurrentTimeInMilliseconds();
- if ($currentTime < $this->indicatorUpdateTime) {
- return;
- }
- $this->indicatorUpdateTime = $currentTime + $this->indicatorChangeInterval;
- ++$this->indicatorCurrent;
- $this->display();
- }
- public function finish($message)
- {
- if (!$this->started) {
- throw new \LogicException('Progress indicator has not yet been started.');
- }
- $this->message = $message;
- $this->display();
- $this->output->writeln('');
- $this->started = false;
- }
- public static function getFormatDefinition($name)
- {
- if (!self::$formats) {
- self::$formats = self::initFormats();
- }
- return isset(self::$formats[$name]) ? self::$formats[$name] : null;
- }
- public static function setPlaceholderFormatterDefinition($name, $callable)
- {
- if (!self::$formatters) {
- self::$formatters = self::initPlaceholderFormatters();
- }
- self::$formatters[$name] = $callable;
- }
- public static function getPlaceholderFormatterDefinition($name)
- {
- if (!self::$formatters) {
- self::$formatters = self::initPlaceholderFormatters();
- }
- return isset(self::$formatters[$name]) ? self::$formatters[$name] : null;
- }
- private function display()
- {
- if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) {
- return;
- }
- $self = $this;
- $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) use ($self) {
- if ($formatter = $self::getPlaceholderFormatterDefinition($matches[1])) {
- return call_user_func($formatter, $self);
- }
- return $matches[0];
- }, $this->format));
- }
- private function determineBestFormat()
- {
- switch ($this->output->getVerbosity()) {
- case OutputInterface::VERBOSITY_VERBOSE:
- return $this->output->isDecorated() ? 'verbose' : 'verbose_no_ansi';
- case OutputInterface::VERBOSITY_VERY_VERBOSE:
- case OutputInterface::VERBOSITY_DEBUG:
- return $this->output->isDecorated() ? 'very_verbose' : 'very_verbose_no_ansi';
- default:
- return $this->output->isDecorated() ? 'normal' : 'normal_no_ansi';
- }
- }
- private function overwrite($message)
- {
- if (null !== $this->lastMessagesLength) {
- if ($this->lastMessagesLength > Helper::strlenWithoutDecoration($this->output->getFormatter(), $message)) {
- $message = str_pad($message, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT);
- }
- }
- if ($this->output->isDecorated()) {
- $this->output->write("\x0D");
- $this->output->write($message);
- } else {
- $this->output->writeln($message);
- }
- $this->lastMessagesLength = 0;
- $len = Helper::strlenWithoutDecoration($this->output->getFormatter(), $message);
- if ($len > $this->lastMessagesLength) {
- $this->lastMessagesLength = $len;
- }
- }
- private function getCurrentTimeInMilliseconds()
- {
- return round(microtime(true) * 1000);
- }
- private static function initPlaceholderFormatters()
- {
- return array(
- 'indicator' => function (ProgressIndicator $indicator) {
- return $indicator->getCurrentValue();
- },
- 'message' => function (ProgressIndicator $indicator) {
- return $indicator->getMessage();
- },
- 'elapsed' => function (ProgressIndicator $indicator) {
- return Helper::formatTime(time() - $indicator->getStartTime());
- },
- 'memory' => function () {
- return Helper::formatMemory(memory_get_usage(true));
- },
- );
- }
- private static function initFormats()
- {
- return array(
- 'normal' => ' %indicator% %message%',
- 'normal_no_ansi' => ' %message%',
- 'verbose' => ' %indicator% %message% (%elapsed:6s%)',
- 'verbose_no_ansi' => ' %message% (%elapsed:6s%)',
- 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)',
- 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)',
- );
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- use Symfony\Component\Console\Exception\RuntimeException;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\ConsoleOutputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Formatter\OutputFormatterStyle;
- use Symfony\Component\Console\Question\Question;
- use Symfony\Component\Console\Question\ChoiceQuestion;
- class QuestionHelper extends Helper
- {
- private $inputStream;
- private static $shell;
- private static $stty;
- public function ask(InputInterface $input, OutputInterface $output, Question $question)
- {
- if ($output instanceof ConsoleOutputInterface) {
- $output = $output->getErrorOutput();
- }
- if (!$input->isInteractive()) {
- return $question->getDefault();
- }
- if (!$question->getValidator()) {
- return $this->doAsk($output, $question);
- }
- $that = $this;
- $interviewer = function () use ($output, $question, $that) {
- return $that->doAsk($output, $question);
- };
- return $this->validateAttempts($interviewer, $output, $question);
- }
- public function setInputStream($stream)
- {
- if (!is_resource($stream)) {
- throw new InvalidArgumentException('Input stream must be a valid resource.');
- }
- $this->inputStream = $stream;
- }
- public function getInputStream()
- {
- return $this->inputStream;
- }
- public function getName()
- {
- return 'question';
- }
- public function doAsk(OutputInterface $output, Question $question)
- {
- $this->writePrompt($output, $question);
- $inputStream = $this->inputStream ?: STDIN;
- $autocomplete = $question->getAutocompleterValues();
- if (null === $autocomplete || !$this->hasSttyAvailable()) {
- $ret = false;
- if ($question->isHidden()) {
- try {
- $ret = trim($this->getHiddenResponse($output, $inputStream));
- } catch (\RuntimeException $e) {
- if (!$question->isHiddenFallback()) {
- throw $e;
- }
- }
- }
- if (false === $ret) {
- $ret = $this->readFromInput($inputStream);
- }
- } else {
- $ret = trim($this->autocomplete($output, $question, $inputStream));
- }
- $ret = strlen($ret) > 0 ? $ret : $question->getDefault();
- if ($normalizer = $question->getNormalizer()) {
- return $normalizer($ret);
- }
- return $ret;
- }
- protected function writePrompt(OutputInterface $output, Question $question)
- {
- $message = $question->getQuestion();
- if ($question instanceof ChoiceQuestion) {
- $maxWidth = max(array_map(array($this, 'strlen'), array_keys($question->getChoices())));
- $messages = (array) $question->getQuestion();
- foreach ($question->getChoices() as $key => $value) {
- $width = $maxWidth - $this->strlen($key);
- $messages[] = ' [<info>'.$key.str_repeat(' ', $width).'</info>] '.$value;
- }
- $output->writeln($messages);
- $message = $question->getPrompt();
- }
- $output->write($message);
- }
- protected function writeError(OutputInterface $output, \Exception $error)
- {
- if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) {
- $message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error');
- } else {
- $message = '<error>'.$error->getMessage().'</error>';
- }
- $output->writeln($message);
- }
- private function autocomplete(OutputInterface $output, Question $question, $inputStream)
- {
- $autocomplete = $question->getAutocompleterValues();
- $ret = '';
- $i = 0;
- $ofs = -1;
- $matches = $autocomplete;
- $numMatches = count($matches);
- $sttyMode = shell_exec('stty -g');
- shell_exec('stty -icanon -echo');
- $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white'));
- while (!feof($inputStream)) {
- $c = fread($inputStream, 1);
- if ("\177" === $c) {
- if (0 === $numMatches && 0 !== $i) {
- --$i;
- $output->write("\033[1D");
- }
- if ($i === 0) {
- $ofs = -1;
- $matches = $autocomplete;
- $numMatches = count($matches);
- } else {
- $numMatches = 0;
- }
- $ret = substr($ret, 0, $i);
- } elseif ("\033" === $c) {
- $c .= fread($inputStream, 2);
- if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) {
- if ('A' === $c[2] && -1 === $ofs) {
- $ofs = 0;
- }
- if (0 === $numMatches) {
- continue;
- }
- $ofs += ('A' === $c[2]) ? -1 : 1;
- $ofs = ($numMatches + $ofs) % $numMatches;
- }
- } elseif (ord($c) < 32) {
- if ("\t" === $c || "\n" === $c) {
- if ($numMatches > 0 && -1 !== $ofs) {
- $ret = $matches[$ofs];
- $output->write(substr($ret, $i));
- $i = strlen($ret);
- }
- if ("\n" === $c) {
- $output->write($c);
- break;
- }
- $numMatches = 0;
- }
- continue;
- } else {
- $output->write($c);
- $ret .= $c;
- ++$i;
- $numMatches = 0;
- $ofs = 0;
- foreach ($autocomplete as $value) {
- if (0 === strpos($value, $ret) && $i !== strlen($value)) {
- $matches[$numMatches++] = $value;
- }
- }
- }
- $output->write("\033[K");
- if ($numMatches > 0 && -1 !== $ofs) {
- $output->write("\0337");
- $output->write('<hl>'.substr($matches[$ofs], $i).'</hl>');
- $output->write("\0338");
- }
- }
- shell_exec(sprintf('stty %s', $sttyMode));
- return $ret;
- }
- private function getHiddenResponse(OutputInterface $output, $inputStream)
- {
- if ('\\' === DIRECTORY_SEPARATOR) {
- $exe = __DIR__.'/../Resources/bin/hiddeninput.exe';
- if ('phar:' === substr(__FILE__, 0, 5)) {
- $tmpExe = sys_get_temp_dir().'/hiddeninput.exe';
- copy($exe, $tmpExe);
- $exe = $tmpExe;
- }
- $value = rtrim(shell_exec($exe));
- $output->writeln('');
- if (isset($tmpExe)) {
- unlink($tmpExe);
- }
- return $value;
- }
- if ($this->hasSttyAvailable()) {
- $sttyMode = shell_exec('stty -g');
- shell_exec('stty -echo');
- $value = fgets($inputStream, 4096);
- shell_exec(sprintf('stty %s', $sttyMode));
- if (false === $value) {
- throw new RuntimeException('Aborted');
- }
- $value = trim($value);
- $output->writeln('');
- return $value;
- }
- if (false !== $shell = $this->getShell()) {
- $readCmd = $shell === 'csh' ? 'set mypassword = $<' : 'read -r mypassword';
- $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd);
- $value = rtrim(shell_exec($command));
- $output->writeln('');
- return $value;
- }
- throw new RuntimeException('Unable to hide the response.');
- }
- private function validateAttempts($interviewer, OutputInterface $output, Question $question)
- {
- $error = null;
- $attempts = $question->getMaxAttempts();
- while (null === $attempts || $attempts--) {
- if (null !== $error) {
- $this->writeError($output, $error);
- }
- try {
- return call_user_func($question->getValidator(), $interviewer());
- } catch (\Exception $error) {
- }
- }
- throw $error;
- }
- private function getShell()
- {
- if (null !== self::$shell) {
- return self::$shell;
- }
- self::$shell = false;
- if (file_exists('/usr/bin/env')) {
- $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null";
- foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) {
- if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) {
- self::$shell = $sh;
- break;
- }
- }
- }
- return self::$shell;
- }
- private function readFromInput($stream)
- {
- if (STDIN === $stream && function_exists('readline')) {
- $ret = readline('');
- } else {
- $ret = fgets($stream, 4096);
- }
- if (false === $ret) {
- throw new RuntimeException('Aborted');
- }
- return trim($ret);
- }
- private function hasSttyAvailable()
- {
- if (null !== self::$stty) {
- return self::$stty;
- }
- exec('stty 2>&1', $output, $exitcode);
- return self::$stty = $exitcode === 0;
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Exception\LogicException;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Question\ChoiceQuestion;
- use Symfony\Component\Console\Question\ConfirmationQuestion;
- use Symfony\Component\Console\Question\Question;
- use Symfony\Component\Console\Style\SymfonyStyle;
- class SymfonyQuestionHelper extends QuestionHelper
- {
- public function ask(InputInterface $input, OutputInterface $output, Question $question)
- {
- $validator = $question->getValidator();
- $question->setValidator(function ($value) use ($validator) {
- if (null !== $validator) {
- $value = $validator($value);
- }
- if (!is_array($value) && !is_bool($value) && 0 === strlen($value)) {
- throw new LogicException('A value is required.');
- }
- return $value;
- });
- return parent::ask($input, $output, $question);
- }
- protected function writePrompt(OutputInterface $output, Question $question)
- {
- $text = $question->getQuestion();
- $default = $question->getDefault();
- switch (true) {
- case null === $default:
- $text = sprintf(' <info>%s</info>:', $text);
- break;
- case $question instanceof ConfirmationQuestion:
- $text = sprintf(' <info>%s (yes/no)</info> [<comment>%s</comment>]:', $text, $default ? 'yes' : 'no');
- break;
- case $question instanceof ChoiceQuestion:
- $choices = $question->getChoices();
- $text = sprintf(' <info>%s</info> [<comment>%s</comment>]:', $text, $choices[$default]);
- break;
- default:
- $text = sprintf(' <info>%s</info> [<comment>%s</comment>]:', $text, $default);
- }
- $output->writeln($text);
- if ($question instanceof ChoiceQuestion) {
- $width = max(array_map('strlen', array_keys($question->getChoices())));
- foreach ($question->getChoices() as $key => $value) {
- $output->writeln(sprintf(" [<comment>%-${width}s</comment>] %s", $key, $value));
- }
- }
- $output->write(' > ');
- }
- protected function writeError(OutputInterface $output, \Exception $error)
- {
- if ($output instanceof SymfonyStyle) {
- $output->newLine();
- $output->error($error->getMessage());
- return;
- }
- parent::writeError($output, $error);
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- class Table
- {
- private $headers = array();
- private $rows = array();
- private $columnWidths = array();
- private $numberOfColumns;
- private $output;
- private $style;
- private $columnStyles = array();
- private static $styles;
- public function __construct(OutputInterface $output)
- {
- $this->output = $output;
- if (!self::$styles) {
- self::$styles = self::initStyles();
- }
- $this->setStyle('default');
- }
- public static function setStyleDefinition($name, TableStyle $style)
- {
- if (!self::$styles) {
- self::$styles = self::initStyles();
- }
- self::$styles[$name] = $style;
- }
- public static function getStyleDefinition($name)
- {
- if (!self::$styles) {
- self::$styles = self::initStyles();
- }
- if (!self::$styles[$name]) {
- throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name));
- }
- return self::$styles[$name];
- }
- public function setStyle($name)
- {
- if ($name instanceof TableStyle) {
- $this->style = $name;
- } elseif (isset(self::$styles[$name])) {
- $this->style = self::$styles[$name];
- } else {
- throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name));
- }
- return $this;
- }
- public function getStyle()
- {
- return $this->style;
- }
- public function setColumnStyle($columnIndex, $name)
- {
- $columnIndex = intval($columnIndex);
- if ($name instanceof TableStyle) {
- $this->columnStyles[$columnIndex] = $name;
- } elseif (isset(self::$styles[$name])) {
- $this->columnStyles[$columnIndex] = self::$styles[$name];
- } else {
- throw new \InvalidArgumentException(sprintf('Style "%s" is not defined.', $name));
- }
- return $this;
- }
- public function getColumnStyle($columnIndex)
- {
- if (isset($this->columnStyles[$columnIndex])) {
- return $this->columnStyles[$columnIndex];
- }
- return $this->getStyle();
- }
- public function setHeaders(array $headers)
- {
- $headers = array_values($headers);
- if (!empty($headers) && !is_array($headers[0])) {
- $headers = array($headers);
- }
- $this->headers = $headers;
- return $this;
- }
- public function setRows(array $rows)
- {
- $this->rows = array();
- return $this->addRows($rows);
- }
- public function addRows(array $rows)
- {
- foreach ($rows as $row) {
- $this->addRow($row);
- }
- return $this;
- }
- public function addRow($row)
- {
- if ($row instanceof TableSeparator) {
- $this->rows[] = $row;
- return $this;
- }
- if (!is_array($row)) {
- throw new InvalidArgumentException('A row must be an array or a TableSeparator instance.');
- }
- $this->rows[] = array_values($row);
- return $this;
- }
- public function setRow($column, array $row)
- {
- $this->rows[$column] = $row;
- return $this;
- }
- public function render()
- {
- $this->calculateNumberOfColumns();
- $rows = $this->buildTableRows($this->rows);
- $headers = $this->buildTableRows($this->headers);
- $this->calculateColumnsWidth(array_merge($headers, $rows));
- $this->renderRowSeparator();
- if (!empty($headers)) {
- foreach ($headers as $header) {
- $this->renderRow($header, $this->style->getCellHeaderFormat());
- $this->renderRowSeparator();
- }
- }
- foreach ($rows as $row) {
- if ($row instanceof TableSeparator) {
- $this->renderRowSeparator();
- } else {
- $this->renderRow($row, $this->style->getCellRowFormat());
- }
- }
- if (!empty($rows)) {
- $this->renderRowSeparator();
- }
- $this->cleanup();
- }
- private function renderRowSeparator()
- {
- if (0 === $count = $this->numberOfColumns) {
- return;
- }
- if (!$this->style->getHorizontalBorderChar() && !$this->style->getCrossingChar()) {
- return;
- }
- $markup = $this->style->getCrossingChar();
- for ($column = 0; $column < $count; ++$column) {
- $markup .= str_repeat($this->style->getHorizontalBorderChar(), $this->columnWidths[$column]).$this->style->getCrossingChar();
- }
- $this->output->writeln(sprintf($this->style->getBorderFormat(), $markup));
- }
- private function renderColumnSeparator()
- {
- $this->output->write(sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar()));
- }
- private function renderRow(array $row, $cellFormat)
- {
- if (empty($row)) {
- return;
- }
- $this->renderColumnSeparator();
- foreach ($this->getRowColumns($row) as $column) {
- $this->renderCell($row, $column, $cellFormat);
- $this->renderColumnSeparator();
- }
- $this->output->writeln('');
- }
- private function renderCell(array $row, $column, $cellFormat)
- {
- $cell = isset($row[$column]) ? $row[$column] : '';
- $width = $this->columnWidths[$column];
- if ($cell instanceof TableCell && $cell->getColspan() > 1) {
- foreach (range($column + 1, $column + $cell->getColspan() - 1) as $nextColumn) {
- $width += $this->getColumnSeparatorWidth() + $this->columnWidths[$nextColumn];
- }
- }
- if (false !== $encoding = mb_detect_encoding($cell, null, true)) {
- $width += strlen($cell) - mb_strwidth($cell, $encoding);
- }
- $style = $this->getColumnStyle($column);
- if ($cell instanceof TableSeparator) {
- $this->output->write(sprintf($style->getBorderFormat(), str_repeat($style->getHorizontalBorderChar(), $width)));
- } else {
- $width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
- $content = sprintf($style->getCellRowContentFormat(), $cell);
- $this->output->write(sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $style->getPadType())));
- }
- }
- private function calculateNumberOfColumns()
- {
- if (null !== $this->numberOfColumns) {
- return;
- }
- $columns = array(0);
- foreach (array_merge($this->headers, $this->rows) as $row) {
- if ($row instanceof TableSeparator) {
- continue;
- }
- $columns[] = $this->getNumberOfColumns($row);
- }
- $this->numberOfColumns = max($columns);
- }
- private function buildTableRows($rows)
- {
- $unmergedRows = array();
- for ($rowKey = 0; $rowKey < count($rows); ++$rowKey) {
- $rows = $this->fillNextRows($rows, $rowKey);
- foreach ($rows[$rowKey] as $column => $cell) {
- if (!strstr($cell, "\n")) {
- continue;
- }
- $lines = explode("\n", $cell);
- foreach ($lines as $lineKey => $line) {
- if ($cell instanceof TableCell) {
- $line = new TableCell($line, array('colspan' => $cell->getColspan()));
- }
- if (0 === $lineKey) {
- $rows[$rowKey][$column] = $line;
- } else {
- $unmergedRows[$rowKey][$lineKey][$column] = $line;
- }
- }
- }
- }
- $tableRows = array();
- foreach ($rows as $rowKey => $row) {
- $tableRows[] = $this->fillCells($row);
- if (isset($unmergedRows[$rowKey])) {
- $tableRows = array_merge($tableRows, $unmergedRows[$rowKey]);
- }
- }
- return $tableRows;
- }
- private function fillNextRows($rows, $line)
- {
- $unmergedRows = array();
- foreach ($rows[$line] as $column => $cell) {
- if ($cell instanceof TableCell && $cell->getRowspan() > 1) {
- $nbLines = $cell->getRowspan() - 1;
- $lines = array($cell);
- if (strstr($cell, "\n")) {
- $lines = explode("\n", $cell);
- $nbLines = count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines;
- $rows[$line][$column] = new TableCell($lines[0], array('colspan' => $cell->getColspan()));
- unset($lines[0]);
- }
- $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, ''), $unmergedRows);
- foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) {
- $value = isset($lines[$unmergedRowKey - $line]) ? $lines[$unmergedRowKey - $line] : '';
- $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, array('colspan' => $cell->getColspan()));
- }
- }
- }
- foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) {
- if (isset($rows[$unmergedRowKey]) && is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRows[$unmergedRowKey]) <= $this->numberOfColumns)) {
- foreach ($unmergedRow as $cellKey => $cell) {
- array_splice($rows[$unmergedRowKey], $cellKey, 0, array($cell));
- }
- } else {
- $row = $this->copyRow($rows, $unmergedRowKey - 1);
- foreach ($unmergedRow as $column => $cell) {
- if (!empty($cell)) {
- $row[$column] = $unmergedRow[$column];
- }
- }
- array_splice($rows, $unmergedRowKey, 0, array($row));
- }
- }
- return $rows;
- }
- private function fillCells($row)
- {
- $newRow = array();
- foreach ($row as $column => $cell) {
- $newRow[] = $cell;
- if ($cell instanceof TableCell && $cell->getColspan() > 1) {
- foreach (range($column + 1, $column + $cell->getColspan() - 1) as $position) {
- $newRow[] = '';
- }
- }
- }
- return $newRow ?: $row;
- }
- private function copyRow($rows, $line)
- {
- $row = $rows[$line];
- foreach ($row as $cellKey => $cellValue) {
- $row[$cellKey] = '';
- if ($cellValue instanceof TableCell) {
- $row[$cellKey] = new TableCell('', array('colspan' => $cellValue->getColspan()));
- }
- }
- return $row;
- }
- private function getNumberOfColumns(array $row)
- {
- $columns = count($row);
- foreach ($row as $column) {
- $columns += $column instanceof TableCell ? ($column->getColspan() - 1) : 0;
- }
- return $columns;
- }
- private function getRowColumns($row)
- {
- $columns = range(0, $this->numberOfColumns - 1);
- foreach ($row as $cellKey => $cell) {
- if ($cell instanceof TableCell && $cell->getColspan() > 1) {
- $columns = array_diff($columns, range($cellKey + 1, $cellKey + $cell->getColspan() - 1));
- }
- }
- return $columns;
- }
- private function calculateColumnsWidth($rows)
- {
- for ($column = 0; $column < $this->numberOfColumns; ++$column) {
- $lengths = array();
- foreach ($rows as $row) {
- if ($row instanceof TableSeparator) {
- continue;
- }
- $lengths[] = $this->getCellWidth($row, $column);
- }
- $this->columnWidths[$column] = max($lengths) + strlen($this->style->getCellRowContentFormat()) - 2;
- }
- }
- private function getColumnSeparatorWidth()
- {
- return strlen(sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar()));
- }
- private function getCellWidth(array $row, $column)
- {
- if (isset($row[$column])) {
- $cell = $row[$column];
- $cellWidth = Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
- if ($cell instanceof TableCell && $cell->getColspan() > 1) {
- $cellWidth = $cellWidth / $cell->getColspan();
- }
- return $cellWidth;
- }
- return 0;
- }
- private function cleanup()
- {
- $this->columnWidths = array();
- $this->numberOfColumns = null;
- }
- private static function initStyles()
- {
- $borderless = new TableStyle();
- $borderless
- ->setHorizontalBorderChar('=')
- ->setVerticalBorderChar(' ')
- ->setCrossingChar(' ')
- ;
- $compact = new TableStyle();
- $compact
- ->setHorizontalBorderChar('')
- ->setVerticalBorderChar(' ')
- ->setCrossingChar('')
- ->setCellRowContentFormat('%s')
- ;
- $styleGuide = new TableStyle();
- $styleGuide
- ->setHorizontalBorderChar('-')
- ->setVerticalBorderChar(' ')
- ->setCrossingChar(' ')
- ->setCellHeaderFormat('%s')
- ;
- return array(
- 'default' => new TableStyle(),
- 'borderless' => $borderless,
- 'compact' => $compact,
- 'symfony-style-guide' => $styleGuide,
- );
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- class TableCell
- {
- private $value;
- private $options = array(
- 'rowspan' => 1,
- 'colspan' => 1,
- );
- public function __construct($value = '', array $options = array())
- {
- $this->value = $value;
- if ($diff = array_diff(array_keys($options), array_keys($this->options))) {
- throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff)));
- }
- $this->options = array_merge($this->options, $options);
- }
- public function __toString()
- {
- return $this->value;
- }
- public function getColspan()
- {
- return (int) $this->options['colspan'];
- }
- public function getRowspan()
- {
- return (int) $this->options['rowspan'];
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Output\NullOutput;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- class TableHelper extends Helper
- {
- const LAYOUT_DEFAULT = 0;
- const LAYOUT_BORDERLESS = 1;
- const LAYOUT_COMPACT = 2;
- private $table;
- public function __construct($triggerDeprecationError = true)
- {
- if ($triggerDeprecationError) {
- @trigger_error('The '.__CLASS__.' class is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\Console\Helper\Table class instead.', E_USER_DEPRECATED);
- }
- $this->table = new Table(new NullOutput());
- }
- public function setLayout($layout)
- {
- switch ($layout) {
- case self::LAYOUT_BORDERLESS:
- $this->table->setStyle('borderless');
- break;
- case self::LAYOUT_COMPACT:
- $this->table->setStyle('compact');
- break;
- case self::LAYOUT_DEFAULT:
- $this->table->setStyle('default');
- break;
- default:
- throw new InvalidArgumentException(sprintf('Invalid table layout "%s".', $layout));
- }
- return $this;
- }
- public function setHeaders(array $headers)
- {
- $this->table->setHeaders($headers);
- return $this;
- }
- public function setRows(array $rows)
- {
- $this->table->setRows($rows);
- return $this;
- }
- public function addRows(array $rows)
- {
- $this->table->addRows($rows);
- return $this;
- }
- public function addRow(array $row)
- {
- $this->table->addRow($row);
- return $this;
- }
- public function setRow($column, array $row)
- {
- $this->table->setRow($column, $row);
- return $this;
- }
- public function setPaddingChar($paddingChar)
- {
- $this->table->getStyle()->setPaddingChar($paddingChar);
- return $this;
- }
- public function setHorizontalBorderChar($horizontalBorderChar)
- {
- $this->table->getStyle()->setHorizontalBorderChar($horizontalBorderChar);
- return $this;
- }
- public function setVerticalBorderChar($verticalBorderChar)
- {
- $this->table->getStyle()->setVerticalBorderChar($verticalBorderChar);
- return $this;
- }
- public function setCrossingChar($crossingChar)
- {
- $this->table->getStyle()->setCrossingChar($crossingChar);
- return $this;
- }
- public function setCellHeaderFormat($cellHeaderFormat)
- {
- $this->table->getStyle()->setCellHeaderFormat($cellHeaderFormat);
- return $this;
- }
- public function setCellRowFormat($cellRowFormat)
- {
- $this->table->getStyle()->setCellHeaderFormat($cellRowFormat);
- return $this;
- }
- public function setCellRowContentFormat($cellRowContentFormat)
- {
- $this->table->getStyle()->setCellRowContentFormat($cellRowContentFormat);
- return $this;
- }
- public function setBorderFormat($borderFormat)
- {
- $this->table->getStyle()->setBorderFormat($borderFormat);
- return $this;
- }
- public function setPadType($padType)
- {
- $this->table->getStyle()->setPadType($padType);
- return $this;
- }
- public function render(OutputInterface $output)
- {
- $p = new \ReflectionProperty($this->table, 'output');
- $p->setAccessible(true);
- $p->setValue($this->table, $output);
- $this->table->render();
- }
- public function getName()
- {
- return 'table';
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- class TableSeparator extends TableCell
- {
- public function __construct(array $options = array())
- {
- parent::__construct('', $options);
- }
- }
- <?php
- namespace Symfony\Component\Console\Helper;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- use Symfony\Component\Console\Exception\LogicException;
- class TableStyle
- {
- private $paddingChar = ' ';
- private $horizontalBorderChar = '-';
- private $verticalBorderChar = '|';
- private $crossingChar = '+';
- private $cellHeaderFormat = '<info>%s</info>';
- private $cellRowFormat = '%s';
- private $cellRowContentFormat = ' %s ';
- private $borderFormat = '%s';
- private $padType = STR_PAD_RIGHT;
- public function setPaddingChar($paddingChar)
- {
- if (!$paddingChar) {
- throw new LogicException('The padding char must not be empty');
- }
- $this->paddingChar = $paddingChar;
- return $this;
- }
- public function getPaddingChar()
- {
- return $this->paddingChar;
- }
- public function setHorizontalBorderChar($horizontalBorderChar)
- {
- $this->horizontalBorderChar = $horizontalBorderChar;
- return $this;
- }
- public function getHorizontalBorderChar()
- {
- return $this->horizontalBorderChar;
- }
- public function setVerticalBorderChar($verticalBorderChar)
- {
- $this->verticalBorderChar = $verticalBorderChar;
- return $this;
- }
- public function getVerticalBorderChar()
- {
- return $this->verticalBorderChar;
- }
- public function setCrossingChar($crossingChar)
- {
- $this->crossingChar = $crossingChar;
- return $this;
- }
- public function getCrossingChar()
- {
- return $this->crossingChar;
- }
- public function setCellHeaderFormat($cellHeaderFormat)
- {
- $this->cellHeaderFormat = $cellHeaderFormat;
- return $this;
- }
- public function getCellHeaderFormat()
- {
- return $this->cellHeaderFormat;
- }
- public function setCellRowFormat($cellRowFormat)
- {
- $this->cellRowFormat = $cellRowFormat;
- return $this;
- }
- public function getCellRowFormat()
- {
- return $this->cellRowFormat;
- }
- public function setCellRowContentFormat($cellRowContentFormat)
- {
- $this->cellRowContentFormat = $cellRowContentFormat;
- return $this;
- }
- public function getCellRowContentFormat()
- {
- return $this->cellRowContentFormat;
- }
- public function setBorderFormat($borderFormat)
- {
- $this->borderFormat = $borderFormat;
- return $this;
- }
- public function getBorderFormat()
- {
- return $this->borderFormat;
- }
- public function setPadType($padType)
- {
- if (!in_array($padType, array(STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH), true)) {
- throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).');
- }
- $this->padType = $padType;
- return $this;
- }
- public function getPadType()
- {
- return $this->padType;
- }
- }
- <?php
- namespace Symfony\Component\Console\Input;
- use Symfony\Component\Console\Exception\RuntimeException;
- class ArgvInput extends Input
- {
- private $tokens;
- private $parsed;
- public function __construct(array $argv = null, InputDefinition $definition = null)
- {
- if (null === $argv) {
- $argv = $_SERVER['argv'];
- }
- array_shift($argv);
- $this->tokens = $argv;
- parent::__construct($definition);
- }
- protected function setTokens(array $tokens)
- {
- $this->tokens = $tokens;
- }
- 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);
- }
- }
- }
- private function parseShortOption($token)
- {
- $name = substr($token, 1);
- if (strlen($name) > 1) {
- if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) {
- $this->addShortOption($name[0], substr($name, 1));
- } else {
- $this->parseShortOptionSet($name);
- }
- } else {
- $this->addShortOption($name, null);
- }
- }
- 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);
- }
- }
- }
- 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);
- }
- }
- private function parseArgument($token)
- {
- $c = count($this->arguments);
- if ($this->definition->hasArgument($c)) {
- $arg = $this->definition->getArgument($c);
- $this->arguments[$arg->getName()] = $arg->isArray() ? array($token) : $token;
- } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) {
- $arg = $this->definition->getArgument($c - 1);
- $this->arguments[$arg->getName()][] = $token;
- } else {
- throw new RuntimeException('Too many arguments.');
- }
- }
- 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);
- }
- 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);
- 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)) {
-
- $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;
- }
- }
- public function getFirstArgument()
- {
- foreach ($this->tokens as $token) {
- if ($token && '-' === $token[0]) {
- continue;
- }
- return $token;
- }
- }
- 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;
- }
- 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;
- }
- 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);
- }
- }
- <?php
- namespace Symfony\Component\Console\Input;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- use Symfony\Component\Console\Exception\InvalidOptionException;
- class ArrayInput extends Input
- {
- private $parameters;
- public function __construct(array $parameters, InputDefinition $definition = null)
- {
- $this->parameters = $parameters;
- parent::__construct($definition);
- }
- public function getFirstArgument()
- {
- foreach ($this->parameters as $key => $value) {
- if ($key && '-' === $key[0]) {
- continue;
- }
- return $value;
- }
- }
- 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;
- }
- 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;
- }
- 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);
- }
- 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);
- }
- }
- }
- 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);
- }
- 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;
- }
- 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;
- }
- }
- <?php
- namespace Symfony\Component\Console\Input;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- use Symfony\Component\Console\Exception\RuntimeException;
- abstract class Input implements InputInterface
- {
- protected $definition;
- protected $options = array();
- protected $arguments = array();
- protected $interactive = true;
- public function __construct(InputDefinition $definition = null)
- {
- if (null === $definition) {
- $this->definition = new InputDefinition();
- } else {
- $this->bind($definition);
- $this->validate();
- }
- }
- public function bind(InputDefinition $definition)
- {
- $this->arguments = array();
- $this->options = array();
- $this->definition = $definition;
- $this->parse();
- }
- abstract protected function parse();
- 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)));
- }
- }
- public function isInteractive()
- {
- return $this->interactive;
- }
- public function setInteractive($interactive)
- {
- $this->interactive = (bool) $interactive;
- }
- public function getArguments()
- {
- return array_merge($this->definition->getArgumentDefaults(), $this->arguments);
- }
- 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();
- }
- 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;
- }
- public function hasArgument($name)
- {
- return $this->definition->hasArgument($name);
- }
- public function getOptions()
- {
- return array_merge($this->definition->getOptionDefaults(), $this->options);
- }
- 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();
- }
- 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;
- }
- public function hasOption($name)
- {
- return $this->definition->hasOption($name);
- }
- public function escapeToken($token)
- {
- return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token);
- }
- }
- <?php
- namespace Symfony\Component\Console\Input;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- use Symfony\Component\Console\Exception\LogicException;
- class InputArgument
- {
- const REQUIRED = 1;
- const OPTIONAL = 2;
- const IS_ARRAY = 4;
- private $name;
- private $mode;
- private $default;
- private $description;
- 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);
- }
- public function getName()
- {
- return $this->name;
- }
- public function isRequired()
- {
- return self::REQUIRED === (self::REQUIRED & $this->mode);
- }
- public function isArray()
- {
- return self::IS_ARRAY === (self::IS_ARRAY & $this->mode);
- }
- 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;
- }
- public function getDefault()
- {
- return $this->default;
- }
- public function getDescription()
- {
- return $this->description;
- }
- }
- <?php
- namespace Symfony\Component\Console\Input;
- interface InputAwareInterface
- {
- public function setInput(InputInterface $input);
- }
- <?php
- 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;
- class InputDefinition
- {
- private $arguments;
- private $requiredCount;
- private $hasAnArrayArgument = false;
- private $hasOptional;
- private $options;
- private $shortcuts;
- public function __construct(array $definition = array())
- {
- $this->setDefinition($definition);
- }
- 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);
- }
- public function setArguments($arguments = array())
- {
- $this->arguments = array();
- $this->requiredCount = 0;
- $this->hasOptional = false;
- $this->hasAnArrayArgument = false;
- $this->addArguments($arguments);
- }
- public function addArguments($arguments = array())
- {
- if (null !== $arguments) {
- foreach ($arguments as $argument) {
- $this->addArgument($argument);
- }
- }
- }
- 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;
- }
- 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];
- }
- public function hasArgument($name)
- {
- $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments;
- return isset($arguments[$name]);
- }
- public function getArguments()
- {
- return $this->arguments;
- }
- public function getArgumentCount()
- {
- return $this->hasAnArrayArgument ? PHP_INT_MAX : count($this->arguments);
- }
- public function getArgumentRequiredCount()
- {
- return $this->requiredCount;
- }
- public function getArgumentDefaults()
- {
- $values = array();
- foreach ($this->arguments as $argument) {
- $values[$argument->getName()] = $argument->getDefault();
- }
- return $values;
- }
- public function setOptions($options = array())
- {
- $this->options = array();
- $this->shortcuts = array();
- $this->addOptions($options);
- }
- public function addOptions($options = array())
- {
- foreach ($options as $option) {
- $this->addOption($option);
- }
- }
- 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();
- }
- }
- }
- public function getOption($name)
- {
- if (!$this->hasOption($name)) {
- throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name));
- }
- return $this->options[$name];
- }
- public function hasOption($name)
- {
- return isset($this->options[$name]);
- }
- public function getOptions()
- {
- return $this->options;
- }
- public function hasShortcut($name)
- {
- return isset($this->shortcuts[$name]);
- }
- public function getOptionForShortcut($shortcut)
- {
- return $this->getOption($this->shortcutToName($shortcut));
- }
- public function getOptionDefaults()
- {
- $values = array();
- foreach ($this->options as $option) {
- $values[$option->getName()] = $option->getDefault();
- }
- return $values;
- }
- private function shortcutToName($shortcut)
- {
- if (!isset($this->shortcuts[$shortcut])) {
- throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut));
- }
- return $this->shortcuts[$shortcut];
- }
- 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);
- }
- 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();
- }
- 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();
- }
- }
- <?php
- namespace Symfony\Component\Console\Input;
- interface InputInterface
- {
- public function getFirstArgument();
- public function hasParameterOption($values);
- public function getParameterOption($values, $default = false);
- public function bind(InputDefinition $definition);
- public function validate();
- public function getArguments();
- public function getArgument($name);
- public function setArgument($name, $value);
- public function hasArgument($name);
- public function getOptions();
- public function getOption($name);
- public function setOption($name, $value);
- public function hasOption($name);
- public function isInteractive();
- public function setInteractive($interactive);
- }
- <?php
- namespace Symfony\Component\Console\Input;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- use Symfony\Component\Console\Exception\LogicException;
- 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;
- 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);
- }
- public function getShortcut()
- {
- return $this->shortcut;
- }
- public function getName()
- {
- return $this->name;
- }
- public function acceptValue()
- {
- return $this->isValueRequired() || $this->isValueOptional();
- }
- public function isValueRequired()
- {
- return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode);
- }
- public function isValueOptional()
- {
- return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode);
- }
- public function isArray()
- {
- return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode);
- }
- 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;
- }
- public function getDefault()
- {
- return $this->default;
- }
- public function getDescription()
- {
- return $this->description;
- }
- 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()
- ;
- }
- }
- <?php
- namespace Symfony\Component\Console\Input;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- class StringInput extends ArgvInput
- {
- const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
- const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
- 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);
- }
- }
- 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 {
- throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10)));
- }
- $cursor += strlen($match[0]);
- }
- return $tokens;
- }
- }
- Copyright (c) 2004-2016 Fabien Potencier
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is furnished
- to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- <?php
- namespace Symfony\Component\Console\Logger;
- use Psr\Log\AbstractLogger;
- use Psr\Log\InvalidArgumentException;
- use Psr\Log\LogLevel;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Output\ConsoleOutputInterface;
- class ConsoleLogger extends AbstractLogger
- {
- const INFO = 'info';
- const ERROR = 'error';
- private $output;
- private $verbosityLevelMap = array(
- LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE,
- LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE,
- LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG,
- );
- private $formatLevelMap = array(
- LogLevel::EMERGENCY => self::ERROR,
- LogLevel::ALERT => self::ERROR,
- LogLevel::CRITICAL => self::ERROR,
- LogLevel::ERROR => self::ERROR,
- LogLevel::WARNING => self::INFO,
- LogLevel::NOTICE => self::INFO,
- LogLevel::INFO => self::INFO,
- LogLevel::DEBUG => self::INFO,
- );
- public function __construct(OutputInterface $output, array $verbosityLevelMap = array(), array $formatLevelMap = array())
- {
- $this->output = $output;
- $this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap;
- $this->formatLevelMap = $formatLevelMap + $this->formatLevelMap;
- }
- public function log($level, $message, array $context = array())
- {
- if (!isset($this->verbosityLevelMap[$level])) {
- throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level));
- }
- if ($this->formatLevelMap[$level] === self::ERROR && $this->output instanceof ConsoleOutputInterface) {
- $output = $this->output->getErrorOutput();
- } else {
- $output = $this->output;
- }
- if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) {
- $output->writeln(sprintf('<%1$s>[%2$s] %3$s</%1$s>', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)));
- }
- }
- private function interpolate($message, array $context)
- {
- $replace = array();
- foreach ($context as $key => $val) {
- if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) {
- $replace[sprintf('{%s}', $key)] = $val;
- }
- }
- return strtr($message, $replace);
- }
- }
- <?php
- namespace Symfony\Component\Console\Output;
- class BufferedOutput extends Output
- {
- private $buffer = '';
- public function fetch()
- {
- $content = $this->buffer;
- $this->buffer = '';
- return $content;
- }
- protected function doWrite($message, $newline)
- {
- $this->buffer .= $message;
- if ($newline) {
- $this->buffer .= "\n";
- }
- }
- }
- <?php
- namespace Symfony\Component\Console\Output;
- use Symfony\Component\Console\Formatter\OutputFormatterInterface;
- class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
- {
- private $stderr;
- public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
- {
- parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter);
- $actualDecorated = $this->isDecorated();
- $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter());
- if (null === $decorated) {
- $this->setDecorated($actualDecorated && $this->stderr->isDecorated());
- }
- }
- public function setDecorated($decorated)
- {
- parent::setDecorated($decorated);
- $this->stderr->setDecorated($decorated);
- }
- public function setFormatter(OutputFormatterInterface $formatter)
- {
- parent::setFormatter($formatter);
- $this->stderr->setFormatter($formatter);
- }
- public function setVerbosity($level)
- {
- parent::setVerbosity($level);
- $this->stderr->setVerbosity($level);
- }
- public function getErrorOutput()
- {
- return $this->stderr;
- }
- public function setErrorOutput(OutputInterface $error)
- {
- $this->stderr = $error;
- }
- protected function hasStdoutSupport()
- {
- return false === $this->isRunningOS400();
- }
- protected function hasStderrSupport()
- {
- return false === $this->isRunningOS400();
- }
- private function isRunningOS400()
- {
- $checks = array(
- function_exists('php_uname') ? php_uname('s') : '',
- getenv('OSTYPE'),
- PHP_OS,
- );
- return false !== stripos(implode(';', $checks), 'OS400');
- }
- private function openOutputStream()
- {
- $outputStream = $this->hasStdoutSupport() ? 'php://stdout' : 'php://output';
- return @fopen($outputStream, 'w') ?: fopen('php://output', 'w');
- }
- private function openErrorStream()
- {
- $errorStream = $this->hasStderrSupport() ? 'php://stderr' : 'php://output';
- return fopen($errorStream, 'w');
- }
- }
- <?php
- namespace Symfony\Component\Console\Output;
- interface ConsoleOutputInterface extends OutputInterface
- {
- public function getErrorOutput();
- public function setErrorOutput(OutputInterface $error);
- }
- <?php
- namespace Symfony\Component\Console\Output;
- use Symfony\Component\Console\Formatter\OutputFormatter;
- use Symfony\Component\Console\Formatter\OutputFormatterInterface;
- class NullOutput implements OutputInterface
- {
- public function setFormatter(OutputFormatterInterface $formatter)
- {
- }
- public function getFormatter()
- {
- return new OutputFormatter();
- }
- public function setDecorated($decorated)
- {
- }
- public function isDecorated()
- {
- return false;
- }
- public function setVerbosity($level)
- {
- }
- public function getVerbosity()
- {
- return self::VERBOSITY_QUIET;
- }
- public function isQuiet()
- {
- return true;
- }
- public function isVerbose()
- {
- return false;
- }
- public function isVeryVerbose()
- {
- return false;
- }
- public function isDebug()
- {
- return false;
- }
- public function writeln($messages, $options = self::OUTPUT_NORMAL)
- {
- }
- public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL)
- {
- }
- }
- <?php
- namespace Symfony\Component\Console\Output;
- use Symfony\Component\Console\Formatter\OutputFormatterInterface;
- use Symfony\Component\Console\Formatter\OutputFormatter;
- abstract class Output implements OutputInterface
- {
- private $verbosity;
- private $formatter;
- public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = false, OutputFormatterInterface $formatter = null)
- {
- $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
- $this->formatter = $formatter ?: new OutputFormatter();
- $this->formatter->setDecorated($decorated);
- }
- public function setFormatter(OutputFormatterInterface $formatter)
- {
- $this->formatter = $formatter;
- }
- public function getFormatter()
- {
- return $this->formatter;
- }
- public function setDecorated($decorated)
- {
- $this->formatter->setDecorated($decorated);
- }
- public function isDecorated()
- {
- return $this->formatter->isDecorated();
- }
- public function setVerbosity($level)
- {
- $this->verbosity = (int) $level;
- }
- public function getVerbosity()
- {
- return $this->verbosity;
- }
- public function isQuiet()
- {
- return self::VERBOSITY_QUIET === $this->verbosity;
- }
- public function isVerbose()
- {
- return self::VERBOSITY_VERBOSE <= $this->verbosity;
- }
- public function isVeryVerbose()
- {
- return self::VERBOSITY_VERY_VERBOSE <= $this->verbosity;
- }
- public function isDebug()
- {
- return self::VERBOSITY_DEBUG <= $this->verbosity;
- }
- public function writeln($messages, $options = self::OUTPUT_NORMAL)
- {
- $this->write($messages, true, $options);
- }
- public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL)
- {
- $messages = (array) $messages;
- $types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN;
- $type = $types & $options ?: self::OUTPUT_NORMAL;
- $verbosities = self::VERBOSITY_QUIET | self::VERBOSITY_NORMAL | self::VERBOSITY_VERBOSE | self::VERBOSITY_VERY_VERBOSE | self::VERBOSITY_DEBUG;
- $verbosity = $verbosities & $options ?: self::VERBOSITY_NORMAL;
- if ($verbosity > $this->getVerbosity()) {
- return;
- }
- foreach ($messages as $message) {
- switch ($type) {
- case OutputInterface::OUTPUT_NORMAL:
- $message = $this->formatter->format($message);
- break;
- case OutputInterface::OUTPUT_RAW:
- break;
- case OutputInterface::OUTPUT_PLAIN:
- $message = strip_tags($this->formatter->format($message));
- break;
- }
- $this->doWrite($message, $newline);
- }
- }
- abstract protected function doWrite($message, $newline);
- }
- <?php
- namespace Symfony\Component\Console\Output;
- use Symfony\Component\Console\Formatter\OutputFormatterInterface;
- interface OutputInterface
- {
- const VERBOSITY_QUIET = 16;
- const VERBOSITY_NORMAL = 32;
- const VERBOSITY_VERBOSE = 64;
- const VERBOSITY_VERY_VERBOSE = 128;
- const VERBOSITY_DEBUG = 256;
- const OUTPUT_NORMAL = 1;
- const OUTPUT_RAW = 2;
- const OUTPUT_PLAIN = 4;
- public function write($messages, $newline = false, $options = 0);
- public function writeln($messages, $options = 0);
- public function setVerbosity($level);
- public function getVerbosity();
- public function setDecorated($decorated);
- public function isDecorated();
- public function setFormatter(OutputFormatterInterface $formatter);
- public function getFormatter();
- }
- <?php
- namespace Symfony\Component\Console\Output;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- use Symfony\Component\Console\Exception\RuntimeException;
- use Symfony\Component\Console\Formatter\OutputFormatterInterface;
- class StreamOutput extends Output
- {
- private $stream;
- public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
- {
- if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) {
- throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.');
- }
- $this->stream = $stream;
- if (null === $decorated) {
- $decorated = $this->hasColorSupport();
- }
- parent::__construct($verbosity, $decorated, $formatter);
- }
- public function getStream()
- {
- return $this->stream;
- }
- protected function doWrite($message, $newline)
- {
- if (false === @fwrite($this->stream, $message.($newline ? PHP_EOL : ''))) {
- throw new RuntimeException('Unable to write output.');
- }
- fflush($this->stream);
- }
- protected function hasColorSupport()
- {
- if (DIRECTORY_SEPARATOR === '\\') {
- return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
- }
- return function_exists('posix_isatty') && @posix_isatty($this->stream);
- }
- }
- <?php
- namespace Symfony\Component\Console\Question;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- class ChoiceQuestion extends Question
- {
- private $choices;
- private $multiselect = false;
- private $prompt = ' > ';
- private $errorMessage = 'Value "%s" is invalid';
- public function __construct($question, array $choices, $default = null)
- {
- parent::__construct($question, $default);
- $this->choices = $choices;
- $this->setValidator($this->getDefaultValidator());
- $this->setAutocompleterValues($choices);
- }
- public function getChoices()
- {
- return $this->choices;
- }
- public function setMultiselect($multiselect)
- {
- $this->multiselect = $multiselect;
- $this->setValidator($this->getDefaultValidator());
- return $this;
- }
- public function getPrompt()
- {
- return $this->prompt;
- }
- public function setPrompt($prompt)
- {
- $this->prompt = $prompt;
- return $this;
- }
- public function setErrorMessage($errorMessage)
- {
- $this->errorMessage = $errorMessage;
- $this->setValidator($this->getDefaultValidator());
- return $this;
- }
- private function getDefaultValidator()
- {
- $choices = $this->choices;
- $errorMessage = $this->errorMessage;
- $multiselect = $this->multiselect;
- $isAssoc = $this->isAssoc($choices);
- return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) {
- $selectedChoices = str_replace(' ', '', $selected);
- if ($multiselect) {
- if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) {
- throw new InvalidArgumentException(sprintf($errorMessage, $selected));
- }
- $selectedChoices = explode(',', $selectedChoices);
- } else {
- $selectedChoices = array($selected);
- }
- $multiselectChoices = array();
- foreach ($selectedChoices as $value) {
- $results = array();
- foreach ($choices as $key => $choice) {
- if ($choice === $value) {
- $results[] = $key;
- }
- }
- if (count($results) > 1) {
- throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of %s.', implode(' or ', $results)));
- }
- $result = array_search($value, $choices);
- if (!$isAssoc) {
- if (false !== $result) {
- $result = $choices[$result];
- } elseif (isset($choices[$value])) {
- $result = $choices[$value];
- }
- } elseif (false === $result && isset($choices[$value])) {
- $result = $value;
- }
- if (false === $result) {
- throw new InvalidArgumentException(sprintf($errorMessage, $value));
- }
- $multiselectChoices[] = (string) $result;
- }
- if ($multiselect) {
- return $multiselectChoices;
- }
- return current($multiselectChoices);
- };
- }
- }
- <?php
- namespace Symfony\Component\Console\Question;
- class ConfirmationQuestion extends Question
- {
- private $trueAnswerRegex;
- public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i')
- {
- parent::__construct($question, (bool) $default);
- $this->trueAnswerRegex = $trueAnswerRegex;
- $this->setNormalizer($this->getDefaultNormalizer());
- }
- private function getDefaultNormalizer()
- {
- $default = $this->getDefault();
- $regex = $this->trueAnswerRegex;
- return function ($answer) use ($default, $regex) {
- if (is_bool($answer)) {
- return $answer;
- }
- $answerIsTrue = (bool) preg_match($regex, $answer);
- if (false === $default) {
- return $answer && $answerIsTrue;
- }
- return !$answer || $answerIsTrue;
- };
- }
- }
- <?php
- namespace Symfony\Component\Console\Question;
- use Symfony\Component\Console\Exception\InvalidArgumentException;
- use Symfony\Component\Console\Exception\LogicException;
- class Question
- {
- private $question;
- private $attempts;
- private $hidden = false;
- private $hiddenFallback = true;
- private $autocompleterValues;
- private $validator;
- private $default;
- private $normalizer;
- public function __construct($question, $default = null)
- {
- $this->question = $question;
- $this->default = $default;
- }
- public function getQuestion()
- {
- return $this->question;
- }
- public function getDefault()
- {
- return $this->default;
- }
- public function isHidden()
- {
- return $this->hidden;
- }
- public function setHidden($hidden)
- {
- if ($this->autocompleterValues) {
- throw new LogicException('A hidden question cannot use the autocompleter.');
- }
- $this->hidden = (bool) $hidden;
- return $this;
- }
- public function isHiddenFallback()
- {
- return $this->hiddenFallback;
- }
- public function setHiddenFallback($fallback)
- {
- $this->hiddenFallback = (bool) $fallback;
- return $this;
- }
- public function getAutocompleterValues()
- {
- return $this->autocompleterValues;
- }
- public function setAutocompleterValues($values)
- {
- if (is_array($values) && $this->isAssoc($values)) {
- $values = array_merge(array_keys($values), array_values($values));
- }
- if (null !== $values && !is_array($values)) {
- if (!$values instanceof \Traversable || $values instanceof \Countable) {
- throw new InvalidArgumentException('Autocompleter values can be either an array, `null` or an object implementing both `Countable` and `Traversable` interfaces.');
- }
- }
- if ($this->hidden) {
- throw new LogicException('A hidden question cannot use the autocompleter.');
- }
- $this->autocompleterValues = $values;
- return $this;
- }
- public function setValidator($validator)
- {
- $this->validator = $validator;
- return $this;
- }
- public function getValidator()
- {
- return $this->validator;
- }
- public function setMaxAttempts($attempts)
- {
- if (null !== $attempts && $attempts < 1) {
- throw new InvalidArgumentException('Maximum number of attempts must be a positive value.');
- }
- $this->attempts = $attempts;
- return $this;
- }
- public function getMaxAttempts()
- {
- return $this->attempts;
- }
- public function setNormalizer($normalizer)
- {
- $this->normalizer = $normalizer;
- return $this;
- }
- public function getNormalizer()
- {
- return $this->normalizer;
- }
- protected function isAssoc($array)
- {
- return (bool) count(array_filter(array_keys($array), 'is_string'));
- }
- }
- <?php
- namespace Symfony\Component\Console;
- use Symfony\Component\Console\Exception\RuntimeException;
- use Symfony\Component\Console\Input\StringInput;
- use Symfony\Component\Console\Output\ConsoleOutput;
- use Symfony\Component\Process\ProcessBuilder;
- use Symfony\Component\Process\PhpExecutableFinder;
- class Shell
- {
- private $application;
- private $history;
- private $output;
- private $hasReadline;
- private $processIsolation = false;
- public function __construct(Application $application)
- {
- @trigger_error('The '.__CLASS__.' class is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- $this->hasReadline = function_exists('readline');
- $this->application = $application;
- $this->history = getenv('HOME').'/.history_'.$application->getName();
- $this->output = new ConsoleOutput();
- }
- public function run()
- {
- $this->application->setAutoExit(false);
- $this->application->setCatchExceptions(true);
- if ($this->hasReadline) {
- readline_read_history($this->history);
- readline_completion_function(array($this, 'autocompleter'));
- }
- $this->output->writeln($this->getHeader());
- $php = null;
- if ($this->processIsolation) {
- $finder = new PhpExecutableFinder();
- $php = $finder->find();
- $this->output->writeln(<<<'EOF'
- <info>Running with process isolation, you should consider this:</info>
- * each command is executed as separate process,
- * commands don't support interactivity, all params must be passed explicitly,
- * commands output is not colorized.
- EOF
- );
- }
- while (true) {
- $command = $this->readline();
- if (false === $command) {
- $this->output->writeln("\n");
- break;
- }
- if ($this->hasReadline) {
- readline_add_history($command);
- readline_write_history($this->history);
- }
- if ($this->processIsolation) {
- $pb = new ProcessBuilder();
- $process = $pb
- ->add($php)
- ->add($_SERVER['argv'][0])
- ->add($command)
- ->inheritEnvironmentVariables(true)
- ->getProcess()
- ;
- $output = $this->output;
- $process->run(function ($type, $data) use ($output) {
- $output->writeln($data);
- });
- $ret = $process->getExitCode();
- } else {
- $ret = $this->application->run(new StringInput($command), $this->output);
- }
- if (0 !== $ret) {
- $this->output->writeln(sprintf('<error>The command terminated with an error status (%s)</error>', $ret));
- }
- }
- }
- protected function getHeader()
- {
- return <<<EOF
- Welcome to the <info>{$this->application->getName()}</info> shell (<comment>{$this->application->getVersion()}</comment>).
- At the prompt, type <comment>help</comment> for some help,
- or <comment>list</comment> to get a list of available commands.
- To exit the shell, type <comment>^D</comment>.
- EOF;
- }
- protected function getPrompt()
- {
- return $this->output->getFormatter()->format($this->application->getName().' > ');
- }
- protected function getOutput()
- {
- return $this->output;
- }
- protected function getApplication()
- {
- return $this->application;
- }
- private function autocompleter($text)
- {
- $info = readline_info();
- $text = substr($info['line_buffer'], 0, $info['end']);
- if ($info['point'] !== $info['end']) {
- return true;
- }
- if (false === strpos($text, ' ') || !$text) {
- return array_keys($this->application->all());
- }
- try {
- $command = $this->application->find(substr($text, 0, strpos($text, ' ')));
- } catch (\Exception $e) {
- return true;
- }
- $list = array('--help');
- foreach ($command->getDefinition()->getOptions() as $option) {
- $list[] = '--'.$option->getName();
- }
- return $list;
- }
- private function readline()
- {
- if ($this->hasReadline) {
- $line = readline($this->getPrompt());
- } else {
- $this->output->write($this->getPrompt());
- $line = fgets(STDIN, 1024);
- $line = (false === $line || '' === $line) ? false : rtrim($line);
- }
- return $line;
- }
- public function getProcessIsolation()
- {
- return $this->processIsolation;
- }
- public function setProcessIsolation($processIsolation)
- {
- $this->processIsolation = (bool) $processIsolation;
- if ($this->processIsolation && !class_exists('Symfony\\Component\\Process\\Process')) {
- throw new RuntimeException('Unable to isolate processes as the Symfony Process Component is not installed.');
- }
- }
- }
- <?php
- namespace Symfony\Component\Console\Style;
- use Symfony\Component\Console\Formatter\OutputFormatterInterface;
- use Symfony\Component\Console\Helper\ProgressBar;
- use Symfony\Component\Console\Output\OutputInterface;
- abstract class OutputStyle implements OutputInterface, StyleInterface
- {
- private $output;
- public function __construct(OutputInterface $output)
- {
- $this->output = $output;
- }
- public function newLine($count = 1)
- {
- $this->output->write(str_repeat(PHP_EOL, $count));
- }
- public function createProgressBar($max = 0)
- {
- return new ProgressBar($this->output, $max);
- }
- public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL)
- {
- $this->output->write($messages, $newline, $type);
- }
- public function writeln($messages, $type = self::OUTPUT_NORMAL)
- {
- $this->output->writeln($messages, $type);
- }
- public function setVerbosity($level)
- {
- $this->output->setVerbosity($level);
- }
- public function getVerbosity()
- {
- return $this->output->getVerbosity();
- }
- public function setDecorated($decorated)
- {
- $this->output->setDecorated($decorated);
- }
- public function isDecorated()
- {
- return $this->output->isDecorated();
- }
- public function setFormatter(OutputFormatterInterface $formatter)
- {
- $this->output->setFormatter($formatter);
- }
- public function getFormatter()
- {
- return $this->output->getFormatter();
- }
- }
- <?php
- namespace Symfony\Component\Console\Style;
- interface StyleInterface
- {
- public function title($message);
- public function section($message);
- public function listing(array $elements);
- public function text($message);
- public function success($message);
- public function error($message);
- public function warning($message);
- public function note($message);
- public function caution($message);
- public function table(array $headers, array $rows);
- public function ask($question, $default = null, $validator = null);
- public function askHidden($question, $validator = null);
- public function confirm($question, $default = true);
- public function choice($question, array $choices, $default = null);
- public function newLine($count = 1);
- public function progressStart($max = 0);
- public function progressAdvance($step = 1);
- public function progressFinish();
- }
- <?php
- namespace Symfony\Component\Console\Style;
- use Symfony\Component\Console\Application;
- use Symfony\Component\Console\Exception\RuntimeException;
- use Symfony\Component\Console\Formatter\OutputFormatter;
- use Symfony\Component\Console\Helper\Helper;
- use Symfony\Component\Console\Helper\ProgressBar;
- use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
- use Symfony\Component\Console\Helper\Table;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\BufferedOutput;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Question\ChoiceQuestion;
- use Symfony\Component\Console\Question\ConfirmationQuestion;
- use Symfony\Component\Console\Question\Question;
- class SymfonyStyle extends OutputStyle
- {
- const MAX_LINE_LENGTH = 120;
- private $input;
- private $questionHelper;
- private $progressBar;
- private $lineLength;
- private $bufferedOutput;
- public function __construct(InputInterface $input, OutputInterface $output)
- {
- $this->input = $input;
- $this->bufferedOutput = new BufferedOutput($output->getVerbosity(), false, clone $output->getFormatter());
- $this->lineLength = min($this->getTerminalWidth() - (int) (DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH);
- parent::__construct($output);
- }
- public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false)
- {
- $this->autoPrependBlock();
- $messages = is_array($messages) ? array_values($messages) : array($messages);
- $lines = array();
- if (null !== $type) {
- $messages[0] = sprintf('[%s] %s', $type, $messages[0]);
- }
- foreach ($messages as $key => $message) {
- $message = OutputFormatter::escape($message);
- $lines = array_merge($lines, explode(PHP_EOL, wordwrap($message, $this->lineLength - Helper::strlen($prefix), PHP_EOL, true)));
- if (count($messages) > 1 && $key < count($messages) - 1) {
- $lines[] = '';
- }
- }
- if ($padding && $this->isDecorated()) {
- array_unshift($lines, '');
- $lines[] = '';
- }
- foreach ($lines as &$line) {
- $line = sprintf('%s%s', $prefix, $line);
- $line .= str_repeat(' ', $this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line));
- if ($style) {
- $line = sprintf('<%s>%s</>', $style, $line);
- }
- }
- $this->writeln($lines);
- $this->newLine();
- }
- public function title($message)
- {
- $this->autoPrependBlock();
- $this->writeln(array(
- sprintf('<comment>%s</>', $message),
- sprintf('<comment>%s</>', str_repeat('=', Helper::strlenWithoutDecoration($this->getFormatter(), $message))),
- ));
- $this->newLine();
- }
- public function section($message)
- {
- $this->autoPrependBlock();
- $this->writeln(array(
- sprintf('<comment>%s</>', $message),
- sprintf('<comment>%s</>', str_repeat('-', Helper::strlenWithoutDecoration($this->getFormatter(), $message))),
- ));
- $this->newLine();
- }
- public function listing(array $elements)
- {
- $this->autoPrependText();
- $elements = array_map(function ($element) {
- return sprintf(' * %s', $element);
- }, $elements);
- $this->writeln($elements);
- $this->newLine();
- }
- public function text($message)
- {
- $this->autoPrependText();
- $messages = is_array($message) ? array_values($message) : array($message);
- foreach ($messages as $message) {
- $this->writeln(sprintf(' %s', $message));
- }
- }
- public function comment($message)
- {
- $this->autoPrependText();
- $messages = is_array($message) ? array_values($message) : array($message);
- foreach ($messages as $message) {
- $this->writeln(sprintf(' // %s', $message));
- }
- }
- public function success($message)
- {
- $this->block($message, 'OK', 'fg=black;bg=green', ' ', true);
- }
- public function error($message)
- {
- $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true);
- }
- public function warning($message)
- {
- $this->block($message, 'WARNING', 'fg=white;bg=red', ' ', true);
- }
- public function note($message)
- {
- $this->block($message, 'NOTE', 'fg=yellow', ' ! ');
- }
- public function caution($message)
- {
- $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true);
- }
- public function table(array $headers, array $rows)
- {
- $headers = array_map(function ($value) { return sprintf('<info>%s</>', $value); }, $headers);
- $table = new Table($this);
- $table->setHeaders($headers);
- $table->setRows($rows);
- $table->setStyle('symfony-style-guide');
- $table->render();
- $this->newLine();
- }
- public function ask($question, $default = null, $validator = null)
- {
- $question = new Question($question, $default);
- $question->setValidator($validator);
- return $this->askQuestion($question);
- }
- public function askHidden($question, $validator = null)
- {
- $question = new Question($question);
- $question->setHidden(true);
- $question->setValidator($validator);
- return $this->askQuestion($question);
- }
- public function confirm($question, $default = true)
- {
- return $this->askQuestion(new ConfirmationQuestion($question, $default));
- }
- public function choice($question, array $choices, $default = null)
- {
- if (null !== $default) {
- $values = array_flip($choices);
- $default = $values[$default];
- }
- return $this->askQuestion(new ChoiceQuestion($question, $choices, $default));
- }
- public function progressStart($max = 0)
- {
- $this->progressBar = $this->createProgressBar($max);
- $this->progressBar->start();
- }
- public function progressAdvance($step = 1)
- {
- $this->getProgressBar()->advance($step);
- }
- public function progressFinish()
- {
- $this->getProgressBar()->finish();
- $this->newLine(2);
- $this->progressBar = null;
- }
- public function createProgressBar($max = 0)
- {
- $progressBar = parent::createProgressBar($max);
- if ('\\' !== DIRECTORY_SEPARATOR) {
- $progressBar->setEmptyBarCharacter('â–‘');
- $progressBar->setProgressCharacter('');
- $progressBar->setBarCharacter('â–“');
- }
- return $progressBar;
- }
- public function askQuestion(Question $question)
- {
- if ($this->input->isInteractive()) {
- $this->autoPrependBlock();
- }
- if (!$this->questionHelper) {
- $this->questionHelper = new SymfonyQuestionHelper();
- }
- $answer = $this->questionHelper->ask($this->input, $this, $question);
- if ($this->input->isInteractive()) {
- $this->newLine();
- $this->bufferedOutput->write("\n");
- }
- return $answer;
- }
- public function writeln($messages, $type = self::OUTPUT_NORMAL)
- {
- parent::writeln($messages, $type);
- $this->bufferedOutput->writeln($this->reduceBuffer($messages), $type);
- }
- public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL)
- {
- parent::write($messages, $newline, $type);
- $this->bufferedOutput->write($this->reduceBuffer($messages), $newline, $type);
- }
- public function newLine($count = 1)
- {
- parent::newLine($count);
- $this->bufferedOutput->write(str_repeat("\n", $count));
- }
- private function getProgressBar()
- {
- if (!$this->progressBar) {
- throw new RuntimeException('The ProgressBar is not started.');
- }
- return $this->progressBar;
- }
- private function getTerminalWidth()
- {
- $application = new Application();
- $dimensions = $application->getTerminalDimensions();
- return $dimensions[0] ?: self::MAX_LINE_LENGTH;
- }
- private function autoPrependBlock()
- {
- $chars = substr(str_replace(PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2);
- if (!isset($chars[0])) {
- return $this->newLine();
- }
- $this->newLine(2 - substr_count($chars, "\n"));
- }
- private function autoPrependText()
- {
- $fetched = $this->bufferedOutput->fetch();
- if ("\n" !== substr($fetched, -1)) {
- $this->newLine();
- }
- }
- private function reduceBuffer($messages)
- {
-
- return array_map(function ($value) {
- return substr($value, -4);
- }, array_merge(array($this->bufferedOutput->fetch()), (array) $messages));
- }
- }
- <?php
- namespace Symfony\Component\Console\Tester;
- use Symfony\Component\Console\Application;
- use Symfony\Component\Console\Input\ArrayInput;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Output\StreamOutput;
- class ApplicationTester
- {
- private $application;
- private $input;
- private $output;
- private $statusCode;
- public function __construct(Application $application)
- {
- $this->application = $application;
- }
- public function run(array $input, $options = array())
- {
- $this->input = new ArrayInput($input);
- if (isset($options['interactive'])) {
- $this->input->setInteractive($options['interactive']);
- }
- $this->output = new StreamOutput(fopen('php://memory', 'w', false));
- if (isset($options['decorated'])) {
- $this->output->setDecorated($options['decorated']);
- }
- if (isset($options['verbosity'])) {
- $this->output->setVerbosity($options['verbosity']);
- }
- return $this->statusCode = $this->application->run($this->input, $this->output);
- }
- public function getDisplay($normalize = false)
- {
- rewind($this->output->getStream());
- $display = stream_get_contents($this->output->getStream());
- if ($normalize) {
- $display = str_replace(PHP_EOL, "\n", $display);
- }
- return $display;
- }
- public function getInput()
- {
- return $this->input;
- }
- public function getOutput()
- {
- return $this->output;
- }
- public function getStatusCode()
- {
- return $this->statusCode;
- }
- }
- <?php
- namespace Symfony\Component\Console\Tester;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\ArrayInput;
- use Symfony\Component\Console\Output\StreamOutput;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class CommandTester
- {
- private $command;
- private $input;
- private $output;
- private $statusCode;
- public function __construct(Command $command)
- {
- $this->command = $command;
- }
- public function execute(array $input, array $options = array())
- {
-
- if (!isset($input['command'])
- && (null !== $application = $this->command->getApplication())
- && $application->getDefinition()->hasArgument('command')
- ) {
- $input = array_merge(array('command' => $this->command->getName()), $input);
- }
- $this->input = new ArrayInput($input);
- if (isset($options['interactive'])) {
- $this->input->setInteractive($options['interactive']);
- }
- $this->output = new StreamOutput(fopen('php://memory', 'w', false));
- if (isset($options['decorated'])) {
- $this->output->setDecorated($options['decorated']);
- }
- if (isset($options['verbosity'])) {
- $this->output->setVerbosity($options['verbosity']);
- }
- return $this->statusCode = $this->command->run($this->input, $this->output);
- }
- public function getDisplay($normalize = false)
- {
- rewind($this->output->getStream());
- $display = stream_get_contents($this->output->getStream());
- if ($normalize) {
- $display = str_replace(PHP_EOL, "\n", $display);
- }
- return $display;
- }
- public function getInput()
- {
- return $this->input;
- }
- public function getOutput()
- {
- return $this->output;
- }
- public function getStatusCode()
- {
- return $this->statusCode;
- }
- }
- <?php
- namespace Symfony\Component\Filesystem\Exception;
- interface ExceptionInterface
- {
- }
- <?php
- namespace Symfony\Component\Filesystem\Exception;
- class FileNotFoundException extends IOException
- {
- public function __construct($message = null, $code = 0, \Exception $previous = null, $path = null)
- {
- if (null === $message) {
- if (null === $path) {
- $message = 'File could not be found.';
- } else {
- $message = sprintf('File "%s" could not be found.', $path);
- }
- }
- parent::__construct($message, $code, $previous, $path);
- }
- }
- <?php
- namespace Symfony\Component\Filesystem\Exception;
- class IOException extends \RuntimeException implements IOExceptionInterface
- {
- private $path;
- public function __construct($message, $code = 0, \Exception $previous = null, $path = null)
- {
- $this->path = $path;
- parent::__construct($message, $code, $previous);
- }
- public function getPath()
- {
- return $this->path;
- }
- }
- <?php
- namespace Symfony\Component\Filesystem\Exception;
- interface IOExceptionInterface extends ExceptionInterface
- {
- public function getPath();
- }
- <?php
- namespace Symfony\Component\Filesystem;
- use Symfony\Component\Filesystem\Exception\IOException;
- use Symfony\Component\Filesystem\Exception\FileNotFoundException;
- class Filesystem
- {
- public function copy($originFile, $targetFile, $override = false)
- {
- if (stream_is_local($originFile) && !is_file($originFile)) {
- throw new FileNotFoundException(sprintf('Failed to copy "%s" because file does not exist.', $originFile), 0, null, $originFile);
- }
- $this->mkdir(dirname($targetFile));
- $doCopy = true;
- if (!$override && null === parse_url($originFile, PHP_URL_HOST) && is_file($targetFile)) {
- $doCopy = filemtime($originFile) > filemtime($targetFile);
- }
- if ($doCopy) {
- if (false === $source = @fopen($originFile, 'r')) {
- throw new IOException(sprintf('Failed to copy "%s" to "%s" because source file could not be opened for reading.', $originFile, $targetFile), 0, null, $originFile);
- }
- if (false === $target = @fopen($targetFile, 'w', null, stream_context_create(array('ftp' => array('overwrite' => true))))) {
- throw new IOException(sprintf('Failed to copy "%s" to "%s" because target file could not be opened for writing.', $originFile, $targetFile), 0, null, $originFile);
- }
- $bytesCopied = stream_copy_to_stream($source, $target);
- fclose($source);
- fclose($target);
- unset($source, $target);
- if (!is_file($targetFile)) {
- throw new IOException(sprintf('Failed to copy "%s" to "%s".', $originFile, $targetFile), 0, null, $originFile);
- }
- @chmod($targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111));
- if (stream_is_local($originFile) && $bytesCopied !== ($bytesOrigin = filesize($originFile))) {
- throw new IOException(sprintf('Failed to copy the whole content of "%s" to "%s" (%g of %g bytes copied).', $originFile, $targetFile, $bytesCopied, $bytesOrigin), 0, null, $originFile);
- }
- }
- }
- public function mkdir($dirs, $mode = 0777)
- {
- foreach ($this->toIterator($dirs) as $dir) {
- if (is_dir($dir)) {
- continue;
- }
- if (true !== @mkdir($dir, $mode, true)) {
- $error = error_get_last();
- if (!is_dir($dir)) {
- if ($error) {
- throw new IOException(sprintf('Failed to create "%s": %s.', $dir, $error['message']), 0, null, $dir);
- }
- throw new IOException(sprintf('Failed to create "%s"', $dir), 0, null, $dir);
- }
- }
- }
- }
- public function exists($files)
- {
- foreach ($this->toIterator($files) as $file) {
- if (!file_exists($file)) {
- return false;
- }
- }
- return true;
- }
- public function touch($files, $time = null, $atime = null)
- {
- foreach ($this->toIterator($files) as $file) {
- $touch = $time ? @touch($file, $time, $atime) : @touch($file);
- if (true !== $touch) {
- throw new IOException(sprintf('Failed to touch "%s".', $file), 0, null, $file);
- }
- }
- }
- public function remove($files)
- {
- $files = iterator_to_array($this->toIterator($files));
- $files = array_reverse($files);
- foreach ($files as $file) {
- if (!file_exists($file) && !is_link($file)) {
- continue;
- }
- if (is_dir($file) && !is_link($file)) {
- $this->remove(new \FilesystemIterator($file));
- if (true !== @rmdir($file)) {
- throw new IOException(sprintf('Failed to remove directory "%s".', $file), 0, null, $file);
- }
- } else {
- if ('\\' === DIRECTORY_SEPARATOR && is_dir($file)) {
- if (true !== @rmdir($file)) {
- throw new IOException(sprintf('Failed to remove file "%s".', $file), 0, null, $file);
- }
- } else {
- if (true !== @unlink($file)) {
- throw new IOException(sprintf('Failed to remove file "%s".', $file), 0, null, $file);
- }
- }
- }
- }
- }
- public function chmod($files, $mode, $umask = 0000, $recursive = false)
- {
- foreach ($this->toIterator($files) as $file) {
- if (true !== @chmod($file, $mode & ~$umask)) {
- throw new IOException(sprintf('Failed to chmod file "%s".', $file), 0, null, $file);
- }
- if ($recursive && is_dir($file) && !is_link($file)) {
- $this->chmod(new \FilesystemIterator($file), $mode, $umask, true);
- }
- }
- }
- public function chown($files, $user, $recursive = false)
- {
- foreach ($this->toIterator($files) as $file) {
- if ($recursive && is_dir($file) && !is_link($file)) {
- $this->chown(new \FilesystemIterator($file), $user, true);
- }
- if (is_link($file) && function_exists('lchown')) {
- if (true !== @lchown($file, $user)) {
- throw new IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file);
- }
- } else {
- if (true !== @chown($file, $user)) {
- throw new IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file);
- }
- }
- }
- }
- public function chgrp($files, $group, $recursive = false)
- {
- foreach ($this->toIterator($files) as $file) {
- if ($recursive && is_dir($file) && !is_link($file)) {
- $this->chgrp(new \FilesystemIterator($file), $group, true);
- }
- if (is_link($file) && function_exists('lchgrp')) {
- if (true !== @lchgrp($file, $group) || (defined('HHVM_VERSION') && !posix_getgrnam($group))) {
- throw new IOException(sprintf('Failed to chgrp file "%s".', $file), 0, null, $file);
- }
- } else {
- if (true !== @chgrp($file, $group)) {
- throw new IOException(sprintf('Failed to chgrp file "%s".', $file), 0, null, $file);
- }
- }
- }
- }
- public function rename($origin, $target, $overwrite = false)
- {
- if (!$overwrite && is_readable($target)) {
- throw new IOException(sprintf('Cannot rename because the target "%s" already exists.', $target), 0, null, $target);
- }
- if (true !== @rename($origin, $target)) {
- throw new IOException(sprintf('Cannot rename "%s" to "%s".', $origin, $target), 0, null, $target);
- }
- }
- public function symlink($originDir, $targetDir, $copyOnWindows = false)
- {
- if ('\\' === DIRECTORY_SEPARATOR && $copyOnWindows) {
- $this->mirror($originDir, $targetDir);
- return;
- }
- $this->mkdir(dirname($targetDir));
- $ok = false;
- if (is_link($targetDir)) {
- if (readlink($targetDir) != $originDir) {
- $this->remove($targetDir);
- } else {
- $ok = true;
- }
- }
- if (!$ok && true !== @symlink($originDir, $targetDir)) {
- $report = error_get_last();
- if (is_array($report)) {
- if ('\\' === DIRECTORY_SEPARATOR && false !== strpos($report['message'], 'error code(1314)')) {
- throw new IOException('Unable to create symlink due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?', 0, null, $targetDir);
- }
- }
- throw new IOException(sprintf('Failed to create symbolic link from "%s" to "%s".', $originDir, $targetDir), 0, null, $targetDir);
- }
- }
- public function makePathRelative($endPath, $startPath)
- {
- if ('\\' === DIRECTORY_SEPARATOR) {
- $endPath = str_replace('\\', '/', $endPath);
- $startPath = str_replace('\\', '/', $startPath);
- }
- $startPathArr = explode('/', trim($startPath, '/'));
- $endPathArr = explode('/', trim($endPath, '/'));
- $index = 0;
- while (isset($startPathArr[$index]) && isset($endPathArr[$index]) && $startPathArr[$index] === $endPathArr[$index]) {
- ++$index;
- }
- $depth = count($startPathArr) - $index;
- if ('/' === $startPath[0] && 0 === $index && 1 === $depth) {
- $traverser = '';
- } else {
- $traverser = str_repeat('../', $depth);
- }
- $endPathRemainder = implode('/', array_slice($endPathArr, $index));
- $relativePath = $traverser.('' !== $endPathRemainder ? $endPathRemainder.'/' : '');
- return '' === $relativePath ? './' : $relativePath;
- }
- public function mirror($originDir, $targetDir, \Traversable $iterator = null, $options = array())
- {
- $targetDir = rtrim($targetDir, '/\\');
- $originDir = rtrim($originDir, '/\\');
- if ($this->exists($targetDir) && isset($options['delete']) && $options['delete']) {
- $deleteIterator = $iterator;
- if (null === $deleteIterator) {
- $flags = \FilesystemIterator::SKIP_DOTS;
- $deleteIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($targetDir, $flags), \RecursiveIteratorIterator::CHILD_FIRST);
- }
- foreach ($deleteIterator as $file) {
- $origin = str_replace($targetDir, $originDir, $file->getPathname());
- if (!$this->exists($origin)) {
- $this->remove($file);
- }
- }
- }
- $copyOnWindows = false;
- if (isset($options['copy_on_windows'])) {
- $copyOnWindows = $options['copy_on_windows'];
- }
- if (null === $iterator) {
- $flags = $copyOnWindows ? \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS : \FilesystemIterator::SKIP_DOTS;
- $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($originDir, $flags), \RecursiveIteratorIterator::SELF_FIRST);
- }
- if ($this->exists($originDir)) {
- $this->mkdir($targetDir);
- }
- foreach ($iterator as $file) {
- $target = str_replace($originDir, $targetDir, $file->getPathname());
- if ($copyOnWindows) {
- if (is_link($file) || is_file($file)) {
- $this->copy($file, $target, isset($options['override']) ? $options['override'] : false);
- } elseif (is_dir($file)) {
- $this->mkdir($target);
- } else {
- throw new IOException(sprintf('Unable to guess "%s" file type.', $file), 0, null, $file);
- }
- } else {
- if (is_link($file)) {
- $this->symlink($file->getLinkTarget(), $target);
- } elseif (is_dir($file)) {
- $this->mkdir($target);
- } elseif (is_file($file)) {
- $this->copy($file, $target, isset($options['override']) ? $options['override'] : false);
- } else {
- throw new IOException(sprintf('Unable to guess "%s" file type.', $file), 0, null, $file);
- }
- }
- }
- }
- public function isAbsolutePath($file)
- {
- return strspn($file, '/\\', 0, 1)
- || (strlen($file) > 3 && ctype_alpha($file[0])
- && substr($file, 1, 1) === ':'
- && strspn($file, '/\\', 2, 1)
- )
- || null !== parse_url($file, PHP_URL_SCHEME)
- ;
- }
- public function tempnam($dir, $prefix)
- {
- list($scheme, $hierarchy) = $this->getSchemeAndHierarchy($dir);
- if (null === $scheme || 'file' === $scheme) {
- $tmpFile = tempnam($hierarchy, $prefix);
- if (false !== $tmpFile) {
- if (null !== $scheme) {
- return $scheme.'://'.$tmpFile;
- }
- return $tmpFile;
- }
- throw new IOException('A temporary file could not be created.');
- }
- for ($i = 0; $i < 10; ++$i) {
- $tmpFile = $dir.'/'.$prefix.uniqid(mt_rand(), true);
-
- $handle = @fopen($tmpFile, 'x+');
- if (false === $handle) {
- continue;
- }
- @fclose($handle);
- return $tmpFile;
- }
- throw new IOException('A temporary file could not be created.');
- }
- public function dumpFile($filename, $content, $mode = 0666)
- {
- $dir = dirname($filename);
- if (!is_dir($dir)) {
- $this->mkdir($dir);
- } elseif (!is_writable($dir)) {
- throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir);
- }
- $tmpFile = $this->tempnam($dir, basename($filename));
- if (false === @file_put_contents($tmpFile, $content)) {
- throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename);
- }
- if (null !== $mode) {
- if (func_num_args() > 2) {
- @trigger_error('Support for modifying file permissions is deprecated since version 2.3.12 and will be removed in 3.0.', E_USER_DEPRECATED);
- }
- $this->chmod($tmpFile, $mode);
- }
- $this->rename($tmpFile, $filename, true);
- }
- private function toIterator($files)
- {
- if (!$files instanceof \Traversable) {
- $files = new \ArrayObject(is_array($files) ? $files : array($files));
- }
- return $files;
- }
- private function getSchemeAndHierarchy($filename)
- {
- $components = explode('://', $filename, 2);
- return 2 === count($components) ? array($components[0], $components[1]) : array(null, $components[0]);
- }
- }
- Copyright (c) 2004-2016 Fabien Potencier
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is furnished
- to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- <?php
- namespace Symfony\Component\Filesystem;
- use Symfony\Component\Filesystem\Exception\IOException;
- class LockHandler
- {
- private $file;
- private $handle;
- public function __construct($name, $lockPath = null)
- {
- $lockPath = $lockPath ?: sys_get_temp_dir();
- if (!is_dir($lockPath)) {
- $fs = new Filesystem();
- $fs->mkdir($lockPath);
- }
- if (!is_writable($lockPath)) {
- throw new IOException(sprintf('The directory "%s" is not writable.', $lockPath), 0, null, $lockPath);
- }
- $this->file = sprintf('%s/sf.%s.%s.lock', $lockPath, preg_replace('/[^a-z0-9\._-]+/i', '-', $name), hash('sha256', $name));
- }
- public function lock($blocking = false)
- {
- if ($this->handle) {
- return true;
- }
- set_error_handler(function() {});
- if (!$this->handle = fopen($this->file, 'r')) {
- if ($this->handle = fopen($this->file, 'x')) {
- chmod($this->file, 0444);
- } elseif (!$this->handle = fopen($this->file, 'r')) {
- usleep(100);
- $this->handle = fopen($this->file, 'r');
- }
- }
- restore_error_handler();
- if (!$this->handle) {
- $error = error_get_last();
- throw new IOException($error['message'], 0, null, $this->file);
- }
-
- if (!flock($this->handle, LOCK_EX | ($blocking ? 0 : LOCK_NB))) {
- fclose($this->handle);
- $this->handle = null;
- return false;
- }
- return true;
- }
- public function release()
- {
- if ($this->handle) {
- flock($this->handle, LOCK_UN | LOCK_NB);
- fclose($this->handle);
- $this->handle = null;
- }
- }
- }
- <?php
- namespace Symfony\Component\Finder\Adapter;
- @trigger_error('The '.__NAMESPACE__.'\AbstractAdapter class is deprecated since version 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED);
- abstract class AbstractAdapter implements AdapterInterface
- {
- protected $followLinks = false;
- protected $mode = 0;
- protected $minDepth = 0;
- protected $maxDepth = PHP_INT_MAX;
- protected $exclude = array();
- protected $names = array();
- protected $notNames = array();
- protected $contains = array();
- protected $notContains = array();
- protected $sizes = array();
- protected $dates = array();
- protected $filters = array();
- protected $sort = false;
- protected $paths = array();
- protected $notPaths = array();
- protected $ignoreUnreadableDirs = false;
- private static $areSupported = array();
- public function isSupported()
- {
- $name = $this->getName();
- if (!array_key_exists($name, self::$areSupported)) {
- self::$areSupported[$name] = $this->canBeUsed();
- }
- return self::$areSupported[$name];
- }
- public function setFollowLinks($followLinks)
- {
- $this->followLinks = $followLinks;
- return $this;
- }
- public function setMode($mode)
- {
- $this->mode = $mode;
- return $this;
- }
- public function setDepths(array $depths)
- {
- $this->minDepth = 0;
- $this->maxDepth = PHP_INT_MAX;
- foreach ($depths as $comparator) {
- switch ($comparator->getOperator()) {
- case '>':
- $this->minDepth = $comparator->getTarget() + 1;
- break;
- case '>=':
- $this->minDepth = $comparator->getTarget();
- break;
- case '<':
- $this->maxDepth = $comparator->getTarget() - 1;
- break;
- case '<=':
- $this->maxDepth = $comparator->getTarget();
- break;
- default:
- $this->minDepth = $this->maxDepth = $comparator->getTarget();
- }
- }
- return $this;
- }
- public function setExclude(array $exclude)
- {
- $this->exclude = $exclude;
- return $this;
- }
- public function setNames(array $names)
- {
- $this->names = $names;
- return $this;
- }
- public function setNotNames(array $notNames)
- {
- $this->notNames = $notNames;
- return $this;
- }
- public function setContains(array $contains)
- {
- $this->contains = $contains;
- return $this;
- }
- public function setNotContains(array $notContains)
- {
- $this->notContains = $notContains;
- return $this;
- }
- public function setSizes(array $sizes)
- {
- $this->sizes = $sizes;
- return $this;
- }
- public function setDates(array $dates)
- {
- $this->dates = $dates;
- return $this;
- }
- public function setFilters(array $filters)
- {
- $this->filters = $filters;
- return $this;
- }
- public function setSort($sort)
- {
- $this->sort = $sort;
- return $this;
- }
- public function setPath(array $paths)
- {
- $this->paths = $paths;
- return $this;
- }
- public function setNotPath(array $notPaths)
- {
- $this->notPaths = $notPaths;
- return $this;
- }
- public function ignoreUnreadableDirs($ignore = true)
- {
- $this->ignoreUnreadableDirs = (bool) $ignore;
- return $this;
- }
- abstract protected function canBeUsed();
- }
- <?php
- namespace Symfony\Component\Finder\Adapter;
- @trigger_error('The '.__NAMESPACE__.'\AbstractFindAdapter class is deprecated since version 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED);
- use Symfony\Component\Finder\Exception\AccessDeniedException;
- use Symfony\Component\Finder\Iterator;
- use Symfony\Component\Finder\Shell\Shell;
- use Symfony\Component\Finder\Expression\Expression;
- use Symfony\Component\Finder\Shell\Command;
- use Symfony\Component\Finder\Comparator\NumberComparator;
- use Symfony\Component\Finder\Comparator\DateComparator;
- abstract class AbstractFindAdapter extends AbstractAdapter
- {
- protected $shell;
- public function __construct()
- {
- $this->shell = new Shell();
- }
- public function searchInDirectory($dir)
- {
- $dir = realpath($dir);
- if (Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES === $this->mode && ($this->contains || $this->notContains)) {
- return new Iterator\FilePathsIterator(array(), $dir);
- }
- $command = Command::create();
- $find = $this->buildFindCommand($command, $dir);
- if ($this->followLinks) {
- $find->add('-follow');
- }
- $find->add('-mindepth')->add($this->minDepth + 1);
- if (PHP_INT_MAX !== $this->maxDepth) {
- $find->add('-maxdepth')->add($this->maxDepth + 1);
- }
- if (Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES === $this->mode) {
- $find->add('-type d');
- } elseif (Iterator\FileTypeFilterIterator::ONLY_FILES === $this->mode) {
- $find->add('-type f');
- }
- $this->buildNamesFiltering($find, $this->names);
- $this->buildNamesFiltering($find, $this->notNames, true);
- $this->buildPathsFiltering($find, $dir, $this->paths);
- $this->buildPathsFiltering($find, $dir, $this->notPaths, true);
- $this->buildSizesFiltering($find, $this->sizes);
- $this->buildDatesFiltering($find, $this->dates);
- $useGrep = $this->shell->testCommand('grep') && $this->shell->testCommand('xargs');
- $useSort = is_int($this->sort) && $this->shell->testCommand('sort') && $this->shell->testCommand('cut');
- if ($useGrep && ($this->contains || $this->notContains)) {
- $grep = $command->ins('grep');
- $this->buildContentFiltering($grep, $this->contains);
- $this->buildContentFiltering($grep, $this->notContains, true);
- }
- if ($useSort) {
- $this->buildSorting($command, $this->sort);
- }
- $command->setErrorHandler(
- $this->ignoreUnreadableDirs
- ? function ($stderr) { return; }
- : function ($stderr) { throw new AccessDeniedException($stderr); }
- );
- $paths = $this->shell->testCommand('uniq') ? $command->add('| uniq')->execute() : array_unique($command->execute());
- $iterator = new Iterator\FilePathsIterator($paths, $dir);
- if ($this->exclude) {
- $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $this->exclude);
- }
- if (!$useGrep && ($this->contains || $this->notContains)) {
- $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains);
- }
- if ($this->filters) {
- $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters);
- }
- if (!$useSort && $this->sort) {
- $iteratorAggregate = new Iterator\SortableIterator($iterator, $this->sort);
- $iterator = $iteratorAggregate->getIterator();
- }
- return $iterator;
- }
- protected function canBeUsed()
- {
- return $this->shell->testCommand('find');
- }
- protected function buildFindCommand(Command $command, $dir)
- {
- return $command
- ->ins('find')
- ->add('find ')
- ->arg($dir)
- ->add('-noleaf');
- }
- private function buildNamesFiltering(Command $command, array $names, $not = false)
- {
- if (0 === count($names)) {
- return;
- }
- $command->add($not ? '-not' : null)->cmd('(');
- foreach ($names as $i => $name) {
- $expr = Expression::create($name);
- if ($expr->isGlob() && $expr->getGlob()->isExpandable()) {
- $expr = Expression::create($expr->getGlob()->toRegex(false));
- }
-
-
- if ($expr->isRegex()) {
- $regex = $expr->getRegex();
- $regex->prepend($regex->hasStartFlag() ? '/' : '/[^/]*')
- ->setStartFlag(false)
- ->setStartJoker(true)
- ->replaceJokers('[^/]');
- if (!$regex->hasEndFlag() || $regex->hasEndJoker()) {
- $regex->setEndJoker(false)->append('[^/]*');
- }
- }
- $command
- ->add($i > 0 ? '-or' : null)
- ->add($expr->isRegex()
- ? ($expr->isCaseSensitive() ? '-regex' : '-iregex')
- : ($expr->isCaseSensitive() ? '-name' : '-iname')
- )
- ->arg($expr->renderPattern());
- }
- $command->cmd(')');
- }
- private function buildPathsFiltering(Command $command, $dir, array $paths, $not = false)
- {
- if (0 === count($paths)) {
- return;
- }
- $command->add($not ? '-not' : null)->cmd('(');
- foreach ($paths as $i => $path) {
- $expr = Expression::create($path);
- if ($expr->isGlob() && $expr->getGlob()->isExpandable()) {
- $expr = Expression::create($expr->getGlob()->toRegex(false));
- }
- if ($expr->isRegex()) {
- $regex = $expr->getRegex();
- $regex->prepend($regex->hasStartFlag() ? preg_quote($dir).DIRECTORY_SEPARATOR : '.*')->setEndJoker(!$regex->hasEndFlag());
- } else {
- $expr->prepend('*')->append('*');
- }
- $command
- ->add($i > 0 ? '-or' : null)
- ->add($expr->isRegex()
- ? ($expr->isCaseSensitive() ? '-regex' : '-iregex')
- : ($expr->isCaseSensitive() ? '-path' : '-ipath')
- )
- ->arg($expr->renderPattern());
- }
- $command->cmd(')');
- }
- private function buildSizesFiltering(Command $command, array $sizes)
- {
- foreach ($sizes as $i => $size) {
- $command->add($i > 0 ? '-and' : null);
- switch ($size->getOperator()) {
- case '<=':
- $command->add('-size -'.($size->getTarget() + 1).'c');
- break;
- case '>=':
- $command->add('-size +'.($size->getTarget() - 1).'c');
- break;
- case '>':
- $command->add('-size +'.$size->getTarget().'c');
- break;
- case '!=':
- $command->add('-size -'.$size->getTarget().'c');
- $command->add('-size +'.$size->getTarget().'c');
- break;
- case '<':
- default:
- $command->add('-size -'.$size->getTarget().'c');
- }
- }
- }
- private function buildDatesFiltering(Command $command, array $dates)
- {
- foreach ($dates as $i => $date) {
- $command->add($i > 0 ? '-and' : null);
- $mins = (int) round((time() - $date->getTarget()) / 60);
- if (0 > $mins) {
- $command->add(' -mmin -0');
- return;
- }
- switch ($date->getOperator()) {
- case '<=':
- $command->add('-mmin +'.($mins - 1));
- break;
- case '>=':
- $command->add('-mmin -'.($mins + 1));
- break;
- case '>':
- $command->add('-mmin -'.$mins);
- break;
- case '!=':
- $command->add('-mmin +'.$mins.' -or -mmin -'.$mins);
- break;
- case '<':
- default:
- $command->add('-mmin +'.$mins);
- }
- }
- }
- private function buildSorting(Command $command, $sort)
- {
- $this->buildFormatSorting($command, $sort);
- }
- abstract protected function buildFormatSorting(Command $command, $sort);
- abstract protected function buildContentFiltering(Command $command, array $contains, $not = false);
- }
- <?php
- namespace Symfony\Component\Finder\Adapter;
- interface AdapterInterface
- {
- public function setFollowLinks($followLinks);
- public function setMode($mode);
- public function setExclude(array $exclude);
- public function setDepths(array $depths);
- public function setNames(array $names);
- public function setNotNames(array $notNames);
- public function setContains(array $contains);
- public function setNotContains(array $notContains);
- public function setSizes(array $sizes);
- public function setDates(array $dates);
- public function setFilters(array $filters);
- public function setSort($sort);
- public function setPath(array $paths);
- public function setNotPath(array $notPaths);
- public function ignoreUnreadableDirs($ignore = true);
- public function searchInDirectory($dir);
- public function isSupported();
- public function getName();
- }
- <?php
- namespace Symfony\Component\Finder\Adapter;
- @trigger_error('The '.__NAMESPACE__.'\BsdFindAdapter class is deprecated since version 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED);
- use Symfony\Component\Finder\Shell\Shell;
- use Symfony\Component\Finder\Shell\Command;
- use Symfony\Component\Finder\Iterator\SortableIterator;
- use Symfony\Component\Finder\Expression\Expression;
- class BsdFindAdapter extends AbstractFindAdapter
- {
- public function getName()
- {
- return 'bsd_find';
- }
- protected function canBeUsed()
- {
- return in_array($this->shell->getType(), array(Shell::TYPE_BSD, Shell::TYPE_DARWIN)) && parent::canBeUsed();
- }
- protected function buildFormatSorting(Command $command, $sort)
- {
- switch ($sort) {
- case SortableIterator::SORT_BY_NAME:
- $command->ins('sort')->add('| sort');
- return;
- case SortableIterator::SORT_BY_TYPE:
- $format = '%HT';
- break;
- case SortableIterator::SORT_BY_ACCESSED_TIME:
- $format = '%a';
- break;
- case SortableIterator::SORT_BY_CHANGED_TIME:
- $format = '%c';
- break;
- case SortableIterator::SORT_BY_MODIFIED_TIME:
- $format = '%m';
- break;
- default:
- throw new \InvalidArgumentException(sprintf('Unknown sort options: %s.', $sort));
- }
- $command
- ->add('-print0 | xargs -0 stat -f')
- ->arg($format.'%t%N')
- ->add('| sort | cut -f 2');
- }
- protected function buildFindCommand(Command $command, $dir)
- {
- parent::buildFindCommand($command, $dir)->addAtIndex('-E', 1);
- return $command;
- }
- protected function buildContentFiltering(Command $command, array $contains, $not = false)
- {
- foreach ($contains as $contain) {
- $expr = Expression::create($contain);
- $command
- ->add('| grep -v \'^$\'')
- ->add('| xargs -I{} grep -I')
- ->add($expr->isCaseSensitive() ? null : '-i')
- ->add($not ? '-L' : '-l')
- ->add('-Ee')->arg($expr->renderPattern())
- ->add('{}')
- ;
- }
- }
- }
- <?php
- namespace Symfony\Component\Finder\Adapter;
- @trigger_error('The '.__NAMESPACE__.'\GnuFindAdapter class is deprecated since version 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED);
- use Symfony\Component\Finder\Shell\Shell;
- use Symfony\Component\Finder\Shell\Command;
- use Symfony\Component\Finder\Iterator\SortableIterator;
- use Symfony\Component\Finder\Expression\Expression;
- class GnuFindAdapter extends AbstractFindAdapter
- {
- public function getName()
- {
- return 'gnu_find';
- }
- protected function buildFormatSorting(Command $command, $sort)
- {
- switch ($sort) {
- case SortableIterator::SORT_BY_NAME:
- $command->ins('sort')->add('| sort');
- return;
- case SortableIterator::SORT_BY_TYPE:
- $format = '%y';
- break;
- case SortableIterator::SORT_BY_ACCESSED_TIME:
- $format = '%A@';
- break;
- case SortableIterator::SORT_BY_CHANGED_TIME:
- $format = '%C@';
- break;
- case SortableIterator::SORT_BY_MODIFIED_TIME:
- $format = '%T@';
- break;
- default:
- throw new \InvalidArgumentException(sprintf('Unknown sort options: %s.', $sort));
- }
- $command
- ->get('find')
- ->add('-printf')
- ->arg($format.' %h/%f\\n')
- ->add('| sort | cut')
- ->arg('-d ')
- ->arg('-f2-')
- ;
- }
- protected function canBeUsed()
- {
- return $this->shell->getType() === Shell::TYPE_UNIX && parent::canBeUsed();
- }
- protected function buildFindCommand(Command $command, $dir)
- {
- return parent::buildFindCommand($command, $dir)->add('-regextype posix-extended');
- }
- protected function buildContentFiltering(Command $command, array $contains, $not = false)
- {
- foreach ($contains as $contain) {
- $expr = Expression::create($contain);
- $command
- ->add('| xargs -I{} -r grep -I')
- ->add($expr->isCaseSensitive() ? null : '-i')
- ->add($not ? '-L' : '-l')
- ->add('-Ee')->arg($expr->renderPattern())
- ->add('{}')
- ;
- }
- }
- }
- <?php
- namespace Symfony\Component\Finder\Adapter;
- @trigger_error('The '.__NAMESPACE__.'\PhpAdapter class is deprecated since version 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED);
- use Symfony\Component\Finder\Iterator;
- class PhpAdapter extends AbstractAdapter
- {
- public function searchInDirectory($dir)
- {
- $flags = \RecursiveDirectoryIterator::SKIP_DOTS;
- if ($this->followLinks) {
- $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS;
- }
- $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs);
- if ($this->exclude) {
- $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $this->exclude);
- }
- $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST);
- if ($this->minDepth > 0 || $this->maxDepth < PHP_INT_MAX) {
- $iterator = new Iterator\DepthRangeFilterIterator($iterator, $this->minDepth, $this->maxDepth);
- }
- if ($this->mode) {
- $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode);
- }
- if ($this->names || $this->notNames) {
- $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames);
- }
- if ($this->contains || $this->notContains) {
- $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains);
- }
- if ($this->sizes) {
- $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes);
- }
- if ($this->dates) {
- $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates);
- }
- if ($this->filters) {
- $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters);
- }
- if ($this->paths || $this->notPaths) {
- $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $this->notPaths);
- }
- if ($this->sort) {
- $iteratorAggregate = new Iterator\SortableIterator($iterator, $this->sort);
- $iterator = $iteratorAggregate->getIterator();
- }
- return $iterator;
- }
- public function getName()
- {
- return 'php';
- }
- protected function canBeUsed()
- {
- return true;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Comparator;
- class Comparator
- {
- private $target;
- private $operator = '==';
- public function getTarget()
- {
- return $this->target;
- }
- public function setTarget($target)
- {
- $this->target = $target;
- }
- public function getOperator()
- {
- return $this->operator;
- }
- public function setOperator($operator)
- {
- if (!$operator) {
- $operator = '==';
- }
- if (!in_array($operator, array('>', '<', '>=', '<=', '==', '!='))) {
- throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator));
- }
- $this->operator = $operator;
- }
- public function test($test)
- {
- switch ($this->operator) {
- case '>':
- return $test > $this->target;
- case '>=':
- return $test >= $this->target;
- case '<':
- return $test < $this->target;
- case '<=':
- return $test <= $this->target;
- case '!=':
- return $test != $this->target;
- }
- return $test == $this->target;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Comparator;
- class DateComparator extends Comparator
- {
- public function __construct($test)
- {
- if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) {
- throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test));
- }
- try {
- $date = new \DateTime($matches[2]);
- $target = $date->format('U');
- } catch (\Exception $e) {
- throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2]));
- }
- $operator = isset($matches[1]) ? $matches[1] : '==';
- if ('since' === $operator || 'after' === $operator) {
- $operator = '>';
- }
- if ('until' === $operator || 'before' === $operator) {
- $operator = '<';
- }
- $this->setOperator($operator);
- $this->setTarget($target);
- }
- }
- <?php
- namespace Symfony\Component\Finder\Comparator;
- class NumberComparator extends Comparator
- {
- public function __construct($test)
- {
- if (!preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) {
- throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test));
- }
- $target = $matches[2];
- if (!is_numeric($target)) {
- throw new \InvalidArgumentException(sprintf('Invalid number "%s".', $target));
- }
- if (isset($matches[3])) {
- switch (strtolower($matches[3])) {
- case 'k':
- $target *= 1000;
- break;
- case 'ki':
- $target *= 1024;
- break;
- case 'm':
- $target *= 1000000;
- break;
- case 'mi':
- $target *= 1024 * 1024;
- break;
- case 'g':
- $target *= 1000000000;
- break;
- case 'gi':
- $target *= 1024 * 1024 * 1024;
- break;
- }
- }
- $this->setTarget($target);
- $this->setOperator(isset($matches[1]) ? $matches[1] : '==');
- }
- }
- <?php
- namespace Symfony\Component\Finder\Exception;
- class AccessDeniedException extends \UnexpectedValueException
- {
- }
- <?php
- namespace Symfony\Component\Finder\Exception;
- @trigger_error('The '.__NAMESPACE__.'\AdapterFailureException class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- use Symfony\Component\Finder\Adapter\AdapterInterface;
- class AdapterFailureException extends \RuntimeException implements ExceptionInterface
- {
- private $adapter;
- public function __construct(AdapterInterface $adapter, $message = null, \Exception $previous = null)
- {
- $this->adapter = $adapter;
- parent::__construct($message ?: 'Search failed with "'.$adapter->getName().'" adapter.', $previous);
- }
- public function getAdapter()
- {
- return $this->adapter;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Exception;
- interface ExceptionInterface
- {
- public function getAdapter();
- }
- <?php
- namespace Symfony\Component\Finder\Exception;
- @trigger_error('The '.__NAMESPACE__.'\OperationNotPermitedException class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- class OperationNotPermitedException extends AdapterFailureException
- {
- }
- <?php
- namespace Symfony\Component\Finder\Exception;
- @trigger_error('The '.__NAMESPACE__.'\ShellCommandFailureException class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- use Symfony\Component\Finder\Adapter\AdapterInterface;
- use Symfony\Component\Finder\Shell\Command;
- class ShellCommandFailureException extends AdapterFailureException
- {
- private $command;
- public function __construct(AdapterInterface $adapter, Command $command, \Exception $previous = null)
- {
- $this->command = $command;
- parent::__construct($adapter, 'Shell command failed: "'.$command->join().'".', $previous);
- }
- public function getCommand()
- {
- return $this->command;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Expression;
- @trigger_error('The '.__NAMESPACE__.'\Expression class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- class Expression implements ValueInterface
- {
- const TYPE_REGEX = 1;
- const TYPE_GLOB = 2;
- private $value;
- public static function create($expr)
- {
- return new self($expr);
- }
- public function __construct($expr)
- {
- try {
- $this->value = Regex::create($expr);
- } catch (\InvalidArgumentException $e) {
- $this->value = new Glob($expr);
- }
- }
- public function __toString()
- {
- return $this->render();
- }
- public function render()
- {
- return $this->value->render();
- }
- public function renderPattern()
- {
- return $this->value->renderPattern();
- }
- public function isCaseSensitive()
- {
- return $this->value->isCaseSensitive();
- }
- public function getType()
- {
- return $this->value->getType();
- }
- public function prepend($expr)
- {
- $this->value->prepend($expr);
- return $this;
- }
- public function append($expr)
- {
- $this->value->append($expr);
- return $this;
- }
- public function isRegex()
- {
- return self::TYPE_REGEX === $this->value->getType();
- }
- public function isGlob()
- {
- return self::TYPE_GLOB === $this->value->getType();
- }
- public function getGlob()
- {
- if (self::TYPE_GLOB !== $this->value->getType()) {
- throw new \LogicException('Regex can\'t be transformed to glob.');
- }
- return $this->value;
- }
- public function getRegex()
- {
- return self::TYPE_REGEX === $this->value->getType() ? $this->value : $this->value->toRegex();
- }
- }
- <?php
- namespace Symfony\Component\Finder\Expression;
- @trigger_error('The '.__NAMESPACE__.'\Glob class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- use Symfony\Component\Finder\Glob as FinderGlob;
- class Glob implements ValueInterface
- {
- private $pattern;
- public function __construct($pattern)
- {
- $this->pattern = $pattern;
- }
- public function render()
- {
- return $this->pattern;
- }
- public function renderPattern()
- {
- return $this->pattern;
- }
- public function getType()
- {
- return Expression::TYPE_GLOB;
- }
- public function isCaseSensitive()
- {
- return true;
- }
- public function prepend($expr)
- {
- $this->pattern = $expr.$this->pattern;
- return $this;
- }
- public function append($expr)
- {
- $this->pattern .= $expr;
- return $this;
- }
- public function isExpandable()
- {
- return false !== strpos($this->pattern, '{')
- && false !== strpos($this->pattern, '}');
- }
- public function toRegex($strictLeadingDot = true, $strictWildcardSlash = true)
- {
- $regex = FinderGlob::toRegex($this->pattern, $strictLeadingDot, $strictWildcardSlash, '');
- return new Regex($regex);
- }
- }
- <?php
- namespace Symfony\Component\Finder\Expression;
- @trigger_error('The '.__NAMESPACE__.'\Regex class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- class Regex implements ValueInterface
- {
- const START_FLAG = '^';
- const END_FLAG = '$';
- const BOUNDARY = '~';
- const JOKER = '.*';
- const ESCAPING = '\\';
- private $pattern;
- private $options;
- private $startFlag;
- private $endFlag;
- private $startJoker;
- private $endJoker;
- public static function create($expr)
- {
- if (preg_match('/^(.{3,}?)([imsxuADU]*)$/', $expr, $m)) {
- $start = substr($m[1], 0, 1);
- $end = substr($m[1], -1);
- if (
- ($start === $end && !preg_match('/[*?[:alnum:] \\\\]/', $start))
- || ($start === '{' && $end === '}')
- || ($start === '(' && $end === ')')
- ) {
- return new self(substr($m[1], 1, -1), $m[2], $end);
- }
- }
- throw new \InvalidArgumentException('Given expression is not a regex.');
- }
- public function __construct($pattern, $options = '', $delimiter = null)
- {
- if (null !== $delimiter) {
- $pattern = str_replace('\\'.$delimiter, $delimiter, $pattern);
- }
- $this->parsePattern($pattern);
- $this->options = $options;
- }
- public function __toString()
- {
- return $this->render();
- }
- public function render()
- {
- return self::BOUNDARY
- .$this->renderPattern()
- .self::BOUNDARY
- .$this->options;
- }
- public function renderPattern()
- {
- return ($this->startFlag ? self::START_FLAG : '')
- .($this->startJoker ? self::JOKER : '')
- .str_replace(self::BOUNDARY, '\\'.self::BOUNDARY, $this->pattern)
- .($this->endJoker ? self::JOKER : '')
- .($this->endFlag ? self::END_FLAG : '');
- }
- public function isCaseSensitive()
- {
- return !$this->hasOption('i');
- }
- public function getType()
- {
- return Expression::TYPE_REGEX;
- }
- public function prepend($expr)
- {
- $this->pattern = $expr.$this->pattern;
- return $this;
- }
- public function append($expr)
- {
- $this->pattern .= $expr;
- return $this;
- }
- public function hasOption($option)
- {
- return false !== strpos($this->options, $option);
- }
- public function addOption($option)
- {
- if (!$this->hasOption($option)) {
- $this->options .= $option;
- }
- return $this;
- }
- public function removeOption($option)
- {
- $this->options = str_replace($option, '', $this->options);
- return $this;
- }
- public function setStartFlag($startFlag)
- {
- $this->startFlag = $startFlag;
- return $this;
- }
- public function hasStartFlag()
- {
- return $this->startFlag;
- }
- public function setEndFlag($endFlag)
- {
- $this->endFlag = (bool) $endFlag;
- return $this;
- }
- public function hasEndFlag()
- {
- return $this->endFlag;
- }
- public function setStartJoker($startJoker)
- {
- $this->startJoker = $startJoker;
- return $this;
- }
- public function hasStartJoker()
- {
- return $this->startJoker;
- }
- public function setEndJoker($endJoker)
- {
- $this->endJoker = (bool) $endJoker;
- return $this;
- }
- public function hasEndJoker()
- {
- return $this->endJoker;
- }
- public function replaceJokers($replacement)
- {
- $replace = function ($subject) use ($replacement) {
- $subject = $subject[0];
- $replace = 0 === substr_count($subject, '\\') % 2;
- return $replace ? str_replace('.', $replacement, $subject) : $subject;
- };
- $this->pattern = preg_replace_callback('~[\\\\]*\\.~', $replace, $this->pattern);
- return $this;
- }
- private function parsePattern($pattern)
- {
- if ($this->startFlag = self::START_FLAG === substr($pattern, 0, 1)) {
- $pattern = substr($pattern, 1);
- }
- if ($this->startJoker = self::JOKER === substr($pattern, 0, 2)) {
- $pattern = substr($pattern, 2);
- }
- if ($this->endFlag = (self::END_FLAG === substr($pattern, -1) && self::ESCAPING !== substr($pattern, -2, -1))) {
- $pattern = substr($pattern, 0, -1);
- }
- if ($this->endJoker = (self::JOKER === substr($pattern, -2) && self::ESCAPING !== substr($pattern, -3, -2))) {
- $pattern = substr($pattern, 0, -2);
- }
- $this->pattern = $pattern;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Expression;
- @trigger_error('The '.__NAMESPACE__.'\ValueInterface interface is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- interface ValueInterface
- {
- public function render();
- public function renderPattern();
- public function isCaseSensitive();
- public function getType();
- public function prepend($expr);
- public function append($expr);
- }
- <?php
- namespace Symfony\Component\Finder;
- use Symfony\Component\Finder\Adapter\AdapterInterface;
- use Symfony\Component\Finder\Adapter\GnuFindAdapter;
- use Symfony\Component\Finder\Adapter\BsdFindAdapter;
- use Symfony\Component\Finder\Adapter\PhpAdapter;
- use Symfony\Component\Finder\Comparator\DateComparator;
- use Symfony\Component\Finder\Comparator\NumberComparator;
- use Symfony\Component\Finder\Exception\ExceptionInterface;
- use Symfony\Component\Finder\Iterator\CustomFilterIterator;
- use Symfony\Component\Finder\Iterator\DateRangeFilterIterator;
- use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator;
- use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator;
- use Symfony\Component\Finder\Iterator\FilecontentFilterIterator;
- use Symfony\Component\Finder\Iterator\FilenameFilterIterator;
- use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator;
- use Symfony\Component\Finder\Iterator\SortableIterator;
- class Finder implements \IteratorAggregate, \Countable
- {
- const IGNORE_VCS_FILES = 1;
- const IGNORE_DOT_FILES = 2;
- private $mode = 0;
- private $names = array();
- private $notNames = array();
- private $exclude = array();
- private $filters = array();
- private $depths = array();
- private $sizes = array();
- private $followLinks = false;
- private $sort = false;
- private $ignore = 0;
- private $dirs = array();
- private $dates = array();
- private $iterators = array();
- private $contains = array();
- private $notContains = array();
- private $adapters = null;
- private $paths = array();
- private $notPaths = array();
- private $ignoreUnreadableDirs = false;
- private static $vcsPatterns = array('.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg');
- public function __construct()
- {
- $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES;
- }
- public static function create()
- {
- return new static();
- }
- public function addAdapter(AdapterInterface $adapter, $priority = 0)
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- $this->initDefaultAdapters();
- $this->adapters[$adapter->getName()] = array(
- 'adapter' => $adapter,
- 'priority' => $priority,
- 'selected' => false,
- );
- return $this->sortAdapters();
- }
- public function useBestAdapter()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- $this->initDefaultAdapters();
- $this->resetAdapterSelection();
- return $this->sortAdapters();
- }
- public function setAdapter($name)
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- $this->initDefaultAdapters();
- if (!isset($this->adapters[$name])) {
- throw new \InvalidArgumentException(sprintf('Adapter "%s" does not exist.', $name));
- }
- $this->resetAdapterSelection();
- $this->adapters[$name]['selected'] = true;
- return $this->sortAdapters();
- }
- public function removeAdapters()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- $this->adapters = array();
- return $this;
- }
- public function getAdapters()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- $this->initDefaultAdapters();
- return array_values(array_map(function (array $adapter) {
- return $adapter['adapter'];
- }, $this->adapters));
- }
- public function directories()
- {
- $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES;
- return $this;
- }
- public function files()
- {
- $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES;
- return $this;
- }
- public function depth($level)
- {
- $this->depths[] = new Comparator\NumberComparator($level);
- return $this;
- }
- public function date($date)
- {
- $this->dates[] = new Comparator\DateComparator($date);
- return $this;
- }
- public function name($pattern)
- {
- $this->names[] = $pattern;
- return $this;
- }
- public function notName($pattern)
- {
- $this->notNames[] = $pattern;
- return $this;
- }
- public function contains($pattern)
- {
- $this->contains[] = $pattern;
- return $this;
- }
- public function notContains($pattern)
- {
- $this->notContains[] = $pattern;
- return $this;
- }
- public function path($pattern)
- {
- $this->paths[] = $pattern;
- return $this;
- }
- public function notPath($pattern)
- {
- $this->notPaths[] = $pattern;
- return $this;
- }
- public function size($size)
- {
- $this->sizes[] = new Comparator\NumberComparator($size);
- return $this;
- }
- public function exclude($dirs)
- {
- $this->exclude = array_merge($this->exclude, (array) $dirs);
- return $this;
- }
- public function ignoreDotFiles($ignoreDotFiles)
- {
- if ($ignoreDotFiles) {
- $this->ignore |= static::IGNORE_DOT_FILES;
- } else {
- $this->ignore &= ~static::IGNORE_DOT_FILES;
- }
- return $this;
- }
- public function ignoreVCS($ignoreVCS)
- {
- if ($ignoreVCS) {
- $this->ignore |= static::IGNORE_VCS_FILES;
- } else {
- $this->ignore &= ~static::IGNORE_VCS_FILES;
- }
- return $this;
- }
- public static function addVCSPattern($pattern)
- {
- foreach ((array) $pattern as $p) {
- self::$vcsPatterns[] = $p;
- }
- self::$vcsPatterns = array_unique(self::$vcsPatterns);
- }
- public function sort(\Closure $closure)
- {
- $this->sort = $closure;
- return $this;
- }
- public function sortByName()
- {
- $this->sort = Iterator\SortableIterator::SORT_BY_NAME;
- return $this;
- }
- public function sortByType()
- {
- $this->sort = Iterator\SortableIterator::SORT_BY_TYPE;
- return $this;
- }
- public function sortByAccessedTime()
- {
- $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME;
- return $this;
- }
- public function sortByChangedTime()
- {
- $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME;
- return $this;
- }
- public function sortByModifiedTime()
- {
- $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME;
- return $this;
- }
- public function filter(\Closure $closure)
- {
- $this->filters[] = $closure;
- return $this;
- }
- public function followLinks()
- {
- $this->followLinks = true;
- return $this;
- }
- public function ignoreUnreadableDirs($ignore = true)
- {
- $this->ignoreUnreadableDirs = (bool) $ignore;
- return $this;
- }
- public function in($dirs)
- {
- $resolvedDirs = array();
- foreach ((array) $dirs as $dir) {
- if (is_dir($dir)) {
- $resolvedDirs[] = $dir;
- } elseif ($glob = glob($dir, (defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) {
- $resolvedDirs = array_merge($resolvedDirs, $glob);
- } else {
- throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir));
- }
- }
- $this->dirs = array_merge($this->dirs, $resolvedDirs);
- return $this;
- }
- public function getIterator()
- {
- if (0 === count($this->dirs) && 0 === count($this->iterators)) {
- throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.');
- }
- if (1 === count($this->dirs) && 0 === count($this->iterators)) {
- return $this->searchInDirectory($this->dirs[0]);
- }
- $iterator = new \AppendIterator();
- foreach ($this->dirs as $dir) {
- $iterator->append($this->searchInDirectory($dir));
- }
- foreach ($this->iterators as $it) {
- $iterator->append($it);
- }
- return $iterator;
- }
- public function append($iterator)
- {
- if ($iterator instanceof \IteratorAggregate) {
- $this->iterators[] = $iterator->getIterator();
- } elseif ($iterator instanceof \Iterator) {
- $this->iterators[] = $iterator;
- } elseif ($iterator instanceof \Traversable || is_array($iterator)) {
- $it = new \ArrayIterator();
- foreach ($iterator as $file) {
- $it->append($file instanceof \SplFileInfo ? $file : new \SplFileInfo($file));
- }
- $this->iterators[] = $it;
- } else {
- throw new \InvalidArgumentException('Finder::append() method wrong argument type.');
- }
- return $this;
- }
- public function count()
- {
- return iterator_count($this->getIterator());
- }
- private function sortAdapters()
- {
- uasort($this->adapters, function (array $a, array $b) {
- if ($a['selected'] || $b['selected']) {
- return $a['selected'] ? -1 : 1;
- }
- return $a['priority'] > $b['priority'] ? -1 : 1;
- });
- return $this;
- }
- private function searchInDirectory($dir)
- {
- if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) {
- $this->exclude = array_merge($this->exclude, self::$vcsPatterns);
- }
- if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) {
- $this->notPaths[] = '#(^|/)\..+(/|$)#';
- }
- if ($this->adapters) {
- foreach ($this->adapters as $adapter) {
- if ($adapter['adapter']->isSupported()) {
- try {
- return $this
- ->buildAdapter($adapter['adapter'])
- ->searchInDirectory($dir);
- } catch (ExceptionInterface $e) {
- }
- }
- }
- }
- $minDepth = 0;
- $maxDepth = PHP_INT_MAX;
- foreach ($this->depths as $comparator) {
- switch ($comparator->getOperator()) {
- case '>':
- $minDepth = $comparator->getTarget() + 1;
- break;
- case '>=':
- $minDepth = $comparator->getTarget();
- break;
- case '<':
- $maxDepth = $comparator->getTarget() - 1;
- break;
- case '<=':
- $maxDepth = $comparator->getTarget();
- break;
- default:
- $minDepth = $maxDepth = $comparator->getTarget();
- }
- }
- $flags = \RecursiveDirectoryIterator::SKIP_DOTS;
- if ($this->followLinks) {
- $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS;
- }
- $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs);
- if ($this->exclude) {
- $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $this->exclude);
- }
- $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST);
- if ($minDepth > 0 || $maxDepth < PHP_INT_MAX) {
- $iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth);
- }
- if ($this->mode) {
- $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode);
- }
- if ($this->names || $this->notNames) {
- $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames);
- }
- if ($this->contains || $this->notContains) {
- $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains);
- }
- if ($this->sizes) {
- $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes);
- }
- if ($this->dates) {
- $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates);
- }
- if ($this->filters) {
- $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters);
- }
- if ($this->paths || $this->notPaths) {
- $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $this->notPaths);
- }
- if ($this->sort) {
- $iteratorAggregate = new Iterator\SortableIterator($iterator, $this->sort);
- $iterator = $iteratorAggregate->getIterator();
- }
- return $iterator;
- }
- private function buildAdapter(AdapterInterface $adapter)
- {
- return $adapter
- ->setFollowLinks($this->followLinks)
- ->setDepths($this->depths)
- ->setMode($this->mode)
- ->setExclude($this->exclude)
- ->setNames($this->names)
- ->setNotNames($this->notNames)
- ->setContains($this->contains)
- ->setNotContains($this->notContains)
- ->setSizes($this->sizes)
- ->setDates($this->dates)
- ->setFilters($this->filters)
- ->setSort($this->sort)
- ->setPath($this->paths)
- ->setNotPath($this->notPaths)
- ->ignoreUnreadableDirs($this->ignoreUnreadableDirs);
- }
- private function resetAdapterSelection()
- {
- $this->adapters = array_map(function (array $properties) {
- $properties['selected'] = false;
- return $properties;
- }, $this->adapters);
- }
- private function initDefaultAdapters()
- {
- if (null === $this->adapters) {
- $this->adapters = array();
- $this
- ->addAdapter(new GnuFindAdapter())
- ->addAdapter(new BsdFindAdapter())
- ->addAdapter(new PhpAdapter(), -50)
- ->setAdapter('php')
- ;
- }
- }
- }
- <?php
- namespace Symfony\Component\Finder;
- class Glob
- {
- public static function toRegex($glob, $strictLeadingDot = true, $strictWildcardSlash = true, $delimiter = '#')
- {
- $firstByte = true;
- $escaping = false;
- $inCurlies = 0;
- $regex = '';
- $sizeGlob = strlen($glob);
- for ($i = 0; $i < $sizeGlob; ++$i) {
- $car = $glob[$i];
- if ($firstByte) {
- if ($strictLeadingDot && '.' !== $car) {
- $regex .= '(?=[^\.])';
- }
- $firstByte = false;
- }
- if ('/' === $car) {
- $firstByte = true;
- }
- if ('.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) {
- $regex .= "\\$car";
- } elseif ('*' === $car) {
- $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*');
- } elseif ('?' === $car) {
- $regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.');
- } elseif ('{' === $car) {
- $regex .= $escaping ? '\\{' : '(';
- if (!$escaping) {
- ++$inCurlies;
- }
- } elseif ('}' === $car && $inCurlies) {
- $regex .= $escaping ? '}' : ')';
- if (!$escaping) {
- --$inCurlies;
- }
- } elseif (',' === $car && $inCurlies) {
- $regex .= $escaping ? ',' : '|';
- } elseif ('\\' === $car) {
- if ($escaping) {
- $regex .= '\\\\';
- $escaping = false;
- } else {
- $escaping = true;
- }
- continue;
- } else {
- $regex .= $car;
- }
- $escaping = false;
- }
- return $delimiter.'^'.$regex.'$'.$delimiter;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- class CustomFilterIterator extends FilterIterator
- {
- private $filters = array();
- public function __construct(\Iterator $iterator, array $filters)
- {
- foreach ($filters as $filter) {
- if (!is_callable($filter)) {
- throw new \InvalidArgumentException('Invalid PHP callback.');
- }
- }
- $this->filters = $filters;
- parent::__construct($iterator);
- }
- public function accept()
- {
- $fileinfo = $this->current();
- foreach ($this->filters as $filter) {
- if (false === call_user_func($filter, $fileinfo)) {
- return false;
- }
- }
- return true;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- use Symfony\Component\Finder\Comparator\DateComparator;
- class DateRangeFilterIterator extends FilterIterator
- {
- private $comparators = array();
- public function __construct(\Iterator $iterator, array $comparators)
- {
- $this->comparators = $comparators;
- parent::__construct($iterator);
- }
- public function accept()
- {
- $fileinfo = $this->current();
- if (!file_exists($fileinfo->getRealPath())) {
- return false;
- }
- $filedate = $fileinfo->getMTime();
- foreach ($this->comparators as $compare) {
- if (!$compare->test($filedate)) {
- return false;
- }
- }
- return true;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- class DepthRangeFilterIterator extends FilterIterator
- {
- private $minDepth = 0;
- public function __construct(\RecursiveIteratorIterator $iterator, $minDepth = 0, $maxDepth = PHP_INT_MAX)
- {
- $this->minDepth = $minDepth;
- $iterator->setMaxDepth(PHP_INT_MAX === $maxDepth ? -1 : $maxDepth);
- parent::__construct($iterator);
- }
- public function accept()
- {
- return $this->getInnerIterator()->getDepth() >= $this->minDepth;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- class ExcludeDirectoryFilterIterator extends FilterIterator implements \RecursiveIterator
- {
- private $iterator;
- private $isRecursive;
- private $excludedDirs = array();
- private $excludedPattern;
- public function __construct(\Iterator $iterator, array $directories)
- {
- $this->iterator = $iterator;
- $this->isRecursive = $iterator instanceof \RecursiveIterator;
- $patterns = array();
- foreach ($directories as $directory) {
- if (!$this->isRecursive || false !== strpos($directory, '/')) {
- $patterns[] = preg_quote($directory, '#');
- } else {
- $this->excludedDirs[$directory] = true;
- }
- }
- if ($patterns) {
- $this->excludedPattern = '#(?:^|/)(?:'.implode('|', $patterns).')(?:/|$)#';
- }
- parent::__construct($iterator);
- }
- public function accept()
- {
- if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) {
- return false;
- }
- if ($this->excludedPattern) {
- $path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath();
- $path = str_replace('\\', '/', $path);
- return !preg_match($this->excludedPattern, $path);
- }
- return true;
- }
- public function hasChildren()
- {
- return $this->isRecursive && $this->iterator->hasChildren();
- }
- public function getChildren()
- {
- $children = new self($this->iterator->getChildren(), array());
- $children->excludedDirs = $this->excludedDirs;
- $children->excludedPattern = $this->excludedPattern;
- return $children;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- @trigger_error('The '.__NAMESPACE__.'\FilePathsIterator class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- use Symfony\Component\Finder\SplFileInfo;
- class FilePathsIterator extends \ArrayIterator
- {
- private $baseDir;
- private $baseDirLength;
- private $subPath;
- private $subPathname;
- private $current;
- public function __construct(array $paths, $baseDir)
- {
- $this->baseDir = $baseDir;
- $this->baseDirLength = strlen($baseDir);
- parent::__construct($paths);
- }
- public function __call($name, array $arguments)
- {
- return call_user_func_array(array($this->current(), $name), $arguments);
- }
- public function current()
- {
- return $this->current;
- }
- public function key()
- {
- return $this->current->getPathname();
- }
- public function next()
- {
- parent::next();
- $this->buildProperties();
- }
- public function rewind()
- {
- parent::rewind();
- $this->buildProperties();
- }
- public function getSubPath()
- {
- return $this->subPath;
- }
- public function getSubPathname()
- {
- return $this->subPathname;
- }
- private function buildProperties()
- {
- $absolutePath = parent::current();
- if ($this->baseDir === substr($absolutePath, 0, $this->baseDirLength)) {
- $this->subPathname = ltrim(substr($absolutePath, $this->baseDirLength), '/\\');
- $dir = dirname($this->subPathname);
- $this->subPath = '.' === $dir ? '' : $dir;
- } else {
- $this->subPath = $this->subPathname = '';
- }
- $this->current = new SplFileInfo(parent::current(), $this->subPath, $this->subPathname);
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- class FileTypeFilterIterator extends FilterIterator
- {
- const ONLY_FILES = 1;
- const ONLY_DIRECTORIES = 2;
- private $mode;
- public function __construct(\Iterator $iterator, $mode)
- {
- $this->mode = $mode;
- parent::__construct($iterator);
- }
- public function accept()
- {
- $fileinfo = $this->current();
- if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) {
- return false;
- } elseif (self::ONLY_FILES === (self::ONLY_FILES & $this->mode) && $fileinfo->isDir()) {
- return false;
- }
- return true;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- class FilecontentFilterIterator extends MultiplePcreFilterIterator
- {
- public function accept()
- {
- if (!$this->matchRegexps && !$this->noMatchRegexps) {
- return true;
- }
- $fileinfo = $this->current();
- if ($fileinfo->isDir() || !$fileinfo->isReadable()) {
- return false;
- }
- $content = $fileinfo->getContents();
- if (!$content) {
- return false;
- }
- return $this->isAccepted($content);
- }
- protected function toRegex($str)
- {
- return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/';
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- use Symfony\Component\Finder\Glob;
- class FilenameFilterIterator extends MultiplePcreFilterIterator
- {
- public function accept()
- {
- return $this->isAccepted($this->current()->getFilename());
- }
- protected function toRegex($str)
- {
- return $this->isRegex($str) ? $str : Glob::toRegex($str);
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- abstract class FilterIterator extends \FilterIterator
- {
- public function rewind()
- {
- $iterator = $this;
- while ($iterator instanceof \OuterIterator) {
- $innerIterator = $iterator->getInnerIterator();
- if ($innerIterator instanceof RecursiveDirectoryIterator) {
- if ($innerIterator->isRewindable()) {
- $innerIterator->next();
- $innerIterator->rewind();
- }
- } elseif ($iterator->getInnerIterator() instanceof \FilesystemIterator) {
- $iterator->getInnerIterator()->next();
- $iterator->getInnerIterator()->rewind();
- }
- $iterator = $iterator->getInnerIterator();
- }
- parent::rewind();
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- abstract class MultiplePcreFilterIterator extends FilterIterator
- {
- protected $matchRegexps = array();
- protected $noMatchRegexps = array();
- public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns)
- {
- foreach ($matchPatterns as $pattern) {
- $this->matchRegexps[] = $this->toRegex($pattern);
- }
- foreach ($noMatchPatterns as $pattern) {
- $this->noMatchRegexps[] = $this->toRegex($pattern);
- }
- parent::__construct($iterator);
- }
- protected function isAccepted($string)
- {
- foreach ($this->noMatchRegexps as $regex) {
- if (preg_match($regex, $string)) {
- return false;
- }
- }
- if ($this->matchRegexps) {
- foreach ($this->matchRegexps as $regex) {
- if (preg_match($regex, $string)) {
- return true;
- }
- }
- return false;
- }
- return true;
- }
- protected function isRegex($str)
- {
- if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) {
- $start = substr($m[1], 0, 1);
- $end = substr($m[1], -1);
- if ($start === $end) {
- return !preg_match('/[*?[:alnum:] \\\\]/', $start);
- }
- foreach (array(array('{', '}'), array('(', ')'), array('[', ']'), array('<', '>')) as $delimiters) {
- if ($start === $delimiters[0] && $end === $delimiters[1]) {
- return true;
- }
- }
- }
- return false;
- }
- abstract protected function toRegex($str);
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- class PathFilterIterator extends MultiplePcreFilterIterator
- {
- public function accept()
- {
- $filename = $this->current()->getRelativePathname();
- if ('\\' === DIRECTORY_SEPARATOR) {
- $filename = str_replace('\\', '/', $filename);
- }
- return $this->isAccepted($filename);
- }
- protected function toRegex($str)
- {
- return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/';
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- use Symfony\Component\Finder\Exception\AccessDeniedException;
- use Symfony\Component\Finder\SplFileInfo;
- class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
- {
- private $ignoreUnreadableDirs;
- private $rewindable;
- private $rootPath;
- private $subPath;
- private $directorySeparator = '/';
- public function __construct($path, $flags, $ignoreUnreadableDirs = false)
- {
- if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) {
- throw new \RuntimeException('This iterator only support returning current as fileinfo.');
- }
- parent::__construct($path, $flags);
- $this->ignoreUnreadableDirs = $ignoreUnreadableDirs;
- $this->rootPath = (string) $path;
- if ('/' !== DIRECTORY_SEPARATOR && !($flags & self::UNIX_PATHS)) {
- $this->directorySeparator = DIRECTORY_SEPARATOR;
- }
- }
- public function current()
- {
- if (null === $subPathname = $this->subPath) {
- $subPathname = $this->subPath = (string) $this->getSubPath();
- }
- if ('' !== $subPathname) {
- $subPathname .= $this->directorySeparator;
- }
- $subPathname .= $this->getFilename();
- return new SplFileInfo($this->rootPath.$this->directorySeparator.$subPathname, $this->subPath, $subPathname);
- }
- public function getChildren()
- {
- try {
- $children = parent::getChildren();
- if ($children instanceof self) {
- $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs;
- $children->rewindable = &$this->rewindable;
- $children->rootPath = $this->rootPath;
- }
- return $children;
- } catch (\UnexpectedValueException $e) {
- if ($this->ignoreUnreadableDirs) {
- return new \RecursiveArrayIterator(array());
- } else {
- throw new AccessDeniedException($e->getMessage(), $e->getCode(), $e);
- }
- }
- }
- public function rewind()
- {
- if (false === $this->isRewindable()) {
- return;
- }
- parent::next();
- parent::rewind();
- }
- public function isRewindable()
- {
- if (null !== $this->rewindable) {
- return $this->rewindable;
- }
- if (false !== $stream = @opendir($this->getPath())) {
- $infos = stream_get_meta_data($stream);
- closedir($stream);
- if ($infos['seekable']) {
- return $this->rewindable = true;
- }
- }
- return $this->rewindable = false;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- use Symfony\Component\Finder\Comparator\NumberComparator;
- class SizeRangeFilterIterator extends FilterIterator
- {
- private $comparators = array();
- public function __construct(\Iterator $iterator, array $comparators)
- {
- $this->comparators = $comparators;
- parent::__construct($iterator);
- }
- public function accept()
- {
- $fileinfo = $this->current();
- if (!$fileinfo->isFile()) {
- return true;
- }
- $filesize = $fileinfo->getSize();
- foreach ($this->comparators as $compare) {
- if (!$compare->test($filesize)) {
- return false;
- }
- }
- return true;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Iterator;
- class SortableIterator implements \IteratorAggregate
- {
- const SORT_BY_NAME = 1;
- const SORT_BY_TYPE = 2;
- const SORT_BY_ACCESSED_TIME = 3;
- const SORT_BY_CHANGED_TIME = 4;
- const SORT_BY_MODIFIED_TIME = 5;
- private $iterator;
- private $sort;
- public function __construct(\Traversable $iterator, $sort)
- {
- $this->iterator = $iterator;
- if (self::SORT_BY_NAME === $sort) {
- $this->sort = function ($a, $b) {
- return strcmp($a->getRealpath(), $b->getRealpath());
- };
- } elseif (self::SORT_BY_TYPE === $sort) {
- $this->sort = function ($a, $b) {
- if ($a->isDir() && $b->isFile()) {
- return -1;
- } elseif ($a->isFile() && $b->isDir()) {
- return 1;
- }
- return strcmp($a->getRealpath(), $b->getRealpath());
- };
- } elseif (self::SORT_BY_ACCESSED_TIME === $sort) {
- $this->sort = function ($a, $b) {
- return $a->getATime() - $b->getATime();
- };
- } elseif (self::SORT_BY_CHANGED_TIME === $sort) {
- $this->sort = function ($a, $b) {
- return $a->getCTime() - $b->getCTime();
- };
- } elseif (self::SORT_BY_MODIFIED_TIME === $sort) {
- $this->sort = function ($a, $b) {
- return $a->getMTime() - $b->getMTime();
- };
- } elseif (is_callable($sort)) {
- $this->sort = $sort;
- } else {
- throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.');
- }
- }
- public function getIterator()
- {
- $array = iterator_to_array($this->iterator, true);
- uasort($array, $this->sort);
- return new \ArrayIterator($array);
- }
- }
- Copyright (c) 2004-2016 Fabien Potencier
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is furnished
- to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- <?php
- namespace Symfony\Component\Finder\Shell;
- @trigger_error('The '.__NAMESPACE__.'\Command class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- class Command
- {
- private $parent;
- private $bits = array();
- private $labels = array();
- private $errorHandler;
- public function __construct(Command $parent = null)
- {
- $this->parent = $parent;
- }
- public function __toString()
- {
- return $this->join();
- }
- public static function create(Command $parent = null)
- {
- return new self($parent);
- }
- public static function escape($input)
- {
- return escapeshellcmd($input);
- }
- public static function quote($input)
- {
- return escapeshellarg($input);
- }
- public function add($bit)
- {
- $this->bits[] = $bit;
- return $this;
- }
- public function top($bit)
- {
- array_unshift($this->bits, $bit);
- foreach ($this->labels as $label => $index) {
- $this->labels[$label] += 1;
- }
- return $this;
- }
- public function arg($arg)
- {
- $this->bits[] = self::quote($arg);
- return $this;
- }
- public function cmd($esc)
- {
- $this->bits[] = self::escape($esc);
- return $this;
- }
- public function ins($label)
- {
- if (isset($this->labels[$label])) {
- throw new \RuntimeException(sprintf('Label "%s" already exists.', $label));
- }
- $this->bits[] = self::create($this);
- $this->labels[$label] = count($this->bits) - 1;
- return $this->bits[$this->labels[$label]];
- }
- public function get($label)
- {
- if (!isset($this->labels[$label])) {
- throw new \RuntimeException(sprintf('Label "%s" does not exist.', $label));
- }
- return $this->bits[$this->labels[$label]];
- }
- public function end()
- {
- if (null === $this->parent) {
- throw new \RuntimeException('Calling end on root command doesn\'t make sense.');
- }
- return $this->parent;
- }
- public function length()
- {
- return count($this->bits);
- }
- public function setErrorHandler(\Closure $errorHandler)
- {
- $this->errorHandler = $errorHandler;
- return $this;
- }
- public function getErrorHandler()
- {
- return $this->errorHandler;
- }
- public function execute()
- {
- if (null === $errorHandler = $this->errorHandler) {
- exec($this->join(), $output);
- } else {
- $process = proc_open($this->join(), array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $pipes);
- $output = preg_split('~(\r\n|\r|\n)~', stream_get_contents($pipes[1]), -1, PREG_SPLIT_NO_EMPTY);
- if ($error = stream_get_contents($pipes[2])) {
- $errorHandler($error);
- }
- proc_close($process);
- }
- return $output ?: array();
- }
- public function join()
- {
- return implode(' ', array_filter(
- array_map(function ($bit) {
- return $bit instanceof Command ? $bit->join() : ($bit ?: null);
- }, $this->bits),
- function ($bit) { return null !== $bit; }
- ));
- }
- public function addAtIndex($bit, $index)
- {
- array_splice($this->bits, $index, 0, $bit instanceof self ? array($bit) : $bit);
- return $this;
- }
- }
- <?php
- namespace Symfony\Component\Finder\Shell;
- @trigger_error('The '.__NAMESPACE__.'\Shell class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
- class Shell
- {
- const TYPE_UNIX = 1;
- const TYPE_DARWIN = 2;
- const TYPE_CYGWIN = 3;
- const TYPE_WINDOWS = 4;
- const TYPE_BSD = 5;
- private $type;
- public function getType()
- {
- if (null === $this->type) {
- $this->type = $this->guessType();
- }
- return $this->type;
- }
- public function testCommand($command)
- {
- if (!function_exists('exec')) {
- return false;
- }
- $testCommand = 'which ';
- if (self::TYPE_WINDOWS === $this->type) {
- $testCommand = 'where ';
- }
- $command = escapeshellcmd($command);
- exec($testCommand.$command, $output, $code);
- return 0 === $code && count($output) > 0;
- }
- private function guessType()
- {
- $os = strtolower(PHP_OS);
- if (false !== strpos($os, 'cygwin')) {
- return self::TYPE_CYGWIN;
- }
- if (false !== strpos($os, 'darwin')) {
- return self::TYPE_DARWIN;
- }
- if (false !== strpos($os, 'bsd')) {
- return self::TYPE_BSD;
- }
- if (0 === strpos($os, 'win')) {
- return self::TYPE_WINDOWS;
- }
- return self::TYPE_UNIX;
- }
- }
- <?php
- namespace Symfony\Component\Finder;
- class SplFileInfo extends \SplFileInfo
- {
- private $relativePath;
- private $relativePathname;
- public function __construct($file, $relativePath, $relativePathname)
- {
- parent::__construct($file);
- $this->relativePath = $relativePath;
- $this->relativePathname = $relativePathname;
- }
- public function getRelativePath()
- {
- return $this->relativePath;
- }
- public function getRelativePathname()
- {
- return $this->relativePathname;
- }
- public function getContents()
- {
- $level = error_reporting(0);
- $content = file_get_contents($this->getPathname());
- error_reporting($level);
- if (false === $content) {
- $error = error_get_last();
- throw new \RuntimeException($error['message']);
- }
- return $content;
- }
- }
- Copyright (c) 2014-2016 Fabien Potencier
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is furnished
- to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- <?php
- namespace Symfony\Polyfill\Mbstring;
- final class Mbstring
- {
- const MB_CASE_FOLD = PHP_INT_MAX;
- private static $encodingList = array('ASCII', 'UTF-8');
- private static $language = 'neutral';
- private static $internalEncoding = 'UTF-8';
- private static $caseFold = array(
- array('µ','ſ',"\xCD\x85",'ς',"\xCF\x90","\xCF\x91","\xCF\x95","\xCF\x96","\xCF\xB0","\xCF\xB1","\xCF\xB5","\xE1\xBA\x9B","\xE1\xBE\xBE"),
- array('μ','s','ι', 'σ','β', 'θ', 'φ', 'π', 'κ', '�', 'ε', "\xE1\xB9\xA1",'ι'),
- );
- public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
- {
- if (is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) {
- $fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
- } else {
- $fromEncoding = self::getEncoding($fromEncoding);
- }
- $toEncoding = self::getEncoding($toEncoding);
- if ('BASE64' === $fromEncoding) {
- $s = base64_decode($s);
- $fromEncoding = $toEncoding;
- }
- if ('BASE64' === $toEncoding) {
- return base64_encode($s);
- }
- if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) {
- if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) {
- $fromEncoding = 'Windows-1252';
- }
- if ('UTF-8' !== $fromEncoding) {
- $s = iconv($fromEncoding, 'UTF-8', $s);
- }
- return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s);
- }
- if ('HTML-ENTITIES' === $fromEncoding) {
- $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8');
- $fromEncoding = 'UTF-8';
- }
- return iconv($fromEncoding, $toEncoding, $s);
- }
- public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null)
- {
- $vars = array(&$a, &$b, &$c, &$d, &$e, &$f);
- $ok = true;
- array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) {
- if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) {
- $ok = false;
- }
- });
- return $ok ? $fromEncoding : false;
- }
- public static function mb_decode_mimeheader($s)
- {
- return iconv_mime_decode($s, 2, self::$internalEncoding);
- }
- public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null)
- {
- trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING);
- }
- public static function mb_convert_case($s, $mode, $encoding = null)
- {
- if ('' === $s .= '') {
- return '';
- }
- $encoding = self::getEncoding($encoding);
- if ('UTF-8' === $encoding) {
- $encoding = null;
- } else {
- $s = iconv($encoding, 'UTF-8', $s);
- }
- if (MB_CASE_TITLE == $mode) {
- $s = preg_replace_callback('/\b\p{Ll}/u', array(__CLASS__, 'title_case_upper'), $s);
- $s = preg_replace_callback('/\B[\p{Lu}\p{Lt}]+/u', array(__CLASS__, 'title_case_lower'), $s);
- } else {
- if (MB_CASE_UPPER == $mode) {
- static $upper = null;
- if (null === $upper) {
- $upper = self::getData('upperCase');
- }
- $map = $upper;
- } else {
- if (self::MB_CASE_FOLD === $mode) {
- $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s);
- }
- static $lower = null;
- if (null === $lower) {
- $lower = self::getData('lowerCase');
- }
- $map = $lower;
- }
- static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4);
- $i = 0;
- $len = strlen($s);
- while ($i < $len) {
- $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"];
- $uchr = substr($s, $i, $ulen);
- $i += $ulen;
- if (isset($map[$uchr])) {
- $uchr = $map[$uchr];
- $nlen = strlen($uchr);
- if ($nlen == $ulen) {
- $nlen = $i;
- do {
- $s[--$nlen] = $uchr[--$ulen];
- } while ($ulen);
- } else {
- $s = substr_replace($s, $uchr, $i - $ulen, $ulen);
- $len += $nlen - $ulen;
- $i += $nlen - $ulen;
- }
- }
- }
- }
- if (null === $encoding) {
- return $s;
- }
- return iconv('UTF-8', $encoding, $s);
- }
- public static function mb_internal_encoding($encoding = null)
- {
- if (null === $encoding) {
- return self::$internalEncoding;
- }
- $encoding = self::getEncoding($encoding);
- if ('UTF-8' === $encoding || false !== @iconv($encoding, $encoding, ' ')) {
- self::$internalEncoding = $encoding;
- return true;
- }
- return false;
- }
- public static function mb_language($lang = null)
- {
- if (null === $lang) {
- return self::$language;
- }
- switch ($lang = strtolower($lang)) {
- case 'uni':
- case 'neutral':
- self::$language = $lang;
- return true;
- }
- return false;
- }
- public static function mb_list_encodings()
- {
- return array('UTF-8');
- }
- public static function mb_encoding_aliases($encoding)
- {
- switch (strtoupper($encoding)) {
- case 'UTF8':
- case 'UTF-8':
- return array('utf8');
- }
- return false;
- }
- public static function mb_check_encoding($var = null, $encoding = null)
- {
- if (null === $encoding) {
- if (null === $var) {
- return false;
- }
- $encoding = self::$internalEncoding;
- }
- return self::mb_detect_encoding($var, array($encoding)) || false !== @iconv($encoding, $encoding, $var);
- }
- public static function mb_detect_encoding($str, $encodingList = null, $strict = false)
- {
- if (null === $encodingList) {
- $encodingList = self::$encodingList;
- } else {
- if (!is_array($encodingList)) {
- $encodingList = array_map('trim', explode(',', $encodingList));
- }
- $encodingList = array_map('strtoupper', $encodingList);
- }
- foreach ($encodingList as $enc) {
- switch ($enc) {
- case 'ASCII':
- if (!preg_match('/[\x80-\xFF]/', $str)) {
- return $enc;
- }
- break;
- case 'UTF8':
- case 'UTF-8':
- if (preg_match('//u', $str)) {
- return 'UTF-8';
- }
- break;
- default:
- if (0 === strncmp($enc, 'ISO-8859-', 9)) {
- return $enc;
- }
- }
- }
- return false;
- }
- public static function mb_detect_order($encodingList = null)
- {
- if (null === $encodingList) {
- return self::$encodingList;
- }
- if (!is_array($encodingList)) {
- $encodingList = array_map('trim', explode(',', $encodingList));
- }
- $encodingList = array_map('strtoupper', $encodingList);
- foreach ($encodingList as $enc) {
- switch ($enc) {
- default:
- if (strncmp($enc, 'ISO-8859-', 9)) {
- return false;
- }
- case 'ASCII':
- case 'UTF8':
- case 'UTF-8':
- }
- }
- self::$encodingList = $encodingList;
- return true;
- }
- public static function mb_strlen($s, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
- return iconv_strlen($s, $encoding);
- }
- public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
- if ('' === $needle .= '') {
- trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING);
- return false;
- }
- return iconv_strpos($haystack, $needle, $offset, $encoding);
- }
- public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
- if ($offset != (int) $offset) {
- $offset = 0;
- } elseif ($offset = (int) $offset) {
- if ($offset < 0) {
- $haystack = self::mb_substr($haystack, 0, $offset, $encoding);
- $offset = 0;
- } else {
- $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding);
- }
- }
- $pos = iconv_strrpos($haystack, $needle, $encoding);
- return false !== $pos ? $offset + $pos : false;
- }
- public static function mb_strtolower($s, $encoding = null)
- {
- return self::mb_convert_case($s, MB_CASE_LOWER, $encoding);
- }
- public static function mb_strtoupper($s, $encoding = null)
- {
- return self::mb_convert_case($s, MB_CASE_UPPER, $encoding);
- }
- public static function mb_substitute_character($c = null)
- {
- if (0 === strcasecmp($c, 'none')) {
- return true;
- }
- return null !== $c ? false : 'none';
- }
- public static function mb_substr($s, $start, $length = null, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
- if ($start < 0) {
- $start = iconv_strlen($s, $encoding) + $start;
- if ($start < 0) {
- $start = 0;
- }
- }
- if (null === $length) {
- $length = 2147483647;
- } elseif ($length < 0) {
- $length = iconv_strlen($s, $encoding) + $length - $start;
- if ($length < 0) {
- return '';
- }
- }
- return iconv_substr($s, $start, $length, $encoding).'';
- }
- public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
- {
- $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
- $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
- return self::mb_strpos($haystack, $needle, $offset, $encoding);
- }
- public static function mb_stristr($haystack, $needle, $part = false, $encoding = null)
- {
- $pos = self::mb_stripos($haystack, $needle, 0, $encoding);
- return self::getSubpart($pos, $part, $haystack, $encoding);
- }
- public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
- $needle = self::mb_substr($needle, 0, 1, $encoding);
- $pos = iconv_strrpos($haystack, $needle, $encoding);
- return self::getSubpart($pos, $part, $haystack, $encoding);
- }
- public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null)
- {
- $needle = self::mb_substr($needle, 0, 1, $encoding);
- $pos = self::mb_strripos($haystack, $needle, $encoding);
- return self::getSubpart($pos, $part, $haystack, $encoding);
- }
- public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null)
- {
- $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
- $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
- return self::mb_strrpos($haystack, $needle, $offset, $encoding);
- }
- public static function mb_strstr($haystack, $needle, $part = false, $encoding = null)
- {
- $pos = strpos($haystack, $needle);
- if (false === $pos) {
- return false;
- }
- if ($part) {
- return substr($haystack, 0, $pos);
- }
- return substr($haystack, $pos);
- }
- public static function mb_get_info($type = 'all')
- {
- $info = array(
- 'internal_encoding' => self::$internalEncoding,
- 'http_output' => 'pass',
- 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)',
- 'func_overload' => 0,
- 'func_overload_list' => 'no overload',
- 'mail_charset' => 'UTF-8',
- 'mail_header_encoding' => 'BASE64',
- 'mail_body_encoding' => 'BASE64',
- 'illegal_chars' => 0,
- 'encoding_translation' => 'Off',
- 'language' => self::$language,
- 'detect_order' => self::$encodingList,
- 'substitute_character' => 'none',
- 'strict_detection' => 'Off',
- );
- if ('all' === $type) {
- return $info;
- }
- if (isset($info[$type])) {
- return $info[$type];
- }
- return false;
- }
- public static function mb_http_input($type = '')
- {
- return false;
- }
- public static function mb_http_output($encoding = null)
- {
- return null !== $encoding ? 'pass' === $encoding : 'pass';
- }
- public static function mb_strwidth($s, $encoding = null)
- {
- $encoding = self::getEncoding($encoding);
- if ('UTF-8' !== $encoding) {
- $s = iconv($encoding, 'UTF-8', $s);
- }
- $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide);
- return ($wide << 1) + iconv_strlen($s, 'UTF-8');
- }
- public static function mb_substr_count($haystack, $needle, $encoding = null)
- {
- return substr_count($haystack, $needle);
- }
- public static function mb_output_handler($contents, $status)
- {
- return $contents;
- }
- private static function getSubpart($pos, $part, $haystack, $encoding)
- {
- if (false === $pos) {
- return false;
- }
- if ($part) {
- return self::mb_substr($haystack, 0, $pos, $encoding);
- }
- return self::mb_substr($haystack, $pos, null, $encoding);
- }
- private static function html_encoding_callback($m)
- {
- $i = 1;
- $entities = '';
- $m = unpack('C*', htmlentities($m[0], ENT_COMPAT, 'UTF-8'));
- while (isset($m[$i])) {
- if (0x80 > $m[$i]) {
- $entities .= chr($m[$i++]);
- continue;
- }
- if (0xF0 <= $m[$i]) {
- $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80;
- } elseif (0xE0 <= $m[$i]) {
- $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80;
- } else {
- $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80;
- }
- $entities .= '&#'.$c.';';
- }
- return $entities;
- }
- private static function title_case_lower($s)
- {
- return self::mb_convert_case($s[0], MB_CASE_LOWER, 'UTF-8');
- }
- private static function title_case_upper($s)
- {
- return self::mb_convert_case($s[0], MB_CASE_UPPER, 'UTF-8');
- }
- private static function getData($file)
- {
- if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.ser')) {
- return unserialize(file_get_contents($file));
- }
- return false;
- }
- private static function getEncoding($encoding)
- {
- if (null === $encoding) {
- return self::$internalEncoding;
- }
- $encoding = strtoupper($encoding);
- if ('8BIT' === $encoding || 'BINARY' === $encoding) {
- return 'CP850';
- }
- if ('UTF8' === $encoding) {
- return 'UTF-8';
- }
- return $encoding;
- }
- }
- <?php
- use Symfony\Polyfill\Mbstring as p;
- if (!function_exists('mb_strlen')) {
- define('MB_CASE_UPPER', 0);
- define('MB_CASE_LOWER', 1);
- define('MB_CASE_TITLE', 2);
- function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); }
- function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); }
- function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); }
- function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); }
- function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); }
- function mb_language($lang = null) { return p\Mbstring::mb_language($lang); }
- function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
- function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
- function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); }
- function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); }
- function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); }
- function mb_parse_str($s, &$result = array()) { parse_str($s, $result); }
- function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); }
- function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); }
- function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); }
- function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); }
- function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); }
- function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); }
- function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); }
- function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); }
- function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); }
- function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); }
- function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); }
- function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); }
- function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); }
- function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
- function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); }
- function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); }
- function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); }
- function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); }
- function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); }
- function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $v0, $a, $b, $c, $d, $e, $f); }
- }
- <?php
- namespace Symfony\Component\Process\Exception;
- interface ExceptionInterface
- {
- }
- <?php
- namespace Symfony\Component\Process\Exception;
- class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
- {
- }
- <?php
- namespace Symfony\Component\Process\Exception;
- class LogicException extends \LogicException implements ExceptionInterface
- {
- }
- <?php
- namespace Symfony\Component\Process\Exception;
- use Symfony\Component\Process\Process;
- class ProcessFailedException extends RuntimeException
- {
- private $process;
- public function __construct(Process $process)
- {
- if ($process->isSuccessful()) {
- throw new InvalidArgumentException('Expected a failed process, but the given process was successful.');
- }
- $error = sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s",
- $process->getCommandLine(),
- $process->getExitCode(),
- $process->getExitCodeText(),
- $process->getWorkingDirectory()
- );
- if (!$process->isOutputDisabled()) {
- $error .= sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s",
- $process->getOutput(),
- $process->getErrorOutput()
- );
- }
- parent::__construct($error);
- $this->process = $process;
- }
- public function getProcess()
- {
- return $this->process;
- }
- }
- <?php
- namespace Symfony\Component\Process\Exception;
- use Symfony\Component\Process\Process;
- class ProcessTimedOutException extends RuntimeException
- {
- const TYPE_GENERAL = 1;
- const TYPE_IDLE = 2;
- private $process;
- private $timeoutType;
- public function __construct(Process $process, $timeoutType)
- {
- $this->process = $process;
- $this->timeoutType = $timeoutType;
- parent::__construct(sprintf(
- 'The process "%s" exceeded the timeout of %s seconds.',
- $process->getCommandLine(),
- $this->getExceededTimeout()
- ));
- }
- public function getProcess()
- {
- return $this->process;
- }
- public function isGeneralTimeout()
- {
- return $this->timeoutType === self::TYPE_GENERAL;
- }
- public function isIdleTimeout()
- {
- return $this->timeoutType === self::TYPE_IDLE;
- }
- public function getExceededTimeout()
- {
- switch ($this->timeoutType) {
- case self::TYPE_GENERAL:
- return $this->process->getTimeout();
- case self::TYPE_IDLE:
- return $this->process->getIdleTimeout();
- default:
- throw new \LogicException(sprintf('Unknown timeout type "%d".', $this->timeoutType));
- }
- }
- }
- <?php
- namespace Symfony\Component\Process\Exception;
- class RuntimeException extends \RuntimeException implements ExceptionInterface
- {
- }
- <?php
- namespace Symfony\Component\Process;
- class ExecutableFinder
- {
- private $suffixes = array('.exe', '.bat', '.cmd', '.com');
- public function setSuffixes(array $suffixes)
- {
- $this->suffixes = $suffixes;
- }
- public function addSuffix($suffix)
- {
- $this->suffixes[] = $suffix;
- }
- public function find($name, $default = null, array $extraDirs = array())
- {
- if (ini_get('open_basedir')) {
- $searchPath = explode(PATH_SEPARATOR, ini_get('open_basedir'));
- $dirs = array();
- foreach ($searchPath as $path) {
- if (@is_dir($path)) {
- $dirs[] = $path;
- } else {
- if (basename($path) == $name && is_executable($path)) {
- return $path;
- }
- }
- }
- } else {
- $dirs = array_merge(
- explode(PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')),
- $extraDirs
- );
- }
- $suffixes = array('');
- if ('\\' === DIRECTORY_SEPARATOR) {
- $pathExt = getenv('PATHEXT');
- $suffixes = $pathExt ? explode(PATH_SEPARATOR, $pathExt) : $this->suffixes;
- }
- foreach ($suffixes as $suffix) {
- foreach ($dirs as $dir) {
- if (is_file($file = $dir.DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === DIRECTORY_SEPARATOR || is_executable($file))) {
- return $file;
- }
- }
- }
- return $default;
- }
- }
- Copyright (c) 2004-2016 Fabien Potencier
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is furnished
- to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- <?php
- namespace Symfony\Component\Process;
- class PhpExecutableFinder
- {
- private $executableFinder;
- public function __construct()
- {
- $this->executableFinder = new ExecutableFinder();
- }
- public function find($includeArgs = true)
- {
- $args = $this->findArguments();
- $args = $includeArgs && $args ? ' '.implode(' ', $args) : '';
- if (defined('HHVM_VERSION')) {
- return (getenv('PHP_BINARY') ?: PHP_BINARY).$args;
- }
- if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) {
- return PHP_BINARY.$args;
- }
- if ($php = getenv('PHP_PATH')) {
- if (!is_executable($php)) {
- return false;
- }
- return $php;
- }
- if ($php = getenv('PHP_PEAR_PHP_BIN')) {
- if (is_executable($php)) {
- return $php;
- }
- }
- $dirs = array(PHP_BINDIR);
- if ('\\' === DIRECTORY_SEPARATOR) {
- $dirs[] = 'C:\xampp\php\\';
- }
- return $this->executableFinder->find('php', false, $dirs);
- }
- public function findArguments()
- {
- $arguments = array();
- if (defined('HHVM_VERSION')) {
- $arguments[] = '--php';
- } elseif ('phpdbg' === PHP_SAPI) {
- $arguments[] = '-qrr';
- }
- return $arguments;
- }
- }
- <?php
- namespace Symfony\Component\Process;
- use Symfony\Component\Process\Exception\RuntimeException;
- class PhpProcess extends Process
- {
- public function __construct($script, $cwd = null, array $env = null, $timeout = 60, array $options = array())
- {
- $executableFinder = new PhpExecutableFinder();
- if (false === $php = $executableFinder->find()) {
- $php = null;
- }
- if ('phpdbg' === PHP_SAPI) {
- $file = tempnam(sys_get_temp_dir(), 'dbg');
- file_put_contents($file, $script);
- register_shutdown_function('unlink', $file);
- $php .= ' '.ProcessUtils::escapeArgument($file);
- $script = null;
- }
- if ('\\' !== DIRECTORY_SEPARATOR && null !== $php) {
-
-
- $php = 'exec '.$php;
- }
- parent::__construct($php, $cwd, $env, $script, $timeout, $options);
- }
- public function setPhpBinary($php)
- {
- $this->setCommandLine($php);
- }
- public function start($callback = null)
- {
- if (null === $this->getCommandLine()) {
- throw new RuntimeException('Unable to find the PHP executable.');
- }
- parent::start($callback);
- }
- }
- <?php
- namespace Symfony\Component\Process\Pipes;
- abstract class AbstractPipes implements PipesInterface
- {
- public $pipes = array();
- protected $inputBuffer = '';
- protected $input;
- private $blocked = true;
- public function close()
- {
- foreach ($this->pipes as $pipe) {
- fclose($pipe);
- }
- $this->pipes = array();
- }
- protected function hasSystemCallBeenInterrupted()
- {
- $lastError = error_get_last();
- return isset($lastError['message']) && false !== stripos($lastError['message'], 'interrupted system call');
- }
- protected function unblock()
- {
- if (!$this->blocked) {
- return;
- }
- foreach ($this->pipes as $pipe) {
- stream_set_blocking($pipe, 0);
- }
- if (null !== $this->input) {
- stream_set_blocking($this->input, 0);
- }
- $this->blocked = false;
- }
- }
- <?php
- namespace Symfony\Component\Process\Pipes;
- interface PipesInterface
- {
- const CHUNK_SIZE = 16384;
- public function getDescriptors();
- public function getFiles();
- public function readAndWrite($blocking, $close = false);
- public function areOpen();
- public function close();
- }
- <?php
- namespace Symfony\Component\Process\Pipes;
- use Symfony\Component\Process\Process;
- class UnixPipes extends AbstractPipes
- {
- private $ttyMode;
- private $ptyMode;
- private $disableOutput;
- public function __construct($ttyMode, $ptyMode, $input, $disableOutput)
- {
- $this->ttyMode = (bool) $ttyMode;
- $this->ptyMode = (bool) $ptyMode;
- $this->disableOutput = (bool) $disableOutput;
- if (is_resource($input)) {
- $this->input = $input;
- } else {
- $this->inputBuffer = (string) $input;
- }
- }
- public function __destruct()
- {
- $this->close();
- }
- public function getDescriptors()
- {
- if ($this->disableOutput) {
- $nullstream = fopen('/dev/null', 'c');
- return array(
- array('pipe', 'r'),
- $nullstream,
- $nullstream,
- );
- }
- if ($this->ttyMode) {
- return array(
- array('file', '/dev/tty', 'r'),
- array('file', '/dev/tty', 'w'),
- array('file', '/dev/tty', 'w'),
- );
- }
- if ($this->ptyMode && Process::isPtySupported()) {
- return array(
- array('pty'),
- array('pty'),
- array('pty'),
- );
- }
- return array(
- array('pipe', 'r'),
- array('pipe', 'w'),
- array('pipe', 'w'),
- );
- }
- public function getFiles()
- {
- return array();
- }
- public function readAndWrite($blocking, $close = false)
- {
-
- if (1 === count($this->pipes) && array(0) === array_keys($this->pipes)) {
- fclose($this->pipes[0]);
- unset($this->pipes[0]);
- }
- if (empty($this->pipes)) {
- return array();
- }
- $this->unblock();
- $read = array();
- if (null !== $this->input) {
-
- $r = array_merge($this->pipes, array('input' => $this->input));
- } else {
- $r = $this->pipes;
- }
- unset($r[0]);
- $w = isset($this->pipes[0]) ? array($this->pipes[0]) : null;
- $e = null;
- if (false === $n = @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) {
-
- if (!$this->hasSystemCallBeenInterrupted()) {
- $this->pipes = array();
- }
- return $read;
- }
- if (0 === $n) {
- return $read;
- }
- foreach ($r as $pipe) {
-
- $type = (false !== $found = array_search($pipe, $this->pipes)) ? $found : 'input';
- $data = '';
- while ('' !== $dataread = (string) fread($pipe, self::CHUNK_SIZE)) {
- $data .= $dataread;
- }
- if ('' !== $data) {
- if ($type === 'input') {
- $this->inputBuffer .= $data;
- } else {
- $read[$type] = $data;
- }
- }
- if (false === $data || (true === $close && feof($pipe) && '' === $data)) {
- if ($type === 'input') {
-
- $this->input = null;
- } else {
- fclose($this->pipes[$type]);
- unset($this->pipes[$type]);
- }
- }
- }
- if (null !== $w && 0 < count($w)) {
- while (strlen($this->inputBuffer)) {
- $written = fwrite($w[0], $this->inputBuffer, 2 << 18);
- if ($written > 0) {
- $this->inputBuffer = (string) substr($this->inputBuffer, $written);
- } else {
- break;
- }
- }
- }
- if ('' === $this->inputBuffer && null === $this->input && isset($this->pipes[0])) {
- fclose($this->pipes[0]);
- unset($this->pipes[0]);
- }
- return $read;
- }
- public function areOpen()
- {
- return (bool) $this->pipes;
- }
- public static function create(Process $process, $input)
- {
- return new static($process->isTty(), $process->isPty(), $input, $process->isOutputDisabled());
- }
- }
- <?php
- namespace Symfony\Component\Process\Pipes;
- use Symfony\Component\Process\Process;
- use Symfony\Component\Process\Exception\RuntimeException;
- class WindowsPipes extends AbstractPipes
- {
- private $files = array();
- private $fileHandles = array();
- private $readBytes = array(
- Process::STDOUT => 0,
- Process::STDERR => 0,
- );
- private $disableOutput;
- public function __construct($disableOutput, $input)
- {
- $this->disableOutput = (bool) $disableOutput;
- if (!$this->disableOutput) {
-
-
-
- $this->files = array(
- Process::STDOUT => tempnam(sys_get_temp_dir(), 'out_sf_proc'),
- Process::STDERR => tempnam(sys_get_temp_dir(), 'err_sf_proc'),
- );
- foreach ($this->files as $offset => $file) {
- if (false === $file || false === $this->fileHandles[$offset] = fopen($file, 'rb')) {
- throw new RuntimeException('A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable');
- }
- }
- }
- if (is_resource($input)) {
- $this->input = $input;
- } else {
- $this->inputBuffer = $input;
- }
- }
- public function __destruct()
- {
- $this->close();
- $this->removeFiles();
- }
- public function getDescriptors()
- {
- if ($this->disableOutput) {
- $nullstream = fopen('NUL', 'c');
- return array(
- array('pipe', 'r'),
- $nullstream,
- $nullstream,
- );
- }
-
-
- return array(
- array('pipe', 'r'),
- array('file', 'NUL', 'w'),
- array('file', 'NUL', 'w'),
- );
- }
- public function getFiles()
- {
- return $this->files;
- }
- public function readAndWrite($blocking, $close = false)
- {
- $this->write($blocking, $close);
- $read = array();
- $fh = $this->fileHandles;
- foreach ($fh as $type => $fileHandle) {
- if (0 !== fseek($fileHandle, $this->readBytes[$type])) {
- continue;
- }
- $data = '';
- $dataread = null;
- while (!feof($fileHandle)) {
- if (false !== $dataread = fread($fileHandle, self::CHUNK_SIZE)) {
- $data .= $dataread;
- }
- }
- if (0 < $length = strlen($data)) {
- $this->readBytes[$type] += $length;
- $read[$type] = $data;
- }
- if (false === $dataread || (true === $close && feof($fileHandle) && '' === $data)) {
- fclose($this->fileHandles[$type]);
- unset($this->fileHandles[$type]);
- }
- }
- return $read;
- }
- public function areOpen()
- {
- return (bool) $this->pipes && (bool) $this->fileHandles;
- }
- public function close()
- {
- parent::close();
- foreach ($this->fileHandles as $handle) {
- fclose($handle);
- }
- $this->fileHandles = array();
- }
- public static function create(Process $process, $input)
- {
- return new static($process->isOutputDisabled(), $input);
- }
- private function removeFiles()
- {
- foreach ($this->files as $filename) {
- if (file_exists($filename)) {
- @unlink($filename);
- }
- }
- $this->files = array();
- }
- private function write($blocking, $close)
- {
- if (empty($this->pipes)) {
- return;
- }
- $this->unblock();
- $r = null !== $this->input ? array('input' => $this->input) : null;
- $w = isset($this->pipes[0]) ? array($this->pipes[0]) : null;
- $e = null;
- if (false === $n = @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) {
-
- if (!$this->hasSystemCallBeenInterrupted()) {
- $this->pipes = array();
- }
- return;
- }
- if (0 === $n) {
- return;
- }
- if (null !== $w && 0 < count($r)) {
- $data = '';
- while ($dataread = fread($r['input'], self::CHUNK_SIZE)) {
- $data .= $dataread;
- }
- $this->inputBuffer .= $data;
- if (false === $data || (true === $close && feof($r['input']) && '' === $data)) {
-
- $this->input = null;
- }
- }
- if (null !== $w && 0 < count($w)) {
- while (strlen($this->inputBuffer)) {
- $written = fwrite($w[0], $this->inputBuffer, 2 << 18);
- if ($written > 0) {
- $this->inputBuffer = (string) substr($this->inputBuffer, $written);
- } else {
- break;
- }
- }
- }
- if ('' === $this->inputBuffer && null === $this->input && isset($this->pipes[0])) {
- fclose($this->pipes[0]);
- unset($this->pipes[0]);
- }
- }
- }
- <?php
- namespace Symfony\Component\Process;
- use Symfony\Component\Process\Exception\InvalidArgumentException;
- use Symfony\Component\Process\Exception\LogicException;
- use Symfony\Component\Process\Exception\ProcessFailedException;
- use Symfony\Component\Process\Exception\ProcessTimedOutException;
- use Symfony\Component\Process\Exception\RuntimeException;
- use Symfony\Component\Process\Pipes\PipesInterface;
- use Symfony\Component\Process\Pipes\UnixPipes;
- use Symfony\Component\Process\Pipes\WindowsPipes;
- class Process
- {
- const ERR = 'err';
- const OUT = 'out';
- const STATUS_READY = 'ready';
- const STATUS_STARTED = 'started';
- const STATUS_TERMINATED = 'terminated';
- const STDIN = 0;
- const STDOUT = 1;
- const STDERR = 2;
- const TIMEOUT_PRECISION = 0.2;
- private $callback;
- private $commandline;
- private $cwd;
- private $env;
- private $input;
- private $starttime;
- private $lastOutputTime;
- private $timeout;
- private $idleTimeout;
- private $options;
- private $exitcode;
- private $fallbackStatus = array();
- private $processInformation;
- private $outputDisabled = false;
- private $stdout;
- private $stderr;
- private $enhanceWindowsCompatibility = true;
- private $enhanceSigchildCompatibility;
- private $process;
- private $status = self::STATUS_READY;
- private $incrementalOutputOffset = 0;
- private $incrementalErrorOutputOffset = 0;
- private $tty;
- private $pty;
- private $useFileHandles = false;
- private $processPipes;
- private $latestSignal;
- private static $sigchild;
- public static $exitCodes = array(
- 0 => 'OK',
- 1 => 'General error',
- 2 => 'Misuse of shell builtins',
- 126 => 'Invoked command cannot execute',
- 127 => 'Command not found',
- 128 => 'Invalid exit argument',
- 129 => 'Hangup',
- 130 => 'Interrupt',
- 131 => 'Quit and dump core',
- 132 => 'Illegal instruction',
- 133 => 'Trace/breakpoint trap',
- 134 => 'Process aborted',
- 135 => 'Bus error: "access to undefined portion of memory object"',
- 136 => 'Floating point exception: "erroneous arithmetic operation"',
- 137 => 'Kill (terminate immediately)',
- 138 => 'User-defined 1',
- 139 => 'Segmentation violation',
- 140 => 'User-defined 2',
- 141 => 'Write to pipe with no one reading',
- 142 => 'Signal raised by alarm',
- 143 => 'Termination (request to terminate)',
- 145 => 'Child process terminated, stopped (or continued*)',
- 146 => 'Continue if stopped',
- 147 => 'Stop executing temporarily',
- 148 => 'Terminal stop signal',
- 149 => 'Background process attempting to read from tty ("in")',
- 150 => 'Background process attempting to write to tty ("out")',
- 151 => 'Urgent data available on socket',
- 152 => 'CPU time limit exceeded',
- 153 => 'File size limit exceeded',
- 154 => 'Signal raised by timer counting virtual time: "virtual timer expired"',
- 155 => 'Profiling timer expired',
- 157 => 'Pollable event',
- 159 => 'Bad syscall',
- );
- public function __construct($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60, array $options = array())
- {
- if (!function_exists('proc_open')) {
- throw new RuntimeException('The Process class relies on proc_open, which is not available on your PHP installation.');
- }
- $this->commandline = $commandline;
- $this->cwd = $cwd;
-
-
-
- if (null === $this->cwd && (defined('ZEND_THREAD_SAFE') || '\\' === DIRECTORY_SEPARATOR)) {
- $this->cwd = getcwd();
- }
- if (null !== $env) {
- $this->setEnv($env);
- }
- $this->input = $input;
- $this->setTimeout($timeout);
- $this->useFileHandles = '\\' === DIRECTORY_SEPARATOR;
- $this->pty = false;
- $this->enhanceWindowsCompatibility = true;
- $this->enhanceSigchildCompatibility = '\\' !== DIRECTORY_SEPARATOR && $this->isSigchildEnabled();
- $this->options = array_replace(array('suppress_errors' => true, 'binary_pipes' => true), $options);
- }
- public function __destruct()
- {
- $this->stop(0);
- }
- public function __clone()
- {
- $this->resetProcessData();
- }
- public function run($callback = null)
- {
- $this->start($callback);
- return $this->wait();
- }
- public function mustRun($callback = null)
- {
- if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
- throw new RuntimeException('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.');
- }
- if (0 !== $this->run($callback)) {
- throw new ProcessFailedException($this);
- }
- return $this;
- }
- public function start($callback = null)
- {
- if ($this->isRunning()) {
- throw new RuntimeException('Process is already running');
- }
- if ($this->outputDisabled && null !== $callback) {
- throw new LogicException('Output has been disabled, enable it to allow the use of a callback.');
- }
- $this->resetProcessData();
- $this->starttime = $this->lastOutputTime = microtime(true);
- $this->callback = $this->buildCallback($callback);
- $descriptors = $this->getDescriptors();
- $commandline = $this->commandline;
- if ('\\' === DIRECTORY_SEPARATOR && $this->enhanceWindowsCompatibility) {
- $commandline = 'cmd /V:ON /E:ON /D /C "('.$commandline.')';
- foreach ($this->processPipes->getFiles() as $offset => $filename) {
- $commandline .= ' '.$offset.'>'.ProcessUtils::escapeArgument($filename);
- }
- $commandline .= '"';
- if (!isset($this->options['bypass_shell'])) {
- $this->options['bypass_shell'] = true;
- }
- } elseif (!$this->useFileHandles && $this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
- $descriptors[3] = array('pipe', 'w');
- $commandline = '{ ('.$this->commandline.') <&3 3<&- 3>/dev/null & } 3<&0;';
- $commandline .= 'pid=$!; echo $pid >&3; wait $pid; code=$?; echo $code >&3; exit $code';
-
- $ptsWorkaround = fopen(__FILE__, 'r');
- }
- $this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $this->env, $this->options);
- if (!is_resource($this->process)) {
- throw new RuntimeException('Unable to launch a new process.');
- }
- $this->status = self::STATUS_STARTED;
- if (isset($descriptors[3])) {
- $this->fallbackStatus['pid'] = (int) fgets($this->processPipes->pipes[3]);
- }
- if ($this->tty) {
- return;
- }
- $this->updateStatus(false);
- $this->checkTimeout();
- }
- public function restart($callback = null)
- {
- if ($this->isRunning()) {
- throw new RuntimeException('Process is already running');
- }
- $process = clone $this;
- $process->start($callback);
- return $process;
- }
- public function wait($callback = null)
- {
- $this->requireProcessIsStarted(__FUNCTION__);
- $this->updateStatus(false);
- if (null !== $callback) {
- $this->callback = $this->buildCallback($callback);
- }
- do {
- $this->checkTimeout();
- $running = '\\' === DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen();
- $close = '\\' !== DIRECTORY_SEPARATOR || !$running;
- $this->readPipes(true, $close);
- } while ($running);
- while ($this->isRunning()) {
- usleep(1000);
- }
- if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) {
- throw new RuntimeException(sprintf('The process has been signaled with signal "%s".', $this->processInformation['termsig']));
- }
- return $this->exitcode;
- }
- public function getPid()
- {
- return $this->isRunning() ? $this->processInformation['pid'] : null;
- }
- public function signal($signal)
- {
- $this->doSignal($signal, true);
- return $this;
- }
- public function disableOutput()
- {
- if ($this->isRunning()) {
- throw new RuntimeException('Disabling output while the process is running is not possible.');
- }
- if (null !== $this->idleTimeout) {
- throw new LogicException('Output can not be disabled while an idle timeout is set.');
- }
- $this->outputDisabled = true;
- return $this;
- }
- public function enableOutput()
- {
- if ($this->isRunning()) {
- throw new RuntimeException('Enabling output while the process is running is not possible.');
- }
- $this->outputDisabled = false;
- return $this;
- }
- public function isOutputDisabled()
- {
- return $this->outputDisabled;
- }
- public function getOutput()
- {
- if ($this->outputDisabled) {
- throw new LogicException('Output has been disabled.');
- }
- $this->requireProcessIsStarted(__FUNCTION__);
- $this->readPipes(false, '\\' === DIRECTORY_SEPARATOR ? !$this->processInformation['running'] : true);
- return $this->stdout;
- }
- public function getIncrementalOutput()
- {
- $this->requireProcessIsStarted(__FUNCTION__);
- $data = $this->getOutput();
- $latest = substr($data, $this->incrementalOutputOffset);
- if (false === $latest) {
- return '';
- }
- $this->incrementalOutputOffset = strlen($data);
- return $latest;
- }
- public function clearOutput()
- {
- $this->stdout = '';
- $this->incrementalOutputOffset = 0;
- return $this;
- }
- public function getErrorOutput()
- {
- if ($this->outputDisabled) {
- throw new LogicException('Output has been disabled.');
- }
- $this->requireProcessIsStarted(__FUNCTION__);
- $this->readPipes(false, '\\' === DIRECTORY_SEPARATOR ? !$this->processInformation['running'] : true);
- return $this->stderr;
- }
- public function getIncrementalErrorOutput()
- {
- $this->requireProcessIsStarted(__FUNCTION__);
- $data = $this->getErrorOutput();
- $latest = substr($data, $this->incrementalErrorOutputOffset);
- if (false === $latest) {
- return '';
- }
- $this->incrementalErrorOutputOffset = strlen($data);
- return $latest;
- }
- public function clearErrorOutput()
- {
- $this->stderr = '';
- $this->incrementalErrorOutputOffset = 0;
- return $this;
- }
- public function getExitCode()
- {
- if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
- throw new RuntimeException('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.');
- }
- $this->updateStatus(false);
- return $this->exitcode;
- }
- public function getExitCodeText()
- {
- if (null === $exitcode = $this->getExitCode()) {
- return;
- }
- return isset(self::$exitCodes[$exitcode]) ? self::$exitCodes[$exitcode] : 'Unknown error';
- }
- public function isSuccessful()
- {
- return 0 === $this->getExitCode();
- }
- public function hasBeenSignaled()
- {
- $this->requireProcessIsTerminated(__FUNCTION__);
- if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
- throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved.');
- }
- return $this->processInformation['signaled'];
- }
- public function getTermSignal()
- {
- $this->requireProcessIsTerminated(__FUNCTION__);
- if ($this->isSigchildEnabled() && (!$this->enhanceSigchildCompatibility || -1 === $this->processInformation['termsig'])) {
- throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved.');
- }
- return $this->processInformation['termsig'];
- }
- public function hasBeenStopped()
- {
- $this->requireProcessIsTerminated(__FUNCTION__);
- return $this->processInformation['stopped'];
- }
- public function getStopSignal()
- {
- $this->requireProcessIsTerminated(__FUNCTION__);
- return $this->processInformation['stopsig'];
- }
- public function isRunning()
- {
- if (self::STATUS_STARTED !== $this->status) {
- return false;
- }
- $this->updateStatus(false);
- return $this->processInformation['running'];
- }
- public function isStarted()
- {
- return $this->status != self::STATUS_READY;
- }
- public function isTerminated()
- {
- $this->updateStatus(false);
- return $this->status == self::STATUS_TERMINATED;
- }
- public function getStatus()
- {
- $this->updateStatus(false);
- return $this->status;
- }
- public function stop($timeout = 10, $signal = null)
- {
- $timeoutMicro = microtime(true) + $timeout;
- if ($this->isRunning()) {
- $this->doSignal(15, false);
- do {
- usleep(1000);
- } while ($this->isRunning() && microtime(true) < $timeoutMicro);
- if ($this->isRunning()) {
-
- $this->doSignal($signal ?: 9, false);
- }
- }
- if ($this->isRunning()) {
- if (isset($this->fallbackStatus['pid'])) {
- unset($this->fallbackStatus['pid']);
- return $this->stop(0, $signal);
- }
- $this->close();
- }
- return $this->exitcode;
- }
- public function addOutput($line)
- {
- $this->lastOutputTime = microtime(true);
- $this->stdout .= $line;
- }
- public function addErrorOutput($line)
- {
- $this->lastOutputTime = microtime(true);
- $this->stderr .= $line;
- }
- public function getCommandLine()
- {
- return $this->commandline;
- }
- public function setCommandLine($commandline)
- {
- $this->commandline = $commandline;
- return $this;
- }
- public function getTimeout()
- {
- return $this->timeout;
- }
- public function getIdleTimeout()
- {
- return $this->idleTimeout;
- }
- public function setTimeout($timeout)
- {
- $this->timeout = $this->validateTimeout($timeout);
- return $this;
- }
- public function setIdleTimeout($timeout)
- {
- if (null !== $timeout && $this->outputDisabled) {
- throw new LogicException('Idle timeout can not be set while the output is disabled.');
- }
- $this->idleTimeout = $this->validateTimeout($timeout);
- return $this;
- }
- public function setTty($tty)
- {
- if ('\\' === DIRECTORY_SEPARATOR && $tty) {
- throw new RuntimeException('TTY mode is not supported on Windows platform.');
- }
- if ($tty && (!file_exists('/dev/tty') || !is_readable('/dev/tty'))) {
- throw new RuntimeException('TTY mode requires /dev/tty to be readable.');
- }
- $this->tty = (bool) $tty;
- return $this;
- }
- public function isTty()
- {
- return $this->tty;
- }
- public function setPty($bool)
- {
- $this->pty = (bool) $bool;
- return $this;
- }
- public function isPty()
- {
- return $this->pty;
- }
- public function getWorkingDirectory()
- {
- if (null === $this->cwd) {
-
- return getcwd() ?: null;
- }
- return $this->cwd;
- }
- public function setWorkingDirectory($cwd)
- {
- $this->cwd = $cwd;
- return $this;
- }
- public function getEnv()
- {
- return $this->env;
- }
- public function setEnv(array $env)
- {
- $env = array_filter($env, function ($value) {
- return !is_array($value);
- });
- $this->env = array();
- foreach ($env as $key => $value) {
- $this->env[$key] = (string) $value;
- }
- return $this;
- }
- public function getStdin()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the getInput() method instead.', E_USER_DEPRECATED);
- return $this->getInput();
- }
- public function getInput()
- {
- return $this->input;
- }
- public function setStdin($stdin)
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the setInput() method instead.', E_USER_DEPRECATED);
- return $this->setInput($stdin);
- }
- public function setInput($input)
- {
- if ($this->isRunning()) {
- throw new LogicException('Input can not be set while the process is running.');
- }
- $this->input = ProcessUtils::validateInput(sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);
- return $this;
- }
- public function getOptions()
- {
- return $this->options;
- }
- public function setOptions(array $options)
- {
- $this->options = $options;
- return $this;
- }
- public function getEnhanceWindowsCompatibility()
- {
- return $this->enhanceWindowsCompatibility;
- }
- public function setEnhanceWindowsCompatibility($enhance)
- {
- $this->enhanceWindowsCompatibility = (bool) $enhance;
- return $this;
- }
- public function getEnhanceSigchildCompatibility()
- {
- return $this->enhanceSigchildCompatibility;
- }
- public function setEnhanceSigchildCompatibility($enhance)
- {
- $this->enhanceSigchildCompatibility = (bool) $enhance;
- return $this;
- }
- public function checkTimeout()
- {
- if ($this->status !== self::STATUS_STARTED) {
- return;
- }
- if (null !== $this->timeout && $this->timeout < microtime(true) - $this->starttime) {
- $this->stop(0);
- throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL);
- }
- if (null !== $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) {
- $this->stop(0);
- throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE);
- }
- }
- public static function isPtySupported()
- {
- static $result;
- if (null !== $result) {
- return $result;
- }
- if ('\\' === DIRECTORY_SEPARATOR) {
- return $result = false;
- }
- return $result = (bool) @proc_open('echo 1', array(array('pty'), array('pty'), array('pty')), $pipes);
- }
- private function getDescriptors()
- {
- if ('\\' === DIRECTORY_SEPARATOR) {
- $this->processPipes = WindowsPipes::create($this, $this->input);
- } else {
- $this->processPipes = UnixPipes::create($this, $this->input);
- }
- return $this->processPipes->getDescriptors($this->outputDisabled);
- }
- protected function buildCallback($callback)
- {
- $that = $this;
- $out = self::OUT;
- $callback = function ($type, $data) use ($that, $callback, $out) {
- if ($out == $type) {
- $that->addOutput($data);
- } else {
- $that->addErrorOutput($data);
- }
- if (null !== $callback) {
- call_user_func($callback, $type, $data);
- }
- };
- return $callback;
- }
- protected function updateStatus($blocking)
- {
- if (self::STATUS_STARTED !== $this->status) {
- return;
- }
- $this->processInformation = proc_get_status($this->process);
- $this->readPipes($blocking, '\\' === DIRECTORY_SEPARATOR ? !$this->processInformation['running'] : true);
- if ($this->fallbackStatus && $this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
- $this->processInformation = $this->fallbackStatus + $this->processInformation;
- }
- if (!$this->processInformation['running']) {
- $this->close();
- }
- }
- protected function isSigchildEnabled()
- {
- if (null !== self::$sigchild) {
- return self::$sigchild;
- }
- if (!function_exists('phpinfo') || defined('HHVM_VERSION')) {
- return self::$sigchild = false;
- }
- ob_start();
- phpinfo(INFO_GENERAL);
- return self::$sigchild = false !== strpos(ob_get_clean(), '--enable-sigchild');
- }
- private function validateTimeout($timeout)
- {
- $timeout = (float) $timeout;
- if (0.0 === $timeout) {
- $timeout = null;
- } elseif ($timeout < 0) {
- throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.');
- }
- return $timeout;
- }
- private function readPipes($blocking, $close)
- {
- $result = $this->processPipes->readAndWrite($blocking, $close);
- $callback = $this->callback;
- foreach ($result as $type => $data) {
- if (3 !== $type) {
- $callback($type === self::STDOUT ? self::OUT : self::ERR, $data);
- } elseif (!isset($this->fallbackStatus['signaled'])) {
- $this->fallbackStatus['exitcode'] = (int) $data;
- }
- }
- }
- private function close()
- {
- $this->processPipes->close();
- if (is_resource($this->process)) {
- proc_close($this->process);
- }
- $this->exitcode = $this->processInformation['exitcode'];
- $this->status = self::STATUS_TERMINATED;
- if (-1 === $this->exitcode) {
- if ($this->processInformation['signaled'] && 0 < $this->processInformation['termsig']) {
- $this->exitcode = 128 + $this->processInformation['termsig'];
- } elseif ($this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
- $this->processInformation['signaled'] = true;
- $this->processInformation['termsig'] = -1;
- }
- }
-
-
- $this->callback = null;
- return $this->exitcode;
- }
- private function resetProcessData()
- {
- $this->starttime = null;
- $this->callback = null;
- $this->exitcode = null;
- $this->fallbackStatus = array();
- $this->processInformation = null;
- $this->stdout = null;
- $this->stderr = null;
- $this->process = null;
- $this->latestSignal = null;
- $this->status = self::STATUS_READY;
- $this->incrementalOutputOffset = 0;
- $this->incrementalErrorOutputOffset = 0;
- }
- private function doSignal($signal, $throwException)
- {
- if (null === $pid = $this->getPid()) {
- if ($throwException) {
- throw new LogicException('Can not send signal on a non running process.');
- }
- return false;
- }
- if ('\\' === DIRECTORY_SEPARATOR) {
- exec(sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode);
- if ($exitCode && $this->isRunning()) {
- if ($throwException) {
- throw new RuntimeException(sprintf('Unable to kill the process (%s).', implode(' ', $output)));
- }
- return false;
- }
- } else {
- if (!$this->enhanceSigchildCompatibility || !$this->isSigchildEnabled()) {
- $ok = @proc_terminate($this->process, $signal);
- } elseif (function_exists('posix_kill')) {
- $ok = @posix_kill($pid, $signal);
- } elseif ($ok = proc_open(sprintf('kill -%d %d', $signal, $pid), array(2 => array('pipe', 'w')), $pipes)) {
- $ok = false === fgets($pipes[2]);
- }
- if (!$ok) {
- if ($throwException) {
- throw new RuntimeException(sprintf('Error while sending signal `%s`.', $signal));
- }
- return false;
- }
- }
- $this->latestSignal = (int) $signal;
- $this->fallbackStatus['signaled'] = true;
- $this->fallbackStatus['exitcode'] = -1;
- $this->fallbackStatus['termsig'] = $this->latestSignal;
- return true;
- }
- private function requireProcessIsStarted($functionName)
- {
- if (!$this->isStarted()) {
- throw new LogicException(sprintf('Process must be started before calling %s.', $functionName));
- }
- }
- private function requireProcessIsTerminated($functionName)
- {
- if (!$this->isTerminated()) {
- throw new LogicException(sprintf('Process must be terminated before calling %s.', $functionName));
- }
- }
- }
- <?php
- namespace Symfony\Component\Process;
- use Symfony\Component\Process\Exception\InvalidArgumentException;
- use Symfony\Component\Process\Exception\LogicException;
- class ProcessBuilder
- {
- private $arguments;
- private $cwd;
- private $env = array();
- private $input;
- private $timeout = 60;
- private $options = array();
- private $inheritEnv = true;
- private $prefix = array();
- private $outputDisabled = false;
- public function __construct(array $arguments = array())
- {
- $this->arguments = $arguments;
- }
- public static function create(array $arguments = array())
- {
- return new static($arguments);
- }
- public function add($argument)
- {
- $this->arguments[] = $argument;
- return $this;
- }
- public function setPrefix($prefix)
- {
- $this->prefix = is_array($prefix) ? $prefix : array($prefix);
- return $this;
- }
- public function setArguments(array $arguments)
- {
- $this->arguments = $arguments;
- return $this;
- }
- public function setWorkingDirectory($cwd)
- {
- $this->cwd = $cwd;
- return $this;
- }
- public function inheritEnvironmentVariables($inheritEnv = true)
- {
- $this->inheritEnv = $inheritEnv;
- return $this;
- }
- public function setEnv($name, $value)
- {
- $this->env[$name] = $value;
- return $this;
- }
- public function addEnvironmentVariables(array $variables)
- {
- $this->env = array_replace($this->env, $variables);
- return $this;
- }
- public function setInput($input)
- {
- $this->input = ProcessUtils::validateInput(sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);
- return $this;
- }
- public function setTimeout($timeout)
- {
- if (null === $timeout) {
- $this->timeout = null;
- return $this;
- }
- $timeout = (float) $timeout;
- if ($timeout < 0) {
- throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.');
- }
- $this->timeout = $timeout;
- return $this;
- }
- public function setOption($name, $value)
- {
- $this->options[$name] = $value;
- return $this;
- }
- public function disableOutput()
- {
- $this->outputDisabled = true;
- return $this;
- }
- public function enableOutput()
- {
- $this->outputDisabled = false;
- return $this;
- }
- public function getProcess()
- {
- if (0 === count($this->prefix) && 0 === count($this->arguments)) {
- throw new LogicException('You must add() command arguments before calling getProcess().');
- }
- $options = $this->options;
- $arguments = array_merge($this->prefix, $this->arguments);
- $script = implode(' ', array_map(array(__NAMESPACE__.'\\ProcessUtils', 'escapeArgument'), $arguments));
- if ($this->inheritEnv) {
- $env = array_replace($_ENV, $_SERVER, $this->env);
- } else {
- $env = $this->env;
- }
- $process = new Process($script, $this->cwd, $env, $this->input, $this->timeout, $options);
- if ($this->outputDisabled) {
- $process->disableOutput();
- }
- return $process;
- }
- }
- <?php
- namespace Symfony\Component\Process;
- use Symfony\Component\Process\Exception\InvalidArgumentException;
- class ProcessUtils
- {
- private function __construct()
- {
- }
- public static function escapeArgument($argument)
- {
-
-
-
- if ('\\' === DIRECTORY_SEPARATOR) {
- if ('' === $argument) {
- return escapeshellarg($argument);
- }
- $escapedArgument = '';
- $quote = false;
- foreach (preg_split('/(")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) {
- if ('"' === $part) {
- $escapedArgument .= '\\"';
- } elseif (self::isSurroundedBy($part, '%')) {
- $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%';
- } else {
- if ('\\' === substr($part, -1)) {
- $part .= '\\';
- }
- $quote = true;
- $escapedArgument .= $part;
- }
- }
- if ($quote) {
- $escapedArgument = '"'.$escapedArgument.'"';
- }
- return $escapedArgument;
- }
- return escapeshellarg($argument);
- }
- public static function validateInput($caller, $input)
- {
- if (null !== $input) {
- if (is_resource($input)) {
- return $input;
- }
- if (is_scalar($input)) {
- return (string) $input;
- }
- if (is_object($input) && method_exists($input, '__toString')) {
- @trigger_error('Passing an object as an input is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
- return (string) $input;
- }
- throw new InvalidArgumentException(sprintf('%s only accepts strings or stream resources.', $caller));
- }
- return $input;
- }
- private static function isSurroundedBy($arg, $char)
- {
- return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1];
- }
- }
- Copyright (c) 2011 Jordi Boggiano
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is furnished
- to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- <?php
- namespace Seld\JsonLint;
- class DuplicateKeyException extends ParsingException
- {
- public function __construct($message, $key, array $details = array())
- {
- $details['key'] = $key;
- parent::__construct($message, $details);
- }
- public function getKey()
- {
- return $this->details['key'];
- }
- }
- <?php
- namespace Seld\JsonLint;
- use stdClass;
- class JsonParser
- {
- const DETECT_KEY_CONFLICTS = 1;
- const ALLOW_DUPLICATE_KEYS = 2;
- const PARSE_TO_ASSOC = 4;
- private $lexer;
- private $flags;
- private $stack;
- private $vstack;
- private $lstack;
- private $symbols = array(
- 'error' => 2,
- 'JSONString' => 3,
- 'STRING' => 4,
- 'JSONNumber' => 5,
- 'NUMBER' => 6,
- 'JSONNullLiteral' => 7,
- 'NULL' => 8,
- 'JSONBooleanLiteral' => 9,
- 'TRUE' => 10,
- 'FALSE' => 11,
- 'JSONText' => 12,
- 'JSONValue' => 13,
- 'EOF' => 14,
- 'JSONObject' => 15,
- 'JSONArray' => 16,
- '{' => 17,
- '}' => 18,
- 'JSONMemberList' => 19,
- 'JSONMember' => 20,
- ':' => 21,
- ',' => 22,
- '[' => 23,
- ']' => 24,
- 'JSONElementList' => 25,
- '$accept' => 0,
- '$end' => 1,
- );
- private $terminals_ = array(
- 2 => "error",
- 4 => "STRING",
- 6 => "NUMBER",
- 8 => "NULL",
- 10 => "TRUE",
- 11 => "FALSE",
- 14 => "EOF",
- 17 => "{",
- 18 => "}",
- 21 => ":",
- 22 => ",",
- 23 => "[",
- 24 => "]",
- );
- private $productions_ = array(
- 0,
- array(3, 1),
- array(5, 1),
- array(7, 1),
- array(9, 1),
- array(9, 1),
- array(12, 2),
- array(13, 1),
- array(13, 1),
- array(13, 1),
- array(13, 1),
- array(13, 1),
- array(13, 1),
- array(15, 2),
- array(15, 3),
- array(20, 3),
- array(19, 1),
- array(19, 3),
- array(16, 2),
- array(16, 3),
- array(25, 1),
- array(25, 3)
- );
- private $table = array(array(3 => 5, 4 => array(1,12), 5 => 6, 6 => array(1,13), 7 => 3, 8 => array(1,9), 9 => 4, 10 => array(1,10), 11 => array(1,11), 12 => 1, 13 => 2, 15 => 7, 16 => 8, 17 => array(1,14), 23 => array(1,15)), array( 1 => array(3)), array( 14 => array(1,16)), array( 14 => array(2,7), 18 => array(2,7), 22 => array(2,7), 24 => array(2,7)), array( 14 => array(2,8), 18 => array(2,8), 22 => array(2,8), 24 => array(2,8)), array( 14 => array(2,9), 18 => array(2,9), 22 => array(2,9), 24 => array(2,9)), array( 14 => array(2,10), 18 => array(2,10), 22 => array(2,10), 24 => array(2,10)), array( 14 => array(2,11), 18 => array(2,11), 22 => array(2,11), 24 => array(2,11)), array( 14 => array(2,12), 18 => array(2,12), 22 => array(2,12), 24 => array(2,12)), array( 14 => array(2,3), 18 => array(2,3), 22 => array(2,3), 24 => array(2,3)), array( 14 => array(2,4), 18 => array(2,4), 22 => array(2,4), 24 => array(2,4)), array( 14 => array(2,5), 18 => array(2,5), 22 => array(2,5), 24 => array(2,5)), array( 14 => array(2,1), 18 => array(2,1), 21 => array(2,1), 22 => array(2,1), 24 => array(2,1)), array( 14 => array(2,2), 18 => array(2,2), 22 => array(2,2), 24 => array(2,2)), array( 3 => 20, 4 => array(1,12), 18 => array(1,17), 19 => 18, 20 => 19 ), array( 3 => 5, 4 => array(1,12), 5 => 6, 6 => array(1,13), 7 => 3, 8 => array(1,9), 9 => 4, 10 => array(1,10), 11 => array(1,11), 13 => 23, 15 => 7, 16 => 8, 17 => array(1,14), 23 => array(1,15), 24 => array(1,21), 25 => 22 ), array( 1 => array(2,6)), array( 14 => array(2,13), 18 => array(2,13), 22 => array(2,13), 24 => array(2,13)), array( 18 => array(1,24), 22 => array(1,25)), array( 18 => array(2,16), 22 => array(2,16)), array( 21 => array(1,26)), array( 14 => array(2,18), 18 => array(2,18), 22 => array(2,18), 24 => array(2,18)), array( 22 => array(1,28), 24 => array(1,27)), array( 22 => array(2,20), 24 => array(2,20)), array( 14 => array(2,14), 18 => array(2,14), 22 => array(2,14), 24 => array(2,14)), array( 3 => 20, 4 => array(1,12), 20 => 29 ), array( 3 => 5, 4 => array(1,12), 5 => 6, 6 => array(1,13), 7 => 3, 8 => array(1,9), 9 => 4, 10 => array(1,10), 11 => array(1,11), 13 => 30, 15 => 7, 16 => 8, 17 => array(1,14), 23 => array(1,15)), array( 14 => array(2,19), 18 => array(2,19), 22 => array(2,19), 24 => array(2,19)), array( 3 => 5, 4 => array(1,12), 5 => 6, 6 => array(1,13), 7 => 3, 8 => array(1,9), 9 => 4, 10 => array(1,10), 11 => array(1,11), 13 => 31, 15 => 7, 16 => 8, 17 => array(1,14), 23 => array(1,15)), array( 18 => array(2,17), 22 => array(2,17)), array( 18 => array(2,15), 22 => array(2,15)), array( 22 => array(2,21), 24 => array(2,21)),
- );
- private $defaultActions = array(
- 16 => array(2, 6)
- );
- public function lint($input)
- {
- try {
- $this->parse($input);
- } catch (ParsingException $e) {
- return $e;
- }
- }
- public function parse($input, $flags = 0)
- {
- $this->failOnBOM($input);
- $this->flags = $flags;
- $this->stack = array(0);
- $this->vstack = array(null);
- $this->lstack = array();
- $yytext = '';
- $yylineno = 0;
- $yyleng = 0;
- $recovering = 0;
- $TERROR = 2;
- $EOF = 1;
- $this->lexer = new Lexer();
- $this->lexer->setInput($input);
- $yyloc = $this->lexer->yylloc;
- $this->lstack[] = $yyloc;
- $symbol = null;
- $preErrorSymbol = null;
- $state = null;
- $action = null;
- $a = null;
- $r = null;
- $yyval = new stdClass;
- $p = null;
- $len = null;
- $newState = null;
- $expected = null;
- $errStr = null;
- while (true) {
- $state = $this->stack[count($this->stack)-1];
- if (isset($this->defaultActions[$state])) {
- $action = $this->defaultActions[$state];
- } else {
- if ($symbol == null) {
- $symbol = $this->lex();
- }
- $action = isset($this->table[$state][$symbol]) ? $this->table[$state][$symbol] : false;
- }
- if (!$action || !$action[0]) {
- if (!$recovering) {
- $expected = array();
- foreach ($this->table[$state] as $p => $ignore) {
- if (isset($this->terminals_[$p]) && $p > 2) {
- $expected[] = "'" . $this->terminals_[$p] . "'";
- }
- }
- $message = null;
- if (in_array("'STRING'", $expected) && in_array(substr($this->lexer->match, 0, 1), array('"', "'"))) {
- $message = "Invalid string";
- if ("'" === substr($this->lexer->match, 0, 1)) {
- $message .= ", it appears you used single quotes instead of double quotes";
- } elseif (preg_match('{".+?(\\\\[^"bfnrt/\\\\u])}', $this->lexer->getUpcomingInput(), $match)) {
- $message .= ", it appears you have an unescaped backslash at: ".$match[1];
- } elseif (preg_match('{"(?:[^"]+|\\\\")*$}m', $this->lexer->getUpcomingInput())) {
- $message .= ", it appears you forgot to terminated the string, or attempted to write a multiline string which is invalid";
- }
- }
- $errStr = 'Parse error on line ' . ($yylineno+1) . ":\n";
- $errStr .= $this->lexer->showPosition() . "\n";
- if ($message) {
- $errStr .= $message;
- } else {
- $errStr .= (count($expected) > 1) ? "Expected one of: " : "Expected: ";
- $errStr .= implode(', ', $expected);
- }
- if (',' === substr(trim($this->lexer->getPastInput()), -1)) {
- $errStr .= " - It appears you have an extra trailing comma";
- }
- $this->parseError($errStr, array(
- 'text' => $this->lexer->match,
- 'token' => !empty($this->terminals_[$symbol]) ? $this->terminals_[$symbol] : $symbol,
- 'line' => $this->lexer->yylineno,
- 'loc' => $yyloc,
- 'expected' => $expected,
- ));
- }
- if ($recovering == 3) {
- if ($symbol == $EOF) {
- throw new ParsingException($errStr ?: 'Parsing halted.');
- }
- $yyleng = $this->lexer->yyleng;
- $yytext = $this->lexer->yytext;
- $yylineno = $this->lexer->yylineno;
- $yyloc = $this->lexer->yylloc;
- $symbol = $this->lex();
- }
- while (true) {
- if (array_key_exists($TERROR, $this->table[$state])) {
- break;
- }
- if ($state == 0) {
- throw new ParsingException($errStr ?: 'Parsing halted.');
- }
- $this->popStack(1);
- $state = $this->stack[count($this->stack)-1];
- }
- $preErrorSymbol = $symbol;
- $symbol = $TERROR;
- $state = $this->stack[count($this->stack)-1];
- $action = isset($this->table[$state][$TERROR]) ? $this->table[$state][$TERROR] : false;
- $recovering = 3;
- }
- if (is_array($action[0]) && count($action) > 1) {
- throw new ParsingException('Parse Error: multiple actions possible at state: ' . $state . ', token: ' . $symbol);
- }
- switch ($action[0]) {
- case 1:
- $this->stack[] = $symbol;
- $this->vstack[] = $this->lexer->yytext;
- $this->lstack[] = $this->lexer->yylloc;
- $this->stack[] = $action[1];
- $symbol = null;
- if (!$preErrorSymbol) {
- $yyleng = $this->lexer->yyleng;
- $yytext = $this->lexer->yytext;
- $yylineno = $this->lexer->yylineno;
- $yyloc = $this->lexer->yylloc;
- if ($recovering > 0) {
- $recovering--;
- }
- } else {
- $symbol = $preErrorSymbol;
- $preErrorSymbol = null;
- }
- break;
- case 2:
- $len = $this->productions_[$action[1]][1];
- $yyval->token = $this->vstack[count($this->vstack) - $len];
-
- $yyval->store = array(
- 'first_line' => $this->lstack[count($this->lstack) - ($len ?: 1)]['first_line'],
- 'last_line' => $this->lstack[count($this->lstack) - 1]['last_line'],
- 'first_column' => $this->lstack[count($this->lstack) - ($len ?: 1)]['first_column'],
- 'last_column' => $this->lstack[count($this->lstack) - 1]['last_column'],
- );
- $r = $this->performAction($yyval, $yytext, $yyleng, $yylineno, $action[1], $this->vstack, $this->lstack);
- if (!$r instanceof Undefined) {
- return $r;
- }
- if ($len) {
- $this->popStack($len);
- }
- $this->stack[] = $this->productions_[$action[1]][0];
- $this->vstack[] = $yyval->token;
- $this->lstack[] = $yyval->store;
- $newState = $this->table[$this->stack[count($this->stack)-2]][$this->stack[count($this->stack)-1]];
- $this->stack[] = $newState;
- break;
- case 3:
- return true;
- }
- }
- return true;
- }
- protected function parseError($str, $hash)
- {
- throw new ParsingException($str, $hash);
- }
-
-
- private function performAction(stdClass $yyval, $yytext, $yyleng, $yylineno, $yystate, &$tokens)
- {
- $len = count($tokens) - 1;
- switch ($yystate) {
- case 1:
- $yytext = preg_replace_callback('{(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4})}', array($this, 'stringInterpolation'), $yytext);
- $yyval->token = $yytext;
- break;
- case 2:
- if (strpos($yytext, 'e') !== false || strpos($yytext, 'E') !== false) {
- $yyval->token = floatval($yytext);
- } else {
- $yyval->token = strpos($yytext, '.') === false ? intval($yytext) : floatval($yytext);
- }
- break;
- case 3:
- $yyval->token = null;
- break;
- case 4:
- $yyval->token = true;
- break;
- case 5:
- $yyval->token = false;
- break;
- case 6:
- return $yyval->token = $tokens[$len-1];
- case 13:
- if ($this->flags & self::PARSE_TO_ASSOC) {
- $yyval->token = array();
- } else {
- $yyval->token = new stdClass;
- }
- break;
- case 14:
- $yyval->token = $tokens[$len-1];
- break;
- case 15:
- $yyval->token = array($tokens[$len-2], $tokens[$len]);
- break;
- case 16:
- $property = $tokens[$len][0] === '' ? '_empty_' : $tokens[$len][0];
- if ($this->flags & self::PARSE_TO_ASSOC) {
- $yyval->token = array();
- $yyval->token[$property] = $tokens[$len][1];
- } else {
- $yyval->token = new stdClass;
- $yyval->token->$property = $tokens[$len][1];
- }
- break;
- case 17:
- if ($this->flags & self::PARSE_TO_ASSOC) {
- $yyval->token =& $tokens[$len-2];
- $key = $tokens[$len][0];
- if (($this->flags & self::DETECT_KEY_CONFLICTS) && isset($tokens[$len-2][$key])) {
- $errStr = 'Parse error on line ' . ($yylineno+1) . ":\n";
- $errStr .= $this->lexer->showPosition() . "\n";
- $errStr .= "Duplicate key: ".$tokens[$len][0];
- throw new DuplicateKeyException($errStr, $tokens[$len][0], array('line' => $yylineno+1));
- } elseif (($this->flags & self::ALLOW_DUPLICATE_KEYS) && isset($tokens[$len-2][$key])) {
- $duplicateCount = 1;
- do {
- $duplicateKey = $key . '.' . $duplicateCount++;
- } while (isset($tokens[$len-2][$duplicateKey]));
- $key = $duplicateKey;
- }
- $tokens[$len-2][$key] = $tokens[$len][1];
- } else {
- $yyval->token = $tokens[$len-2];
- $key = $tokens[$len][0] === '' ? '_empty_' : $tokens[$len][0];
- if (($this->flags & self::DETECT_KEY_CONFLICTS) && isset($tokens[$len-2]->{$key})) {
- $errStr = 'Parse error on line ' . ($yylineno+1) . ":\n";
- $errStr .= $this->lexer->showPosition() . "\n";
- $errStr .= "Duplicate key: ".$tokens[$len][0];
- throw new DuplicateKeyException($errStr, $tokens[$len][0], array('line' => $yylineno+1));
- } elseif (($this->flags & self::ALLOW_DUPLICATE_KEYS) && isset($tokens[$len-2]->{$key})) {
- $duplicateCount = 1;
- do {
- $duplicateKey = $key . '.' . $duplicateCount++;
- } while (isset($tokens[$len-2]->$duplicateKey));
- $key = $duplicateKey;
- }
- $tokens[$len-2]->$key = $tokens[$len][1];
- }
- break;
- case 18:
- $yyval->token = array();
- break;
- case 19:
- $yyval->token = $tokens[$len-1];
- break;
- case 20:
- $yyval->token = array($tokens[$len]);
- break;
- case 21:
- $tokens[$len-2][] = $tokens[$len];
- $yyval->token = $tokens[$len-2];
- break;
- }
- return new Undefined();
- }
- private function stringInterpolation($match)
- {
- switch ($match[0]) {
- case '\\\\':
- return '\\';
- case '\"':
- return '"';
- case '\b':
- return chr(8);
- case '\f':
- return chr(12);
- case '\n':
- return "\n";
- case '\r':
- return "\r";
- case '\t':
- return "\t";
- case '\/':
- return "/";
- default:
- return html_entity_decode('&#x'.ltrim(substr($match[0], 2), '0').';', 0, 'UTF-8');
- }
- }
- private function popStack($n)
- {
- $this->stack = array_slice($this->stack, 0, - (2 * $n));
- $this->vstack = array_slice($this->vstack, 0, - $n);
- $this->lstack = array_slice($this->lstack, 0, - $n);
- }
- private function lex()
- {
- $token = $this->lexer->lex() ?: 1;
-
- if (!is_numeric($token)) {
- $token = isset($this->symbols[$token]) ? $this->symbols[$token] : $token;
- }
- return $token;
- }
- private function failOnBOM($input)
- {
- $bom = "\xEF\xBB\xBF";
- if (substr($input, 0, 3) === $bom) {
- $this->parseError("BOM detected, make sure your input does not include a Unicode Byte-Order-Mark", array());
- }
- }
- }
- <?php
- namespace Seld\JsonLint;
- class Lexer
- {
- private $EOF = 1;
- private $rules = array(
- 0 => '/^\s+/',
- 1 => '/^-?([0-9]|[1-9][0-9]+)(\.[0-9]+)?([eE][+-]?[0-9]+)?\b/',
- 2 => '{^"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^\0-\x09\x0a-\x1f\\\\"]+)*"}',
- 3 => '/^\{/',
- 4 => '/^\}/',
- 5 => '/^\[/',
- 6 => '/^\]/',
- 7 => '/^,/',
- 8 => '/^:/',
- 9 => '/^true\b/',
- 10 => '/^false\b/',
- 11 => '/^null\b/',
- 12 => '/^$/',
- 13 => '/^./',
- );
- private $conditions = array(
- "INITIAL" => array(
- "rules" => array(0,1,2,3,4,5,6,7,8,9,10,11,12,13),
- "inclusive" => true,
- ),
- );
- private $conditionStack;
- private $input;
- private $more;
- private $done;
- private $matched;
- public $match;
- public $yylineno;
- public $yyleng;
- public $yytext;
- public $yylloc;
- public function lex()
- {
- $r = $this->next();
- if (!$r instanceof Undefined) {
- return $r;
- }
- return $this->lex();
- }
- public function setInput($input)
- {
- $this->input = $input;
- $this->more = false;
- $this->done = false;
- $this->yylineno = $this->yyleng = 0;
- $this->yytext = $this->matched = $this->match = '';
- $this->conditionStack = array('INITIAL');
- $this->yylloc = array('first_line' => 1, 'first_column' => 0, 'last_line' => 1, 'last_column' => 0);
- return $this;
- }
- public function showPosition()
- {
- $pre = str_replace("\n", '', $this->getPastInput());
- $c = str_repeat('-', max(0, strlen($pre) - 1));
- return $pre . str_replace("\n", '', $this->getUpcomingInput()) . "\n" . $c . "^";
- }
- public function getPastInput()
- {
- $past = substr($this->matched, 0, strlen($this->matched) - strlen($this->match));
- return (strlen($past) > 20 ? '...' : '') . substr($past, -20);
- }
- public function getUpcomingInput()
- {
- $next = $this->match;
- if (strlen($next) < 20) {
- $next .= substr($this->input, 0, 20 - strlen($next));
- }
- return substr($next, 0, 20) . (strlen($next) > 20 ? '...' : '');
- }
- protected function parseError($str, $hash)
- {
- throw new \Exception($str);
- }
- private function next()
- {
- if ($this->done) {
- return $this->EOF;
- }
- if (!$this->input) {
- $this->done = true;
- }
- $token = null;
- $match = null;
- $col = null;
- $lines = null;
- if (!$this->more) {
- $this->yytext = '';
- $this->match = '';
- }
- $rules = $this->getCurrentRules();
- $rulesLen = count($rules);
- for ($i=0; $i < $rulesLen; $i++) {
- if (preg_match($this->rules[$rules[$i]], $this->input, $match)) {
- preg_match_all('/\n.*/', $match[0], $lines);
- $lines = $lines[0];
- if ($lines) {
- $this->yylineno += count($lines);
- }
- $this->yylloc = array(
- 'first_line' => $this->yylloc['last_line'],
- 'last_line' => $this->yylineno+1,
- 'first_column' => $this->yylloc['last_column'],
- 'last_column' => $lines ? strlen($lines[count($lines) - 1]) - 1 : $this->yylloc['last_column'] + strlen($match[0]),
- );
- $this->yytext .= $match[0];
- $this->match .= $match[0];
- $this->yyleng = strlen($this->yytext);
- $this->more = false;
- $this->input = substr($this->input, strlen($match[0]));
- $this->matched .= $match[0];
- $token = $this->performAction($rules[$i], $this->conditionStack[count($this->conditionStack)-1]);
- if ($token) {
- return $token;
- }
- return new Undefined();
- }
- }
- if ($this->input === "") {
- return $this->EOF;
- }
- $this->parseError(
- 'Lexical error on line ' . ($this->yylineno+1) . ". Unrecognized text.\n" . $this->showPosition(),
- array(
- 'text' => "",
- 'token' => null,
- 'line' => $this->yylineno,
- )
- );
- }
- private function getCurrentRules()
- {
- return $this->conditions[$this->conditionStack[count($this->conditionStack)-1]]['rules'];
- }
- private function performAction($avoiding_name_collisions, $YY_START)
- {
- switch ($avoiding_name_collisions) {
- case 0:
- break;
- case 1:
- return 6;
- break;
- case 2:
- $this->yytext = substr($this->yytext, 1, $this->yyleng-2);
- return 4;
- case 3:
- return 17;
- case 4:
- return 18;
- case 5:
- return 23;
- case 6:
- return 24;
- case 7:
- return 22;
- case 8:
- return 21;
- case 9:
- return 10;
- case 10:
- return 11;
- case 11:
- return 8;
- case 12:
- return 14;
- case 13:
- return 'INVALID';
- }
- }
- }
- <?php
- namespace Seld\JsonLint;
- class ParsingException extends \Exception
- {
- protected $details;
- public function __construct($message, $details = array())
- {
- $this->details = $details;
- parent::__construct($message);
- }
- public function getDetails()
- {
- return $this->details;
- }
- }
- <?php
- namespace Seld\JsonLint;
- class Undefined
- {
- }
- Copyright (c) 2015 Jordi Boggiano
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is furnished
- to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- <?php
- require __DIR__.'/../vendor/autoload.php';
- echo 'Say hello (visible): ';
- $answer = Seld\CliPrompt\CliPrompt::prompt();
- echo 'You answered: '.$answer . PHP_EOL;
- echo 'Say hello (hidden): ';
- $answer = Seld\CliPrompt\CliPrompt::hiddenPrompt();
- echo 'You answered: '.$answer . PHP_EOL;
- <?php
- namespace Seld\CliPrompt;
- class CliPrompt
- {
- public static function prompt()
- {
- $stdin = fopen('php://stdin', 'r');
- $answer = self::trimAnswer(fgets($stdin, 4096));
- fclose($stdin);
- return $answer;
- }
- public static function hiddenPrompt($allowFallback = false)
- {
- if (defined('PHP_WINDOWS_VERSION_BUILD')) {
- $exe = __DIR__.'\\..\\res\\hiddeninput.exe';
- if ('phar:' === substr(__FILE__, 0, 5)) {
- $tmpExe = sys_get_temp_dir().'/hiddeninput.exe';
-
- $source = fopen($exe, 'r');
- $target = fopen($tmpExe, 'w+');
- stream_copy_to_stream($source, $target);
- fclose($source);
- fclose($target);
- unset($source, $target);
- $exe = $tmpExe;
- }
- $answer = self::trimAnswer(shell_exec($exe));
- if (isset($tmpExe)) {
- unlink($tmpExe);
- }
- echo PHP_EOL;
- return $answer;
- }
- if (file_exists('/usr/bin/env')) {
- $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null";
- foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) {
- if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) {
- $shell = $sh;
- break;
- }
- }
- if (isset($shell)) {
- $readCmd = ($shell === 'csh') ? 'set mypassword = $<' : 'read -r mypassword';
- $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd);
- $value = self::trimAnswer(shell_exec($command));
- echo PHP_EOL;
- return $value;
- }
- }
- if (!$allowFallback) {
- throw new \RuntimeException('Could not prompt for input in a secure fashion, aborting');
- }
- return self::prompt();
- }
- private static function trimAnswer($str)
- {
- return preg_replace('{\r?\n$}D', '', $str);
- }
- }
- Copyright (c) 2008, Gradua Networks
- Author: Bruno Prieto Reis
- All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- * Neither the name of the Gradua Networks nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- <?php
- namespace JsonSchema\Constraints;
- class CollectionConstraint extends Constraint
- {
- public function check($value, $schema = null, $path = null, $i = null)
- {
- if (isset($schema->minItems) && count($value) < $schema->minItems) {
- $this->addError($path, "There must be a minimum of " . $schema->minItems . " items in the array", 'minItems', array('minItems' => $schema->minItems,));
- }
- if (isset($schema->maxItems) && count($value) > $schema->maxItems) {
- $this->addError($path, "There must be a maximum of " . $schema->maxItems . " items in the array", 'maxItems', array('maxItems' => $schema->maxItems,));
- }
- if (isset($schema->uniqueItems) && $schema->uniqueItems) {
- $unique = $value;
- if (is_array($value) && count($value)) {
- $unique = array_map(function($e) { return var_export($e, true); }, $value);
- }
- if (count(array_unique($unique)) != count($value)) {
- $this->addError($path, "There are no duplicates allowed in the array", 'uniqueItems');
- }
- }
- if (isset($schema->items)) {
- $this->validateItems($value, $schema, $path, $i);
- }
- }
- protected function validateItems($value, $schema = null, $path = null, $i = null)
- {
- if (is_object($schema->items)) {
- foreach ($value as $k => $v) {
- $initErrors = $this->getErrors();
- $this->checkUndefined($v, $schema->items, $path, $k);
- if (count($initErrors) < count($this->getErrors()) && (isset($schema->additionalItems) && $schema->additionalItems !== false)) {
- $secondErrors = $this->getErrors();
- $this->checkUndefined($v, $schema->additionalItems, $path, $k);
- }
- if (isset($secondErrors) && count($secondErrors) < count($this->getErrors())) {
- $this->errors = $secondErrors;
- } else if (isset($secondErrors) && count($secondErrors) === count($this->getErrors())) {
- $this->errors = $initErrors;
- }
- }
- } else {
- foreach ($value as $k => $v) {
- if (array_key_exists($k, $schema->items)) {
- $this->checkUndefined($v, $schema->items[$k], $path, $k);
- } else {
- if (property_exists($schema, 'additionalItems')) {
- if ($schema->additionalItems !== false) {
- $this->checkUndefined($v, $schema->additionalItems, $path, $k);
- } else {
- $this->addError(
- $path, 'The item ' . $i . '[' . $k . '] is not defined and the definition does not allow additional items', 'additionalItems', array('additionalItems' => $schema->additionalItems,));
- }
- } else {
- $this->checkUndefined($v, new \stdClass(), $path, $k);
- }
- }
- }
- if(count($value) > 0) {
- for ($k = count($value); $k < count($schema->items); $k++) {
- $this->checkUndefined(new UndefinedConstraint(), $schema->items[$k], $path, $k);
- }
- }
- }
- }
- }
- <?php
- namespace JsonSchema\Constraints;
- use JsonSchema\Uri\UriRetriever;
- abstract class Constraint implements ConstraintInterface
- {
- protected $checkMode = self::CHECK_MODE_NORMAL;
- protected $uriRetriever;
- protected $errors = array();
- protected $inlineSchemaProperty = '$schema';
- const CHECK_MODE_NORMAL = 1;
- const CHECK_MODE_TYPE_CAST = 2;
- private $factory;
- public function __construct($checkMode = self::CHECK_MODE_NORMAL, UriRetriever $uriRetriever = null, Factory $factory = null)
- {
- $this->checkMode = $checkMode;
- $this->uriRetriever = $uriRetriever;
- $this->factory = $factory;
- }
- public function getUriRetriever()
- {
- if (is_null($this->uriRetriever))
- {
- $this->setUriRetriever(new UriRetriever);
- }
- return $this->uriRetriever;
- }
- public function getFactory()
- {
- if (!$this->factory) {
- $this->factory = new Factory($this->getUriRetriever());
- }
- return $this->factory;
- }
- public function setUriRetriever(UriRetriever $uriRetriever)
- {
- $this->uriRetriever = $uriRetriever;
- }
- public function addError($path, $message, $constraint='', array $more=null)
- {
- $error = array(
- 'property' => $path,
- 'message' => $message,
- 'constraint' => $constraint,
- );
- if (is_array($more) && count($more) > 0)
- {
- $error += $more;
- }
- $this->errors[] = $error;
- }
- public function addErrors(array $errors)
- {
- $this->errors = array_merge($this->errors, $errors);
- }
- public function getErrors()
- {
- return $this->errors;
- }
- public function isValid()
- {
- return !$this->getErrors();
- }
- public function reset()
- {
- $this->errors = array();
- }
- protected function incrementPath($path, $i)
- {
- if ($path !== '') {
- if (is_int($i)) {
- $path .= '[' . $i . ']';
- } elseif ($i == '') {
- $path .= '';
- } else {
- $path .= '.' . $i;
- }
- } else {
- $path = $i;
- }
- return $path;
- }
- protected function checkArray($value, $schema = null, $path = null, $i = null)
- {
- $validator = $this->getFactory()->createInstanceFor('collection');
- $validator->check($value, $schema, $path, $i);
- $this->addErrors($validator->getErrors());
- }
- protected function checkObject($value, $schema = null, $path = null, $i = null, $patternProperties = null)
- {
- $validator = $this->getFactory()->createInstanceFor('object');
- $validator->check($value, $schema, $path, $i, $patternProperties);
- $this->addErrors($validator->getErrors());
- }
- protected function checkType($value, $schema = null, $path = null, $i = null)
- {
- $validator = $this->getFactory()->createInstanceFor('type');
- $validator->check($value, $schema, $path, $i);
- $this->addErrors($validator->getErrors());
- }
- protected function checkUndefined($value, $schema = null, $path = null, $i = null)
- {
- $validator = $this->getFactory()->createInstanceFor('undefined');
- $validator->check($value, $schema, $path, $i);
- $this->addErrors($validator->getErrors());
- }
- protected function checkString($value, $schema = null, $path = null, $i = null)
- {
- $validator = $this->getFactory()->createInstanceFor('string');
- $validator->check($value, $schema, $path, $i);
- $this->addErrors($validator->getErrors());
- }
- protected function checkNumber($value, $schema = null, $path = null, $i = null)
- {
- $validator = $this->getFactory()->createInstanceFor('number');
- $validator->check($value, $schema, $path, $i);
- $this->addErrors($validator->getErrors());
- }
- protected function checkEnum($value, $schema = null, $path = null, $i = null)
- {
- $validator = $this->getFactory()->createInstanceFor('enum');
- $validator->check($value, $schema, $path, $i);
- $this->addErrors($validator->getErrors());
- }
- protected function checkFormat($value, $schema = null, $path = null, $i = null)
- {
- $validator = $this->getFactory()->createInstanceFor('format');
- $validator->check($value, $schema, $path, $i);
- $this->addErrors($validator->getErrors());
- }
- protected function retrieveUri($uri)
- {
- if (null === $this->uriRetriever) {
- $this->setUriRetriever(new UriRetriever);
- }
- $jsonSchema = $this->uriRetriever->retrieve($uri);
- return $jsonSchema;
- }
- }
- <?php
- namespace JsonSchema\Constraints;
- interface ConstraintInterface
- {
- public function getErrors();
- public function addErrors(array $errors);
- public function addError($path, $message, $constraint='', array $more=null);
- public function isValid();
- public function check($value, $schema = null, $path = null, $i = null);
- }<?php
- namespace JsonSchema\Constraints;
- class EnumConstraint extends Constraint
- {
- public function check($element, $schema = null, $path = null, $i = null)
- {
- if ($element instanceof UndefinedConstraint && (!isset($schema->required) || !$schema->required)) {
- return;
- }
- foreach ($schema->enum as $enum) {
- $type = gettype($element);
- if ($type === gettype($enum)) {
- if ($type == "object") {
- if ($element == $enum)
- return;
- } else {
- if ($element === $enum)
- return;
- }
- }
- }
- $this->addError($path, "Does not have a value in the enumeration " . print_r($schema->enum, true), 'enum', array('enum' => $schema->enum,));
- }
- }
- <?php
- namespace JsonSchema\Constraints;
- use JsonSchema\Exception\InvalidArgumentException;
- use JsonSchema\Uri\UriRetriever;
- use JsonSchema\Validator;
- class Factory
- {
- protected $uriRetriever;
- public function __construct(UriRetriever $uriRetriever = null)
- {
- if (!$uriRetriever) {
- $uriRetriever = new UriRetriever();
- }
- $this->uriRetriever = $uriRetriever;
- }
- public function getUriRetriever()
- {
- return $this->uriRetriever;
- }
- public function createInstanceFor($constraintName)
- {
- switch ($constraintName) {
- case 'array':
- case 'collection':
- return new CollectionConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
- case 'object':
- return new ObjectConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
- case 'type':
- return new TypeConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
- case 'undefined':
- return new UndefinedConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
- case 'string':
- return new StringConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
- case 'number':
- return new NumberConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
- case 'enum':
- return new EnumConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
- case 'format':
- return new FormatConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
- case 'schema':
- return new SchemaConstraint(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
- case 'validator':
- return new Validator(Constraint::CHECK_MODE_NORMAL, $this->uriRetriever, $this);
- }
- throw new InvalidArgumentException('Unknown constraint ' . $constraintName);
- }
- }
- <?php
- namespace JsonSchema\Constraints;
- class FormatConstraint extends Constraint
- {
- public function check($element, $schema = null, $path = null, $i = null)
- {
- if (!isset($schema->format)) {
- return;
- }
- switch ($schema->format) {
- case 'date':
- if (!$date = $this->validateDateTime($element, 'Y-m-d')) {
- $this->addError($path, sprintf('Invalid date %s, expected format YYYY-MM-DD', json_encode($element)), 'format', array('format' => $schema->format,));
- }
- break;
- case 'time':
- if (!$this->validateDateTime($element, 'H:i:s')) {
- $this->addError($path, sprintf('Invalid time %s, expected format hh:mm:ss', json_encode($element)), 'format', array('format' => $schema->format,));
- }
- break;
- case 'date-time':
- if (!$this->validateDateTime($element, 'Y-m-d\TH:i:s\Z') &&
- !$this->validateDateTime($element, 'Y-m-d\TH:i:s.u\Z') &&
- !$this->validateDateTime($element, 'Y-m-d\TH:i:sP') &&
- !$this->validateDateTime($element, 'Y-m-d\TH:i:sO')
- ) {
- $this->addError($path, sprintf('Invalid date-time %s, expected format YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DDThh:mm:ss+hh:mm', json_encode($element)), 'format', array('format' => $schema->format,));
- }
- break;
- case 'utc-millisec':
- if (!$this->validateDateTime($element, 'U')) {
- $this->addError($path, sprintf('Invalid time %s, expected integer of milliseconds since Epoch', json_encode($element)), 'format', array('format' => $schema->format,));
- }
- break;
- case 'regex':
- if (!$this->validateRegex($element)) {
- $this->addError($path, 'Invalid regex format ' . $element, 'format', array('format' => $schema->format,));
- }
- break;
- case 'color':
- if (!$this->validateColor($element)) {
- $this->addError($path, "Invalid color", 'format', array('format' => $schema->format,));
- }
- break;
- case 'style':
- if (!$this->validateStyle($element)) {
- $this->addError($path, "Invalid style", 'format', array('format' => $schema->format,));
- }
- break;
- case 'phone':
- if (!$this->validatePhone($element)) {
- $this->addError($path, "Invalid phone number", 'format', array('format' => $schema->format,));
- }
- break;
- case 'uri':
- if (null === filter_var($element, FILTER_VALIDATE_URL, FILTER_NULL_ON_FAILURE)) {
- $this->addError($path, "Invalid URL format", 'format', array('format' => $schema->format,));
- }
- break;
- case 'email':
- if (null === filter_var($element, FILTER_VALIDATE_EMAIL, FILTER_NULL_ON_FAILURE)) {
- $this->addError($path, "Invalid email", 'format', array('format' => $schema->format,));
- }
- break;
- case 'ip-address':
- case 'ipv4':
- if (null === filter_var($element, FILTER_VALIDATE_IP, FILTER_NULL_ON_FAILURE | FILTER_FLAG_IPV4)) {
- $this->addError($path, "Invalid IP address", 'format', array('format' => $schema->format,));
- }
- break;
- case 'ipv6':
- if (null === filter_var($element, FILTER_VALIDATE_IP, FILTER_NULL_ON_FAILURE | FILTER_FLAG_IPV6)) {
- $this->addError($path, "Invalid IP address", 'format', array('format' => $schema->format,));
- }
- break;
- case 'host-name':
- case 'hostname':
- if (!$this->validateHostname($element)) {
- $this->addError($path, "Invalid hostname", 'format', array('format' => $schema->format,));
- }
- break;
- default:
-
-
-
-
-
- break;
- }
- }
- protected function validateDateTime($datetime, $format)
- {
- $dt = \DateTime::createFromFormat($format, $datetime);
- if (!$dt) {
- return false;
- }
- if ($datetime === $dt->format($format)) {
- return true;
- }
-
-
-
- if ((strpos('u', $format) !== -1) && (intval($dt->format('u')) > 0)) {
- return true;
- }
- return false;
- }
- protected function validateRegex($regex)
- {
- return false !== @preg_match('/' . $regex . '/', '');
- }
- protected function validateColor($color)
- {
- if (in_array(strtolower($color), array('aqua', 'black', 'blue', 'fuchsia',
- 'gray', 'green', 'lime', 'maroon', 'navy', 'olive', 'orange', 'purple',
- 'red', 'silver', 'teal', 'white', 'yellow'))) {
- return true;
- }
- return preg_match('/^#([a-f0-9]{3}|[a-f0-9]{6})$/i', $color);
- }
- protected function validateStyle($style)
- {
- $properties = explode(';', rtrim($style, ';'));
- $invalidEntries = preg_grep('/^\s*[-a-z]+\s*:\s*.+$/i', $properties, PREG_GREP_INVERT);
- return empty($invalidEntries);
- }
- protected function validatePhone($phone)
- {
- return preg_match('/^\+?(\(\d{3}\)|\d{3}) \d{3} \d{4}$/', $phone);
- }
- protected function validateHostname($host)
- {
- return preg_match('/^[_a-z]+\.([_a-z]+\.?)+$/i', $host);
- }
- }
- <?php
- namespace JsonSchema\Constraints;
- class NumberConstraint extends Constraint
- {
- public function check($element, $schema = null, $path = null, $i = null)
- {
- if (isset($schema->exclusiveMinimum)) {
- if (isset($schema->minimum)) {
- if ($schema->exclusiveMinimum && $element === $schema->minimum) {
- $this->addError($path, "Must have a minimum value greater than boundary value of " . $schema->minimum, 'exclusiveMinimum', array('minimum' => $schema->minimum,));
- } else if ($element < $schema->minimum) {
- $this->addError($path, "Must have a minimum value of " . $schema->minimum, 'minimum', array('minimum' => $schema->minimum,));
- }
- } else {
- $this->addError($path, "Use of exclusiveMinimum requires presence of minimum", 'missingMinimum');
- }
- } else if (isset($schema->minimum) && $element < $schema->minimum) {
- $this->addError($path, "Must have a minimum value of " . $schema->minimum, 'minimum', array('minimum' => $schema->minimum,));
- }
- if (isset($schema->exclusiveMaximum)) {
- if (isset($schema->maximum)) {
- if ($schema->exclusiveMaximum && $element === $schema->maximum) {
- $this->addError($path, "Must have a maximum value less than boundary value of " . $schema->maximum, 'exclusiveMaximum', array('maximum' => $schema->maximum,));
- } else if ($element > $schema->maximum) {
- $this->addError($path, "Must have a maximum value of " . $schema->maximum, 'maximum', array('maximum' => $schema->maximum,));
- }
- } else {
- $this->addError($path, "Use of exclusiveMaximum requires presence of maximum", 'missingMinimum');
- }
- } else if (isset($schema->maximum) && $element > $schema->maximum) {
- $this->addError($path, "Must have a maximum value of " . $schema->maximum, 'maximum', array('maximum' => $schema->maximum,));
- }
- if (isset($schema->divisibleBy) && $this->fmod($element, $schema->divisibleBy) != 0) {
- $this->addError($path, "Is not divisible by " . $schema->divisibleBy, 'divisibleBy', array('divisibleBy' => $schema->divisibleBy,));
- }
- if (isset($schema->multipleOf) && $this->fmod($element, $schema->multipleOf) != 0) {
- $this->addError($path, "Must be a multiple of " . $schema->multipleOf, 'multipleOf', array('multipleOf' => $schema->multipleOf,));
- }
- $this->checkFormat($element, $schema, $path, $i);
- }
- private function fmod($number1, $number2)
- {
- $modulus = fmod($number1, $number2);
- $precision = abs(0.0000000001);
- $diff = (float)($modulus - $number2);
- if (-$precision < $diff && $diff < $precision) {
- return 0.0;
- }
- $decimals1 = mb_strpos($number1, ".") ? mb_strlen($number1) - mb_strpos($number1, ".") - 1 : 0;
- $decimals2 = mb_strpos($number2, ".") ? mb_strlen($number2) - mb_strpos($number2, ".") - 1 : 0;
- return (float)round($modulus, max($decimals1, $decimals2));
- }
- }
- <?php
- namespace JsonSchema\Constraints;
- class ObjectConstraint extends Constraint
- {
- function check($element, $definition = null, $path = null, $additionalProp = null, $patternProperties = null)
- {
- if ($element instanceof UndefinedConstraint) {
- return;
- }
- $matches = array();
- if ($patternProperties) {
- $matches = $this->validatePatternProperties($element, $path, $patternProperties);
- }
- if ($definition) {
- $this->validateDefinition($element, $definition, $path);
- }
- $this->validateElement($element, $matches, $definition, $path, $additionalProp);
- }
- public function validatePatternProperties($element, $path, $patternProperties)
- {
- $try = array('/','#','+','~','%');
- $matches = array();
- foreach ($patternProperties as $pregex => $schema) {
- $delimiter = '/';
- foreach ($try as $delimiter) {
- if (strpos($pregex, $delimiter) === false) {
- break;
- }
- }
- if (@preg_match($delimiter. $pregex . $delimiter, '') === false) {
- $this->addError($path, 'The pattern "' . $pregex . '" is invalid', 'pregex', array('pregex' => $pregex,));
- continue;
- }
- foreach ($element as $i => $value) {
- if (preg_match($delimiter . $pregex . $delimiter, $i)) {
- $matches[] = $i;
- $this->checkUndefined($value, $schema ? : new \stdClass(), $path, $i);
- }
- }
- }
- return $matches;
- }
- public function validateElement($element, $matches, $objectDefinition = null, $path = null, $additionalProp = null)
- {
- foreach ($element as $i => $value) {
- $property = $this->getProperty($element, $i, new UndefinedConstraint());
- $definition = $this->getProperty($objectDefinition, $i);
- if (!in_array($i, $matches) && $additionalProp === false && $this->inlineSchemaProperty !== $i && !$definition) {
- $this->addError($path, "The property " . $i . " is not defined and the definition does not allow additional properties", 'additionalProp');
- }
- if (!in_array($i, $matches) && $additionalProp && !$definition) {
- if ($additionalProp === true) {
- $this->checkUndefined($value, null, $path, $i);
- } else {
- $this->checkUndefined($value, $additionalProp, $path, $i);
- }
- }
- $require = $this->getProperty($definition, 'requires');
- if ($require && !$this->getProperty($element, $require)) {
- $this->addError($path, "The presence of the property " . $i . " requires that " . $require . " also be present", 'requires');
- }
- if (!$definition) {
- $this->checkUndefined($value, new \stdClass(), $path, $i);
- }
- }
- }
- public function validateDefinition($element, $objectDefinition = null, $path = null)
- {
- foreach ($objectDefinition as $i => $value) {
- $property = $this->getProperty($element, $i, new UndefinedConstraint());
- $definition = $this->getProperty($objectDefinition, $i);
- $this->checkUndefined($property, $definition, $path, $i);
- }
- }
- protected function getProperty($element, $property, $fallback = null)
- {
- if (is_array($element) ) {
- return array_key_exists($property, $element) ? $element[$property] : $fallback;
- } elseif (is_object($element)) {
- return property_exists($element, $property) ? $element->$property : $fallback;
- }
- return $fallback;
- }
- }
- <?php
- namespace JsonSchema\Constraints;
- use JsonSchema\Exception\InvalidArgumentException;
- class SchemaConstraint extends Constraint
- {
- public function check($element, $schema = null, $path = null, $i = null)
- {
- if ($schema !== null) {
- $this->checkUndefined($element, $schema, '', '');
- } elseif (property_exists($element, $this->inlineSchemaProperty)) {
- $this->checkUndefined($element, $element->{$this->inlineSchemaProperty}, '', '');
- } else {
- throw new InvalidArgumentException('no schema found to verify against');
- }
- }
- }<?php
- namespace JsonSchema\Constraints;
- class StringConstraint extends Constraint
- {
- public function check($element, $schema = null, $path = null, $i = null)
- {
- if (isset($schema->maxLength) && $this->strlen($element) > $schema->maxLength) {
- $this->addError($path, "Must be at most " . $schema->maxLength . " characters long", 'maxLength', array(
- 'maxLength' => $schema->maxLength,
- ));
- }
- if (isset($schema->minLength) && $this->strlen($element) < $schema->minLength) {
- $this->addError($path, "Must be at least " . $schema->minLength . " characters long", 'minLength', array(
- 'minLength' => $schema->minLength,
- ));
- }
- if (isset($schema->pattern) && !preg_match('#' . str_replace('#', '\\#', $schema->pattern) . '#', $element)) {
- $this->addError($path, "Does not match the regex pattern " . $schema->pattern, 'pattern', array(
- 'pattern' => $schema->pattern,
- ));
- }
- $this->checkFormat($element, $schema, $path, $i);
- }
- private function strlen($string)
- {
- if (extension_loaded('mbstring')) {
- return mb_strlen($string, mb_detect_encoding($string));
- } else {
- return strlen($string);
- }
- }
- }
- <?php
- namespace JsonSchema\Constraints;
- use JsonSchema\Exception\InvalidArgumentException;
- use UnexpectedValueException as StandardUnexpectedValueException;
- class TypeConstraint extends Constraint
- {
- static $wording = array(
- 'integer' => 'an integer',
- 'number' => 'a number',
- 'boolean' => 'a boolean',
- 'object' => 'an object',
- 'array' => 'an array',
- 'string' => 'a string',
- 'null' => 'a null',
- 'any' => NULL,
- 0 => NULL,
- );
- public function check($value = null, $schema = null, $path = null, $i = null)
- {
- $type = isset($schema->type) ? $schema->type : null;
- $isValid = true;
- if (is_array($type)) {
- $validatedOneType = false;
- $errors = array();
- foreach ($type as $tp) {
- $validator = new TypeConstraint($this->checkMode);
- $subSchema = new \stdClass();
- $subSchema->type = $tp;
- $validator->check($value, $subSchema, $path, null);
- $error = $validator->getErrors();
- if (!count($error)) {
- $validatedOneType = true;
- break;
- }
- $errors = $error;
- }
- if (!$validatedOneType) {
- $this->addErrors($errors);
- return;
- }
- } elseif (is_object($type)) {
- $this->checkUndefined($value, $type, $path);
- } else {
- $isValid = $this->validateType($value, $type);
- }
- if ($isValid === false) {
- if (!isset(self::$wording[$type])) {
- throw new StandardUnexpectedValueException(
- sprintf(
- "No wording for %s available, expected wordings are: [%s]",
- var_export($type, true),
- implode(', ', array_filter(self::$wording)))
- );
- }
- $this->addError($path, ucwords(gettype($value)) . " value found, but " . self::$wording[$type] . " is required", 'type');
- }
- }
- protected function validateType($value, $type)
- {
- if (!$type) {
- return true;
- }
- if ('integer' === $type) {
- return is_int($value);
- }
- if ('number' === $type) {
- return is_numeric($value) && !is_string($value);
- }
- if ('boolean' === $type) {
- return is_bool($value);
- }
- if ('object' === $type) {
- return is_object($value);
- }
- if ('array' === $type) {
- return is_array($value);
- }
- if ('string' === $type) {
- return is_string($value);
- }
- if ('email' === $type) {
- return is_string($value);
- }
- if ('null' === $type) {
- return is_null($value);
- }
- if ('any' === $type) {
- return true;
- }
- throw new InvalidArgumentException((is_object($value) ? 'object' : $value) . ' is an invalid type for ' . $type);
- }
- }
- <?php
- namespace JsonSchema\Constraints;
- use JsonSchema\Exception\InvalidArgumentException;
- use JsonSchema\Uri\UriResolver;
- class UndefinedConstraint extends Constraint
- {
- public function check($value, $schema = null, $path = null, $i = null)
- {
- if (is_null($schema)) {
- return;
- }
- if (!is_object($schema)) {
- throw new InvalidArgumentException(
- 'Given schema must be an object in ' . $path
- . ' but is a ' . gettype($schema)
- );
- }
- $i = is_null($i) ? "" : $i;
- $path = $this->incrementPath($path, $i);
- $this->validateCommonProperties($value, $schema, $path);
- $this->validateOfProperties($value, $schema, $path);
- $this->validateTypes($value, $schema, $path, $i);
- }
- public function validateTypes($value, $schema = null, $path = null, $i = null)
- {
- if (is_array($value)) {
- $this->checkArray($value, $schema, $path, $i);
- }
- if (is_object($value) && (isset($schema->properties) || isset($schema->patternProperties) || isset($schema->additionalProperties))) {
- $this->checkObject(
- $value,
- isset($schema->properties) ? $schema->properties : null,
- $path,
- isset($schema->additionalProperties) ? $schema->additionalProperties : null,
- isset($schema->patternProperties) ? $schema->patternProperties : null
- );
- }
- if (is_string($value)) {
- $this->checkString($value, $schema, $path, $i);
- }
- if (is_numeric($value)) {
- $this->checkNumber($value, $schema, $path, $i);
- }
- if (isset($schema->enum)) {
- $this->checkEnum($value, $schema, $path, $i);
- }
- }
- protected function validateCommonProperties($value, $schema = null, $path = null, $i = "")
- {
- if (isset($schema->extends)) {
- if (is_string($schema->extends)) {
- $schema->extends = $this->validateUri($schema, $schema->extends);
- }
- if (is_array($schema->extends)) {
- foreach ($schema->extends as $extends) {
- $this->checkUndefined($value, $extends, $path, $i);
- }
- } else {
- $this->checkUndefined($value, $schema->extends, $path, $i);
- }
- }
- if (is_object($value)) {
- if (!($value instanceof UndefinedConstraint) && isset($schema->required) && is_array($schema->required) ) {
- foreach ($schema->required as $required) {
- if (!property_exists($value, $required)) {
- $this->addError((!$path) ? $required : "$path.$required", "The property " . $required . " is required", 'required');
- }
- }
- } else if (isset($schema->required) && !is_array($schema->required)) {
- if ( $schema->required && $value instanceof UndefinedConstraint) {
- $this->addError($path, "Is missing and it is required", 'required');
- }
- }
- }
- if (!($value instanceof UndefinedConstraint)) {
- $this->checkType($value, $schema, $path);
- }
- if (isset($schema->disallow)) {
- $initErrors = $this->getErrors();
- $typeSchema = new \stdClass();
- $typeSchema->type = $schema->disallow;
- $this->checkType($value, $typeSchema, $path);
- if (count($this->getErrors()) == count($initErrors)) {
- $this->addError($path, "Disallowed value was matched", 'disallow');
- } else {
- $this->errors = $initErrors;
- }
- }
- if (isset($schema->not)) {
- $initErrors = $this->getErrors();
- $this->checkUndefined($value, $schema->not, $path, $i);
- if (count($this->getErrors()) == count($initErrors)) {
- $this->addError($path, "Matched a schema which it should not", 'not');
- } else {
- $this->errors = $initErrors;
- }
- }
- if (is_object($value)) {
- if (isset($schema->minProperties)) {
- if (count(get_object_vars($value)) < $schema->minProperties) {
- $this->addError($path, "Must contain a minimum of " . $schema->minProperties . " properties", 'minProperties', array('minProperties' => $schema->minProperties,));
- }
- }
- if (isset($schema->maxProperties)) {
- if (count(get_object_vars($value)) > $schema->maxProperties) {
- $this->addError($path, "Must contain no more than " . $schema->maxProperties . " properties", 'maxProperties', array('maxProperties' => $schema->maxProperties,));
- }
- }
- }
- if (is_object($value) && isset($schema->dependencies)) {
- $this->validateDependencies($value, $schema->dependencies, $path);
- }
- }
- protected function validateOfProperties($value, $schema, $path, $i = "")
- {
- if ($value instanceof UndefinedConstraint) {
- return;
- }
- if (isset($schema->allOf)) {
- $isValid = true;
- foreach ($schema->allOf as $allOf) {
- $initErrors = $this->getErrors();
- $this->checkUndefined($value, $allOf, $path, $i);
- $isValid = $isValid && (count($this->getErrors()) == count($initErrors));
- }
- if (!$isValid) {
- $this->addError($path, "Failed to match all schemas", 'allOf');
- }
- }
- if (isset($schema->anyOf)) {
- $isValid = false;
- $startErrors = $this->getErrors();
- foreach ($schema->anyOf as $anyOf) {
- $initErrors = $this->getErrors();
- $this->checkUndefined($value, $anyOf, $path, $i);
- if ($isValid = (count($this->getErrors()) == count($initErrors))) {
- break;
- }
- }
- if (!$isValid) {
- $this->addError($path, "Failed to match at least one schema", 'anyOf');
- } else {
- $this->errors = $startErrors;
- }
- }
- if (isset($schema->oneOf)) {
- $allErrors = array();
- $matchedSchemas = 0;
- $startErrors = $this->getErrors();
- foreach ($schema->oneOf as $oneOf) {
- $this->errors = array();
- $this->checkUndefined($value, $oneOf, $path, $i);
- if (count($this->getErrors()) == 0) {
- $matchedSchemas++;
- }
- $allErrors = array_merge($allErrors, array_values($this->getErrors()));
- }
- if ($matchedSchemas !== 1) {
- $this->addErrors(
- array_merge(
- $allErrors,
- array(array(
- 'property' => $path,
- 'message' => "Failed to match exactly one schema",
- 'constraint' => 'oneOf',
- ),),
- $startErrors
- )
- );
- } else {
- $this->errors = $startErrors;
- }
- }
- }
- protected function validateDependencies($value, $dependencies, $path, $i = "")
- {
- foreach ($dependencies as $key => $dependency) {
- if (property_exists($value, $key)) {
- if (is_string($dependency)) {
- if (!property_exists($value, $dependency)) {
- $this->addError($path, "$key depends on $dependency and $dependency is missing", 'dependencies');
- }
- } else if (is_array($dependency)) {
- foreach ($dependency as $d) {
- if (!property_exists($value, $d)) {
- $this->addError($path, "$key depends on $d and $d is missing", 'dependencies');
- }
- }
- } else if (is_object($dependency)) {
- $this->checkUndefined($value, $dependency, $path, $i);
- }
- }
- }
- }
- protected function validateUri($schema, $schemaUri = null)
- {
- $resolver = new UriResolver();
- $retriever = $this->getUriRetriever();
- $jsonSchema = null;
- if ($resolver->isValid($schemaUri)) {
- $schemaId = property_exists($schema, 'id') ? $schema->id : null;
- $jsonSchema = $retriever->retrieve($schemaId, $schemaUri);
- }
- return $jsonSchema;
- }
- }
- <?php
- namespace JsonSchema\Exception;
- class InvalidArgumentException extends \InvalidArgumentException
- {
- }<?php
- namespace JsonSchema\Exception;
- class InvalidSchemaMediaTypeException extends \RuntimeException
- {
- }<?php
- namespace JsonSchema\Exception;
- class InvalidSourceUriException extends InvalidArgumentException
- {
- }
- <?php
- namespace JsonSchema\Exception;
- class JsonDecodingException extends \RuntimeException
- {
- public function __construct($code = JSON_ERROR_NONE, \Exception $previous = null)
- {
- switch ($code) {
- case JSON_ERROR_DEPTH:
- $message = 'The maximum stack depth has been exceeded';
- break;
- case JSON_ERROR_STATE_MISMATCH:
- $message = 'Invalid or malformed JSON';
- break;
- case JSON_ERROR_CTRL_CHAR:
- $message = 'Control character error, possibly incorrectly encoded';
- break;
- case JSON_ERROR_UTF8:
- $message = 'Malformed UTF-8 characters, possibly incorrectly encoded';
- break;
- case JSON_ERROR_SYNTAX:
- $message = 'JSON syntax is malformed';
- break;
- default:
- $message = 'Syntax error';
- }
- parent::__construct($message, $code, $previous);
- }
- }<?php
- namespace JsonSchema\Exception;
- class ResourceNotFoundException extends \RuntimeException
- {
- }<?php
- namespace JsonSchema\Exception;
- class UriResolverException extends \RuntimeException
- {
- }<?php
- namespace JsonSchema;
- use JsonSchema\Exception\JsonDecodingException;
- use JsonSchema\Uri\Retrievers\UriRetrieverInterface;
- use JsonSchema\Uri\UriRetriever;
- class RefResolver
- {
- protected static $depth = 0;
- public static $maxDepth = 7;
- protected $uriRetriever = null;
- protected $rootSchema = null;
- public function __construct($retriever = null)
- {
- $this->uriRetriever = $retriever;
- }
- public function fetchRef($ref, $sourceUri)
- {
- $retriever = $this->getUriRetriever();
- $jsonSchema = $retriever->retrieve($ref, $sourceUri);
- $this->resolve($jsonSchema);
- return $jsonSchema;
- }
- public function getUriRetriever()
- {
- if (is_null($this->uriRetriever)) {
- $this->setUriRetriever(new UriRetriever);
- }
- return $this->uriRetriever;
- }
- public function resolve($schema, $sourceUri = null)
- {
- if (self::$depth > self::$maxDepth) {
- self::$depth = 0;
- throw new JsonDecodingException(JSON_ERROR_DEPTH);
- }
- ++self::$depth;
- if (! is_object($schema)) {
- --self::$depth;
- return;
- }
- if (null === $sourceUri && ! empty($schema->id)) {
- $sourceUri = $schema->id;
- }
- if (null === $this->rootSchema) {
- $this->rootSchema = $schema;
- }
- $this->resolveRef($schema, $sourceUri);
-
- foreach (array('additionalItems', 'additionalProperties', 'extends', 'items') as $propertyName) {
- $this->resolveProperty($schema, $propertyName, $sourceUri);
- }
-
-
- foreach (array('disallow', 'extends', 'items', 'type', 'allOf', 'anyOf', 'oneOf') as $propertyName) {
- $this->resolveArrayOfSchemas($schema, $propertyName, $sourceUri);
- }
- foreach (array('dependencies', 'patternProperties', 'properties') as $propertyName) {
- $this->resolveObjectOfSchemas($schema, $propertyName, $sourceUri);
- }
- --self::$depth;
- }
- public function resolveArrayOfSchemas($schema, $propertyName, $sourceUri)
- {
- if (! isset($schema->$propertyName) || ! is_array($schema->$propertyName)) {
- return;
- }
- foreach ($schema->$propertyName as $possiblySchema) {
- $this->resolve($possiblySchema, $sourceUri);
- }
- }
- public function resolveObjectOfSchemas($schema, $propertyName, $sourceUri)
- {
- if (! isset($schema->$propertyName) || ! is_object($schema->$propertyName)) {
- return;
- }
- foreach (get_object_vars($schema->$propertyName) as $possiblySchema) {
- $this->resolve($possiblySchema, $sourceUri);
- }
- }
- public function resolveProperty($schema, $propertyName, $sourceUri)
- {
- if (! isset($schema->$propertyName)) {
- return;
- }
- $this->resolve($schema->$propertyName, $sourceUri);
- }
- public function resolveRef($schema, $sourceUri)
- {
- $ref = '$ref';
- if (empty($schema->$ref)) {
- return;
- }
- $splitRef = explode('#', $schema->$ref, 2);
- $refDoc = $splitRef[0];
- $refPath = null;
- if (count($splitRef) === 2) {
- $refPath = explode('/', $splitRef[1]);
- array_shift($refPath);
- }
- if (empty($refDoc) && empty($refPath)) {
- return;
- }
- if (!empty($refDoc)) {
- $refSchema = $this->fetchRef($refDoc, $sourceUri);
- } else {
- $refSchema = $this->rootSchema;
- }
- if (null !== $refPath) {
- $refSchema = $this->resolveRefSegment($refSchema, $refPath);
- }
- unset($schema->$ref);
- foreach (get_object_vars($refSchema) as $prop => $value) {
- $schema->$prop = $value;
- }
- }
- public function setUriRetriever(UriRetriever $retriever)
- {
- $this->uriRetriever = $retriever;
- return $this;
- }
- protected function resolveRefSegment($data, $pathParts)
- {
- foreach ($pathParts as $path) {
- $path = strtr($path, array('~1' => '/', '~0' => '~', '%25' => '%'));
- if (is_array($data)) {
- $data = $data[$path];
- } else {
- $data = $data->{$path};
- }
- }
- return $data;
- }
- }
- <?php
- namespace JsonSchema\Uri\Retrievers;
- abstract class AbstractRetriever implements UriRetrieverInterface
- {
- protected $contentType;
- public function getContentType()
- {
- return $this->contentType;
- }
- }
- <?php
- namespace JsonSchema\Uri\Retrievers;
- use JsonSchema\Validator;
- class Curl extends AbstractRetriever
- {
- protected $messageBody;
- public function __construct()
- {
- if (!function_exists('curl_init')) {
- throw new \RuntimeException("cURL not installed");
- }
- }
- public function retrieve($uri)
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $uri);
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: ' . Validator::SCHEMA_MEDIA_TYPE));
- $response = curl_exec($ch);
- if (false === $response) {
- throw new \JsonSchema\Exception\ResourceNotFoundException('JSON schema not found');
- }
- $this->fetchMessageBody($response);
- $this->fetchContentType($response);
- curl_close($ch);
- return $this->messageBody;
- }
- private function fetchMessageBody($response)
- {
- preg_match("/(?:\r\n){2}(.*)$/ms", $response, $match);
- $this->messageBody = $match[1];
- }
- protected function fetchContentType($response)
- {
- if (0 < preg_match("/Content-Type:(\V*)/ims", $response, $match)) {
- $this->contentType = trim($match[1]);
- return true;
- }
- return false;
- }
- }<?php
- namespace JsonSchema\Uri\Retrievers;
- use JsonSchema\Exception\ResourceNotFoundException;
- use JsonSchema\Validator;
- class FileGetContents extends AbstractRetriever
- {
- protected $messageBody;
- public function retrieve($uri)
- {
- $context = stream_context_create(array(
- 'http' => array(
- 'method' => 'GET',
- 'header' => "Accept: " . Validator::SCHEMA_MEDIA_TYPE
- )));
- set_error_handler(function() use ($uri) {
- throw new ResourceNotFoundException('JSON schema not found at ' . $uri);
- });
- $response = file_get_contents($uri);
- restore_error_handler();
- if (false === $response) {
- throw new ResourceNotFoundException('JSON schema not found at ' . $uri);
- }
- if ($response == ''
- && substr($uri, 0, 7) == 'file://' && substr($uri, -1) == '/'
- ) {
- throw new ResourceNotFoundException('JSON schema not found at ' . $uri);
- }
- $this->messageBody = $response;
- if (! empty($http_response_header)) {
- $this->fetchContentType($http_response_header);
- } else {
- $this->contentType = null;
- }
- return $this->messageBody;
- }
- private function fetchContentType(array $headers)
- {
- foreach ($headers as $header) {
- if ($this->contentType = self::getContentTypeMatchInHeader($header)) {
- return true;
- }
- }
- return false;
- }
- protected static function getContentTypeMatchInHeader($header)
- {
- if (0 < preg_match("/Content-Type:(\V*)/ims", $header, $match)) {
- return trim($match[1]);
- }
- }
- }
- <?php
- namespace JsonSchema\Uri\Retrievers;
- use JsonSchema\Validator;
- class PredefinedArray extends AbstractRetriever
- {
- private $schemas;
- public function __construct(array $schemas, $contentType = Validator::SCHEMA_MEDIA_TYPE)
- {
- $this->schemas = $schemas;
- $this->contentType = $contentType;
- }
- public function retrieve($uri)
- {
- if (!array_key_exists($uri, $this->schemas)) {
- throw new \JsonSchema\Exception\ResourceNotFoundException(sprintf(
- 'The JSON schema "%s" was not found.',
- $uri
- ));
- }
- return $this->schemas[$uri];
- }
- }
- <?php
- namespace JsonSchema\Uri\Retrievers;
- interface UriRetrieverInterface
- {
- public function retrieve($uri);
- public function getContentType();
- }<?php
- namespace JsonSchema\Uri;
- use JsonSchema\Exception\UriResolverException;
- class UriResolver
- {
- public function parse($uri)
- {
- preg_match('|^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?|', $uri, $match);
- $components = array();
- if (5 < count($match)) {
- $components = array(
- 'scheme' => $match[2],
- 'authority' => $match[4],
- 'path' => $match[5]
- );
- }
- if (7 < count($match)) {
- $components['query'] = $match[7];
- }
- if (9 < count($match)) {
- $components['fragment'] = $match[9];
- }
- return $components;
- }
- public function generate(array $components)
- {
- $uri = $components['scheme'] . '://'
- . $components['authority']
- . $components['path'];
- if (array_key_exists('query', $components)) {
- $uri .= $components['query'];
- }
- if (array_key_exists('fragment', $components)) {
- $uri .= '#' . $components['fragment'];
- }
- return $uri;
- }
- public function resolve($uri, $baseUri = null)
- {
- if ($uri == '') {
- return $baseUri;
- }
- $components = $this->parse($uri);
- $path = $components['path'];
- if (! empty($components['scheme'])) {
- return $uri;
- }
- $baseComponents = $this->parse($baseUri);
- $basePath = $baseComponents['path'];
- $baseComponents['path'] = self::combineRelativePathWithBasePath($path, $basePath);
- if (isset($components['fragment'])) {
- $baseComponents['fragment'] = $components['fragment'];
- }
- return $this->generate($baseComponents);
- }
- public static function combineRelativePathWithBasePath($relativePath, $basePath)
- {
- $relativePath = self::normalizePath($relativePath);
- if ($relativePath == '') {
- return $basePath;
- }
- if ($relativePath{0} == '/') {
- return $relativePath;
- }
- $basePathSegments = explode('/', $basePath);
- preg_match('|^/?(\.\./(?:\./)*)*|', $relativePath, $match);
- $numLevelUp = strlen($match[0]) /3 + 1;
- if ($numLevelUp >= count($basePathSegments)) {
- throw new UriResolverException(sprintf("Unable to resolve URI '%s' from base '%s'", $relativePath, $basePath));
- }
- $basePathSegments = array_slice($basePathSegments, 0, -$numLevelUp);
- $path = preg_replace('|^/?(\.\./(\./)*)*|', '', $relativePath);
- return implode('/', $basePathSegments) . '/' . $path;
- }
- private static function normalizePath($path)
- {
- $path = preg_replace('|((?<!\.)\./)*|', '', $path);
- $path = preg_replace('|//|', '/', $path);
- return $path;
- }
- public function isValid($uri)
- {
- $components = $this->parse($uri);
- return !empty($components);
- }
- }
- <?php
- namespace JsonSchema\Uri;
- use JsonSchema\Uri\Retrievers\FileGetContents;
- use JsonSchema\Uri\Retrievers\UriRetrieverInterface;
- use JsonSchema\Validator;
- use JsonSchema\Exception\InvalidSchemaMediaTypeException;
- use JsonSchema\Exception\JsonDecodingException;
- use JsonSchema\Exception\ResourceNotFoundException;
- class UriRetriever
- {
- protected $uriRetriever = null;
- private $schemaCache = array();
- public function confirmMediaType($uriRetriever, $uri)
- {
- $contentType = $uriRetriever->getContentType();
- if (is_null($contentType)) {
- return;
- }
- if (Validator::SCHEMA_MEDIA_TYPE === $contentType) {
- return;
- }
- if (substr($uri, 0, 23) == 'http://json-schema.org/') {
- return true;
- }
- throw new InvalidSchemaMediaTypeException(sprintf('Media type %s expected', Validator::SCHEMA_MEDIA_TYPE));
- }
- public function getUriRetriever()
- {
- if (is_null($this->uriRetriever)) {
- $this->setUriRetriever(new FileGetContents);
- }
- return $this->uriRetriever;
- }
- public function resolvePointer($jsonSchema, $uri)
- {
- $resolver = new UriResolver();
- $parsed = $resolver->parse($uri);
- if (empty($parsed['fragment'])) {
- return $jsonSchema;
- }
- $path = explode('/', $parsed['fragment']);
- while ($path) {
- $pathElement = array_shift($path);
- if (! empty($pathElement)) {
- $pathElement = str_replace('~1', '/', $pathElement);
- $pathElement = str_replace('~0', '~', $pathElement);
- if (! empty($jsonSchema->$pathElement)) {
- $jsonSchema = $jsonSchema->$pathElement;
- } else {
- throw new ResourceNotFoundException(
- 'Fragment "' . $parsed['fragment'] . '" not found'
- . ' in ' . $uri
- );
- }
- if (! is_object($jsonSchema)) {
- throw new ResourceNotFoundException(
- 'Fragment part "' . $pathElement . '" is no object '
- . ' in ' . $uri
- );
- }
- }
- }
- return $jsonSchema;
- }
- public function retrieve($uri, $baseUri = null)
- {
- $resolver = new UriResolver();
- $resolvedUri = $fetchUri = $resolver->resolve($uri, $baseUri);
- $arParts = $resolver->parse($resolvedUri);
- if (isset($arParts['fragment'])) {
- unset($arParts['fragment']);
- $fetchUri = $resolver->generate($arParts);
- }
- $jsonSchema = $this->loadSchema($fetchUri);
- $jsonSchema = $this->resolvePointer($jsonSchema, $resolvedUri);
- if ($jsonSchema instanceof \stdClass) {
- $jsonSchema->id = $resolvedUri;
- }
- return $jsonSchema;
- }
- protected function loadSchema($fetchUri)
- {
- if (isset($this->schemaCache[$fetchUri])) {
- return $this->schemaCache[$fetchUri];
- }
- $uriRetriever = $this->getUriRetriever();
- $contents = $this->uriRetriever->retrieve($fetchUri);
- $this->confirmMediaType($uriRetriever, $fetchUri);
- $jsonSchema = json_decode($contents);
- if (JSON_ERROR_NONE < $error = json_last_error()) {
- throw new JsonDecodingException($error);
- }
- $this->schemaCache[$fetchUri] = $jsonSchema;
- return $jsonSchema;
- }
- public function setUriRetriever(UriRetrieverInterface $uriRetriever)
- {
- $this->uriRetriever = $uriRetriever;
- return $this;
- }
- public function parse($uri)
- {
- preg_match('|^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?|', $uri, $match);
- $components = array();
- if (5 < count($match)) {
- $components = array(
- 'scheme' => $match[2],
- 'authority' => $match[4],
- 'path' => $match[5]
- );
- }
- if (7 < count($match)) {
- $components['query'] = $match[7];
- }
- if (9 < count($match)) {
- $components['fragment'] = $match[9];
- }
- return $components;
- }
- public function generate(array $components)
- {
- $uri = $components['scheme'] . '://'
- . $components['authority']
- . $components['path'];
- if (array_key_exists('query', $components)) {
- $uri .= $components['query'];
- }
- if (array_key_exists('fragment', $components)) {
- $uri .= $components['fragment'];
- }
- return $uri;
- }
- public function resolve($uri, $baseUri = null)
- {
- $components = $this->parse($uri);
- $path = $components['path'];
- if ((array_key_exists('scheme', $components)) && ('http' === $components['scheme'])) {
- return $uri;
- }
- $baseComponents = $this->parse($baseUri);
- $basePath = $baseComponents['path'];
- $baseComponents['path'] = UriResolver::combineRelativePathWithBasePath($path, $basePath);
- return $this->generate($baseComponents);
- }
- public function isValid($uri)
- {
- $components = $this->parse($uri);
- return !empty($components);
- }
- }
- <?php
- namespace JsonSchema;
- use JsonSchema\Constraints\SchemaConstraint;
- use JsonSchema\Constraints\Constraint;
- class Validator extends Constraint
- {
- const SCHEMA_MEDIA_TYPE = 'application/schema+json';
- public function check($value, $schema = null, $path = null, $i = null)
- {
- $validator = $this->getFactory()->createInstanceFor('schema');
- $validator->check($value, $schema);
- $this->addErrors(array_unique($validator->getErrors(), SORT_REGULAR));
- }
- }
- Copyright (C) 2015 Composer
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished to do
- so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
- <?php
- namespace Composer\Spdx;
- class SpdxLicenses
- {
- const LICENSES_FILE = 'spdx-licenses.json';
- const EXCEPTIONS_FILE = 'spdx-exceptions.json';
- private $licenses;
- private $licensesExpression;
- private $exceptions;
- private $exceptionsExpression;
- public function __construct()
- {
- $this->loadLicenses();
- $this->loadExceptions();
- }
- public function getLicenseByIdentifier($identifier)
- {
- if (!isset($this->licenses[$identifier])) {
- return;
- }
- $license = $this->licenses[$identifier];
- $license[] = 'https://spdx.org/licenses/' . $identifier . '.html#licenseText';
- return $license;
- }
- public function getExceptionByIdentifier($identifier)
- {
- if (!isset($this->exceptions[$identifier])) {
- return;
- }
- $license = $this->exceptions[$identifier];
- $license[] = 'https://spdx.org/licenses/' . $identifier . '.html#licenseExceptionText';
- return $license;
- }
- public function getIdentifierByName($name)
- {
- foreach ($this->licenses as $identifier => $licenseData) {
- if ($licenseData[0] === $name) {
- return $identifier;
- }
- }
- foreach ($this->exceptions as $identifier => $licenseData) {
- if ($licenseData[0] === $name) {
- return $identifier;
- }
- }
- }
- public function isOsiApprovedByIdentifier($identifier)
- {
- return $this->licenses[$identifier][1];
- }
- public function validate($license)
- {
- if (is_array($license)) {
- $count = count($license);
- if ($count !== count(array_filter($license, 'is_string'))) {
- throw new \InvalidArgumentException('Array of strings expected.');
- }
- $license = $count > 1 ? '(' . implode(' OR ', $license) . ')' : (string) reset($license);
- }
- if (!is_string($license)) {
- throw new \InvalidArgumentException(sprintf(
- 'Array or String expected, %s given.',
- gettype($license)
- ));
- }
- return $this->isValidLicenseString($license);
- }
- public static function getResourcesDir()
- {
- return dirname(__DIR__) . '/res';
- }
- private function loadLicenses()
- {
- if (null === $this->licenses) {
- $json = file_get_contents(self::getResourcesDir() . '/' . self::LICENSES_FILE);
- $this->licenses = json_decode($json, true);
- }
- }
- private function loadExceptions()
- {
- if (null === $this->exceptions) {
- $json = file_get_contents(self::getResourcesDir() . '/' . self::EXCEPTIONS_FILE);
- $this->exceptions = json_decode($json, true);
- }
- }
- private function getLicensesExpression()
- {
- if (null === $this->licensesExpression) {
- $licenses = array_map('preg_quote', array_keys($this->licenses));
- rsort($licenses);
- $licenses = implode('|', $licenses);
- $this->licensesExpression = $licenses;
- }
- return $this->licensesExpression;
- }
- private function getExceptionsExpression()
- {
- if (null === $this->exceptionsExpression) {
- $exceptions = array_map('preg_quote', array_keys($this->exceptions));
- rsort($exceptions);
- $exceptions = implode('|', $exceptions);
- $this->exceptionsExpression = $exceptions;
- }
- return $this->exceptionsExpression;
- }
- private function isValidLicenseString($license)
- {
- if (isset($this->licenses[$license])) {
- return true;
- }
- $licenses = $this->getLicensesExpression();
- $exceptions = $this->getExceptionsExpression();
- $regex = <<<REGEX
- {
- (?(DEFINE)
- # idstring: 1*( ALPHA / DIGIT / - / . )
- (?<idstring>[\pL\pN.-]{1,})
- # license-id: taken from list
- (?<licenseid>${licenses})
- # license-exception-id: taken from list
- (?<licenseexceptionid>${exceptions})
- # license-ref: [DocumentRef-1*(idstring):]LicenseRef-1*(idstring)
- (?<licenseref>(?:DocumentRef-(?&idstring):)?LicenseRef-(?&idstring))
- # simple-expresssion: license-id / license-id+ / license-ref
- (?<simple_expression>(?&licenseid)\+? | (?&licenseid) | (?&licenseref))
- # compound-expression: 1*(
- # simple-expression /
- # simple-expression WITH license-exception-id /
- # compound-expression AND compound-expression /
- # compound-expression OR compound-expression
- # ) / ( compound-expression ) )
- (?<compound_head>
- (?&simple_expression) ( \s+ (?:with|WITH) \s+ (?&licenseexceptionid))?
- | \( \s* (?&compound_expression) \s* \)
- )
- (?<compound_expression>
- (?&compound_head) (?: \s+ (?:and|AND|or|OR) \s+ (?&compound_expression))?
- )
- # license-expression: 1*1(simple-expression / compound-expression)
- (?<license_expression>(?&compound_expression) | (?&simple_expression))
- ) # end of define
- ^(NONE | NOASSERTION | (?&license_expression))$
- }x
- REGEX;
- $match = preg_match($regex, $license);
- if (0 === $match) {
- return false;
- }
- if (false === $match) {
- throw new \RuntimeException('Regex failed to compile/run.');
- }
- return true;
- }
- }
- Copyright (C) 2015 Composer
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished to do
- so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
- <?php
- namespace Composer\Semver;
- use Composer\Semver\Constraint\Constraint;
- class Comparator
- {
- public static function greaterThan($version1, $version2)
- {
- return self::compare($version1, '>', $version2);
- }
- public static function greaterThanOrEqualTo($version1, $version2)
- {
- return self::compare($version1, '>=', $version2);
- }
- public static function lessThan($version1, $version2)
- {
- return self::compare($version1, '<', $version2);
- }
- public static function lessThanOrEqualTo($version1, $version2)
- {
- return self::compare($version1, '<=', $version2);
- }
- public static function equalTo($version1, $version2)
- {
- return self::compare($version1, '==', $version2);
- }
- public static function notEqualTo($version1, $version2)
- {
- return self::compare($version1, '!=', $version2);
- }
- public static function compare($version1, $operator, $version2)
- {
- $constraint = new Constraint($operator, $version2);
- return $constraint->matches(new Constraint('==', $version1));
- }
- }
- <?php
- namespace Composer\Semver\Constraint;
- trigger_error('The ' . __CLASS__ . ' abstract class is deprecated, there is no replacement for it, it will be removed in the next major version.', E_USER_DEPRECATED);
- abstract class AbstractConstraint implements ConstraintInterface
- {
- protected $prettyString;
- public function matches(ConstraintInterface $provider)
- {
- if ($provider instanceof $this) {
- return $this->matchSpecific($provider);
- }
- return $provider->matches($this);
- }
- public function setPrettyString($prettyString)
- {
- $this->prettyString = $prettyString;
- }
- public function getPrettyString()
- {
- if ($this->prettyString) {
- return $this->prettyString;
- }
- return $this->__toString();
- }
-
-
- }
- <?php
- namespace Composer\Semver\Constraint;
- class Constraint implements ConstraintInterface
- {
- const OP_EQ = 0;
- const OP_LT = 1;
- const OP_LE = 2;
- const OP_GT = 3;
- const OP_GE = 4;
- const OP_NE = 5;
- private static $transOpStr = array(
- '=' => self::OP_EQ,
- '==' => self::OP_EQ,
- '<' => self::OP_LT,
- '<=' => self::OP_LE,
- '>' => self::OP_GT,
- '>=' => self::OP_GE,
- '<>' => self::OP_NE,
- '!=' => self::OP_NE,
- );
- private static $transOpInt = array(
- self::OP_EQ => '==',
- self::OP_LT => '<',
- self::OP_LE => '<=',
- self::OP_GT => '>',
- self::OP_GE => '>=',
- self::OP_NE => '!=',
- );
- protected $operator;
- protected $version;
- protected $prettyString;
- public function matches(ConstraintInterface $provider)
- {
- if ($provider instanceof $this) {
- return $this->matchSpecific($provider);
- }
- return $provider->matches($this);
- }
- public function setPrettyString($prettyString)
- {
- $this->prettyString = $prettyString;
- }
- public function getPrettyString()
- {
- if ($this->prettyString) {
- return $this->prettyString;
- }
- return $this->__toString();
- }
- public static function getSupportedOperators()
- {
- return array_keys(self::$transOpStr);
- }
- public function __construct($operator, $version)
- {
- if (!isset(self::$transOpStr[$operator])) {
- throw new \InvalidArgumentException(sprintf(
- 'Invalid operator "%s" given, expected one of: %s',
- $operator,
- implode(', ', self::getSupportedOperators())
- ));
- }
- $this->operator = self::$transOpStr[$operator];
- $this->version = $version;
- }
- public function versionCompare($a, $b, $operator, $compareBranches = false)
- {
- if (!isset(self::$transOpStr[$operator])) {
- throw new \InvalidArgumentException(sprintf(
- 'Invalid operator "%s" given, expected one of: %s',
- $operator,
- implode(', ', self::getSupportedOperators())
- ));
- }
- $aIsBranch = 'dev-' === substr($a, 0, 4);
- $bIsBranch = 'dev-' === substr($b, 0, 4);
- if ($aIsBranch && $bIsBranch) {
- return $operator === '==' && $a === $b;
- }
- if (!$compareBranches && ($aIsBranch || $bIsBranch)) {
- return false;
- }
- return version_compare($a, $b, $operator);
- }
- public function matchSpecific(Constraint $provider, $compareBranches = false)
- {
- $noEqualOp = str_replace('=', '', self::$transOpInt[$this->operator]);
- $providerNoEqualOp = str_replace('=', '', self::$transOpInt[$provider->operator]);
- $isEqualOp = self::OP_EQ === $this->operator;
- $isNonEqualOp = self::OP_NE === $this->operator;
- $isProviderEqualOp = self::OP_EQ === $provider->operator;
- $isProviderNonEqualOp = self::OP_NE === $provider->operator;
-
- if ($isNonEqualOp || $isProviderNonEqualOp) {
- return !$isEqualOp && !$isProviderEqualOp
- || $this->versionCompare($provider->version, $this->version, '!=', $compareBranches);
- }
-
- if ($this->operator !== self::OP_EQ && $noEqualOp === $providerNoEqualOp) {
- return true;
- }
- if ($this->versionCompare($provider->version, $this->version, self::$transOpInt[$this->operator], $compareBranches)) {
-
- if ($provider->version === $this->version
- && self::$transOpInt[$provider->operator] === $providerNoEqualOp
- && self::$transOpInt[$this->operator] !== $noEqualOp) {
- return false;
- }
- return true;
- }
- return false;
- }
- public function __toString()
- {
- return self::$transOpInt[$this->operator] . ' ' . $this->version;
- }
- }
- <?php
- namespace Composer\Semver\Constraint;
- interface ConstraintInterface
- {
- public function matches(ConstraintInterface $provider);
- public function getPrettyString();
- public function __toString();
- }
- <?php
- namespace Composer\Semver\Constraint;
- class EmptyConstraint implements ConstraintInterface
- {
- protected $prettyString;
- public function matches(ConstraintInterface $provider)
- {
- return true;
- }
- public function setPrettyString($prettyString)
- {
- $this->prettyString = $prettyString;
- }
- public function getPrettyString()
- {
- if ($this->prettyString) {
- return $this->prettyString;
- }
- return $this->__toString();
- }
- public function __toString()
- {
- return '[]';
- }
- }
- <?php
- namespace Composer\Semver\Constraint;
- class MultiConstraint implements ConstraintInterface
- {
- protected $constraints;
- protected $prettyString;
- protected $conjunctive;
- public function __construct(array $constraints, $conjunctive = true)
- {
- $this->constraints = $constraints;
- $this->conjunctive = $conjunctive;
- }
- public function matches(ConstraintInterface $provider)
- {
- if (false === $this->conjunctive) {
- foreach ($this->constraints as $constraint) {
- if ($constraint->matches($provider)) {
- return true;
- }
- }
- return false;
- }
- foreach ($this->constraints as $constraint) {
- if (!$constraint->matches($provider)) {
- return false;
- }
- }
- return true;
- }
- public function setPrettyString($prettyString)
- {
- $this->prettyString = $prettyString;
- }
- public function getPrettyString()
- {
- if ($this->prettyString) {
- return $this->prettyString;
- }
- return $this->__toString();
- }
- public function __toString()
- {
- $constraints = array();
- foreach ($this->constraints as $constraint) {
- $constraints[] = (string) $constraint;
- }
- return '[' . implode($this->conjunctive ? ' ' : ' || ', $constraints) . ']';
- }
- }
- <?php
- namespace Composer\Semver;
- use Composer\Semver\Constraint\Constraint;
- class Semver
- {
- const SORT_ASC = 1;
- const SORT_DESC = -1;
- private static $versionParser;
- public static function satisfies($version, $constraints)
- {
- if (null === self::$versionParser) {
- self::$versionParser = new VersionParser();
- }
- $versionParser = self::$versionParser;
- $provider = new Constraint('==', $versionParser->normalize($version));
- $constraints = $versionParser->parseConstraints($constraints);
- return $constraints->matches($provider);
- }
- public static function satisfiedBy(array $versions, $constraints)
- {
- $versions = array_filter($versions, function ($version) use ($constraints) {
- return Semver::satisfies($version, $constraints);
- });
- return array_values($versions);
- }
- public static function sort(array $versions)
- {
- return self::usort($versions, self::SORT_ASC);
- }
- public static function rsort(array $versions)
- {
- return self::usort($versions, self::SORT_DESC);
- }
- private static function usort(array $versions, $direction)
- {
- if (null === self::$versionParser) {
- self::$versionParser = new VersionParser();
- }
- $versionParser = self::$versionParser;
- $normalized = array();
-
- foreach ($versions as $key => $version) {
- $normalized[] = array($versionParser->normalize($version), $key);
- }
- usort($normalized, function (array $left, array $right) use ($direction) {
- if ($left[0] === $right[0]) {
- return 0;
- }
- if (Comparator::lessThan($left[0], $right[0])) {
- return -$direction;
- }
- return $direction;
- });
- $sorted = array();
- foreach ($normalized as $item) {
- $sorted[] = $versions[$item[1]];
- }
- return $sorted;
- }
- }
- <?php
- namespace Composer\Semver;
- use Composer\Semver\Constraint\ConstraintInterface;
- use Composer\Semver\Constraint\EmptyConstraint;
- use Composer\Semver\Constraint\MultiConstraint;
- use Composer\Semver\Constraint\Constraint;
- class VersionParser
- {
- private static $modifierRegex = '[._-]?(?:(stable|beta|b|RC|alpha|a|patch|pl|p)((?:[.-]?\d+)*+)?)?([.-]?dev)?';
- private static $stabilities = array('stable', 'RC', 'beta', 'alpha', 'dev');
- public static function parseStability($version)
- {
- $version = preg_replace('{#.+$}i', '', $version);
- if ('dev-' === substr($version, 0, 4) || '-dev' === substr($version, -4)) {
- return 'dev';
- }
- preg_match('{' . self::$modifierRegex . '$}i', strtolower($version), $match);
- if (!empty($match[3])) {
- return 'dev';
- }
- if (!empty($match[1])) {
- if ('beta' === $match[1] || 'b' === $match[1]) {
- return 'beta';
- }
- if ('alpha' === $match[1] || 'a' === $match[1]) {
- return 'alpha';
- }
- if ('rc' === $match[1]) {
- return 'RC';
- }
- }
- return 'stable';
- }
- public static function normalizeStability($stability)
- {
- $stability = strtolower($stability);
- return $stability === 'rc' ? 'RC' : $stability;
- }
- public function normalize($version, $fullVersion = null)
- {
- $version = trim($version);
- if (null === $fullVersion) {
- $fullVersion = $version;
- }
- if (preg_match('{^([^,\s]++) ++as ++([^,\s]++)$}', $version, $match)) {
- $version = $match[1];
- }
- if (preg_match('{^([^,\s+]++)\+[^\s]++$}', $version, $match)) {
- $version = $match[1];
- }
- if (preg_match('{^(?:dev-)?(?:master|trunk|default)$}i', $version)) {
- return '9999999-dev';
- }
- if ('dev-' === strtolower(substr($version, 0, 4))) {
- return 'dev-' . substr($version, 4);
- }
- if (preg_match('{^v?(\d{1,5})(\.\d++)?(\.\d++)?(\.\d++)?' . self::$modifierRegex . '$}i', $version, $matches)) {
- $version = $matches[1]
- . (!empty($matches[2]) ? $matches[2] : '.0')
- . (!empty($matches[3]) ? $matches[3] : '.0')
- . (!empty($matches[4]) ? $matches[4] : '.0');
- $index = 5;
- } elseif (preg_match('{^v?(\d{4}(?:[.:-]?\d{2}){1,6}(?:[.:-]?\d{1,3})?)' . self::$modifierRegex . '$}i', $version, $matches)) {
- $version = preg_replace('{\D}', '.', $matches[1]);
- $index = 2;
- }
- if (isset($index)) {
- if (!empty($matches[$index])) {
- if ('stable' === $matches[$index]) {
- return $version;
- }
- $version .= '-' . $this->expandStability($matches[$index]) . (!empty($matches[$index + 1]) ? ltrim($matches[$index + 1], '.-') : '');
- }
- if (!empty($matches[$index + 2])) {
- $version .= '-dev';
- }
- return $version;
- }
- if (preg_match('{(.*?)[.-]?dev$}i', $version, $match)) {
- try {
- return $this->normalizeBranch($match[1]);
- } catch (\Exception $e) {
- }
- }
- $extraMessage = '';
- if (preg_match('{ +as +' . preg_quote($version) . '$}', $fullVersion)) {
- $extraMessage = ' in "' . $fullVersion . '", the alias must be an exact version';
- } elseif (preg_match('{^' . preg_quote($version) . ' +as +}', $fullVersion)) {
- $extraMessage = ' in "' . $fullVersion . '", the alias source must be an exact version, if it is a branch name you should prefix it with dev-';
- }
- throw new \UnexpectedValueException('Invalid version string "' . $version . '"' . $extraMessage);
- }
- public function parseNumericAliasPrefix($branch)
- {
- if (preg_match('{^(?P<version>(\d++\\.)*\d++)(?:\.x)?-dev$}i', $branch, $matches)) {
- return $matches['version'] . '.';
- }
- return false;
- }
- public function normalizeBranch($name)
- {
- $name = trim($name);
- if (in_array($name, array('master', 'trunk', 'default'))) {
- return $this->normalize($name);
- }
- if (preg_match('{^v?(\d++)(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?$}i', $name, $matches)) {
- $version = '';
- for ($i = 1; $i < 5; ++$i) {
- $version .= isset($matches[$i]) ? str_replace(array('*', 'X'), 'x', $matches[$i]) : '.x';
- }
- return str_replace('x', '9999999', $version) . '-dev';
- }
- return 'dev-' . $name;
- }
- public function parseConstraints($constraints)
- {
- $prettyConstraint = $constraints;
- if (preg_match('{^([^,\s]*?)@(' . implode('|', self::$stabilities) . ')$}i', $constraints, $match)) {
- $constraints = empty($match[1]) ? '*' : $match[1];
- }
- if (preg_match('{^(dev-[^,\s@]+?|[^,\s@]+?\.x-dev)#.+$}i', $constraints, $match)) {
- $constraints = $match[1];
- }
- $orConstraints = preg_split('{\s*\|\|?\s*}', trim($constraints));
- $orGroups = array();
- foreach ($orConstraints as $constraints) {
- $andConstraints = preg_split('{(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)}', $constraints);
- if (count($andConstraints) > 1) {
- $constraintObjects = array();
- foreach ($andConstraints as $constraint) {
- foreach ($this->parseConstraint($constraint) as $parsedConstraint) {
- $constraintObjects[] = $parsedConstraint;
- }
- }
- } else {
- $constraintObjects = $this->parseConstraint($andConstraints[0]);
- }
- if (1 === count($constraintObjects)) {
- $constraint = $constraintObjects[0];
- } else {
- $constraint = new MultiConstraint($constraintObjects);
- }
- $orGroups[] = $constraint;
- }
- if (1 === count($orGroups)) {
- $constraint = $orGroups[0];
- } else {
- $constraint = new MultiConstraint($orGroups, false);
- }
- $constraint->setPrettyString($prettyConstraint);
- return $constraint;
- }
- private function parseConstraint($constraint)
- {
- if (preg_match('{^([^,\s]+?)@(' . implode('|', self::$stabilities) . ')$}i', $constraint, $match)) {
- $constraint = $match[1];
- if ($match[2] !== 'stable') {
- $stabilityModifier = $match[2];
- }
- }
- if (preg_match('{^v?[xX*](\.[xX*])*$}i', $constraint)) {
- return array(new EmptyConstraint());
- }
- $versionRegex = 'v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.(\d++))?' . self::$modifierRegex . '(?:\+[^\s]+)?';
-
-
-
-
- if (preg_match('{^~>?' . $versionRegex . '$}i', $constraint, $matches)) {
- if (substr($constraint, 0, 2) === '~>') {
- throw new \UnexpectedValueException(
- 'Could not parse version constraint ' . $constraint . ': ' .
- 'Invalid operator "~>", you probably meant to use the "~" operator'
- );
- }
- if (isset($matches[4]) && '' !== $matches[4]) {
- $position = 4;
- } elseif (isset($matches[3]) && '' !== $matches[3]) {
- $position = 3;
- } elseif (isset($matches[2]) && '' !== $matches[2]) {
- $position = 2;
- } else {
- $position = 1;
- }
- $stabilitySuffix = '';
- if (!empty($matches[5])) {
- $stabilitySuffix .= '-' . $this->expandStability($matches[5]) . (!empty($matches[6]) ? $matches[6] : '');
- }
- if (!empty($matches[7])) {
- $stabilitySuffix .= '-dev';
- }
- if (!$stabilitySuffix) {
- $stabilitySuffix = '-dev';
- }
- $lowVersion = $this->manipulateVersionString($matches, $position, 0) . $stabilitySuffix;
- $lowerBound = new Constraint('>=', $lowVersion);
-
- $highPosition = max(1, $position - 1);
- $highVersion = $this->manipulateVersionString($matches, $highPosition, 1) . '-dev';
- $upperBound = new Constraint('<', $highVersion);
- return array(
- $lowerBound,
- $upperBound,
- );
- }
-
-
-
-
- if (preg_match('{^\^' . $versionRegex . '($)}i', $constraint, $matches)) {
- if ('0' !== $matches[1] || '' === $matches[2]) {
- $position = 1;
- } elseif ('0' !== $matches[2] || '' === $matches[3]) {
- $position = 2;
- } else {
- $position = 3;
- }
- $stabilitySuffix = '';
- if (empty($matches[5]) && empty($matches[7])) {
- $stabilitySuffix .= '-dev';
- }
- $lowVersion = $this->normalize(substr($constraint . $stabilitySuffix, 1));
- $lowerBound = new Constraint('>=', $lowVersion);
-
- $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev';
- $upperBound = new Constraint('<', $highVersion);
- return array(
- $lowerBound,
- $upperBound,
- );
- }
-
-
-
- if (preg_match('{^v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.[xX*])++$}', $constraint, $matches)) {
- if (isset($matches[3]) && '' !== $matches[3]) {
- $position = 3;
- } elseif (isset($matches[2]) && '' !== $matches[2]) {
- $position = 2;
- } else {
- $position = 1;
- }
- $lowVersion = $this->manipulateVersionString($matches, $position) . '-dev';
- $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev';
- if ($lowVersion === '0.0.0.0-dev') {
- return array(new Constraint('<', $highVersion));
- }
- return array(
- new Constraint('>=', $lowVersion),
- new Constraint('<', $highVersion),
- );
- }
-
-
-
-
-
- if (preg_match('{^(?P<from>' . $versionRegex . ') +- +(?P<to>' . $versionRegex . ')($)}i', $constraint, $matches)) {
- $lowStabilitySuffix = '';
- if (empty($matches[6]) && empty($matches[8])) {
- $lowStabilitySuffix = '-dev';
- }
- $lowVersion = $this->normalize($matches['from']);
- $lowerBound = new Constraint('>=', $lowVersion . $lowStabilitySuffix);
- $empty = function ($x) {
- return ($x === 0 || $x === '0') ? false : empty($x);
- };
- if ((!$empty($matches[11]) && !$empty($matches[12])) || !empty($matches[14]) || !empty($matches[16])) {
- $highVersion = $this->normalize($matches['to']);
- $upperBound = new Constraint('<=', $highVersion);
- } else {
- $highMatch = array('', $matches[10], $matches[11], $matches[12], $matches[13]);
- $highVersion = $this->manipulateVersionString($highMatch, $empty($matches[11]) ? 1 : 2, 1) . '-dev';
- $upperBound = new Constraint('<', $highVersion);
- }
- return array(
- $lowerBound,
- $upperBound,
- );
- }
- if (preg_match('{^(<>|!=|>=?|<=?|==?)?\s*(.*)}', $constraint, $matches)) {
- try {
- $version = $this->normalize($matches[2]);
- if (!empty($stabilityModifier) && $this->parseStability($version) === 'stable') {
- $version .= '-' . $stabilityModifier;
- } elseif ('<' === $matches[1] || '>=' === $matches[1]) {
- if (!preg_match('/-' . self::$modifierRegex . '$/', strtolower($matches[2]))) {
- if (substr($matches[2], 0, 4) !== 'dev-') {
- $version .= '-dev';
- }
- }
- }
- return array(new Constraint($matches[1] ?: '=', $version));
- } catch (\Exception $e) {
- }
- }
- $message = 'Could not parse version constraint ' . $constraint;
- if (isset($e)) {
- $message .= ': ' . $e->getMessage();
- }
- throw new \UnexpectedValueException($message);
- }
- private function manipulateVersionString($matches, $position, $increment = 0, $pad = '0')
- {
- for ($i = 4; $i > 0; --$i) {
- if ($i > $position) {
- $matches[$i] = $pad;
- } elseif ($i === $position && $increment) {
- $matches[$i] += $increment;
- if ($matches[$i] < 0) {
- $matches[$i] = $pad;
- --$position;
- if ($i === 1) {
- return;
- }
- }
- }
- }
- return $matches[1] . '.' . $matches[2] . '.' . $matches[3] . '.' . $matches[4];
- }
- private function expandStability($stability)
- {
- $stability = strtolower($stability);
- switch ($stability) {
- case 'a':
- return 'alpha';
- case 'b':
- return 'beta';
- case 'p':
- case 'pl':
- return 'patch';
- case 'rc':
- return 'RC';
- default:
- return $stability;
- }
- }
- }
- <?php
- require_once __DIR__ . '/composer' . '/autoload_real.php';
- return ComposerAutoloaderInitComposerPhar1456343641::getLoader();
- <?php
- $vendorDir = dirname(dirname(__FILE__));
- $baseDir = dirname($vendorDir);
- return array(
- );
- <?php
- $vendorDir = dirname(dirname(__FILE__));
- $baseDir = dirname($vendorDir);
- return array(
- 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
- 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
- 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
- 'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'),
- 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
- 'Seld\\PharUtils\\' => array($vendorDir . '/seld/phar-utils/src'),
- 'Seld\\JsonLint\\' => array($vendorDir . '/seld/jsonlint/src/Seld/JsonLint'),
- 'Seld\\CliPrompt\\' => array($vendorDir . '/seld/cli-prompt/src'),
- 'JsonSchema\\' => array($vendorDir . '/justinrainbow/json-schema/src/JsonSchema'),
- 'Composer\\Spdx\\' => array($vendorDir . '/composer/spdx-licenses/src'),
- 'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'),
- 'Composer\\' => array($baseDir . '/src/Composer'),
- );
- <?php
- $vendorDir = dirname(dirname(__FILE__));
- $baseDir = dirname($vendorDir);
- return array(
- );
- <?php
- $vendorDir = dirname(dirname(__FILE__));
- $baseDir = dirname($vendorDir);
- return array(
- '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
- );
- <?php
- class ComposerAutoloaderInitComposerPhar1456343641
- {
- private static $loader;
- public static function loadClassLoader($class)
- {
- if ('Composer\Autoload\ClassLoader' === $class) {
- require __DIR__ . '/ClassLoader.php';
- }
- }
- public static function getLoader()
- {
- if (null !== self::$loader) {
- return self::$loader;
- }
- spl_autoload_register(array('ComposerAutoloaderInitComposerPhar1456343641', 'loadClassLoader'), true, true);
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInitComposerPhar1456343641', 'loadClassLoader'));
- $map = require __DIR__ . '/autoload_namespaces.php';
- foreach ($map as $namespace => $path) {
- $loader->set($namespace, $path);
- }
- $map = require __DIR__ . '/autoload_psr4.php';
- foreach ($map as $namespace => $path) {
- $loader->setPsr4($namespace, $path);
- }
- $classMap = require __DIR__ . '/autoload_classmap.php';
- if ($classMap) {
- $loader->addClassMap($classMap);
- }
- $loader->register(true);
- $includeFiles = require __DIR__ . '/autoload_files.php';
- foreach ($includeFiles as $fileIdentifier => $file) {
- composerRequireComposerPhar1456343641($fileIdentifier, $file);
- }
- return $loader;
- }
- }
- function composerRequireComposerPhar1456343641($fileIdentifier, $file)
- {
- if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
- require $file;
- $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
- }
- }
- <?php
- namespace Composer\Autoload;
- class ClassLoader
- {
- private $prefixLengthsPsr4 = array();
- private $prefixDirsPsr4 = array();
- private $fallbackDirsPsr4 = array();
- private $prefixesPsr0 = array();
- private $fallbackDirsPsr0 = array();
- private $useIncludePath = false;
- private $classMap = array();
- private $classMapAuthoritative = false;
- public function getPrefixes()
- {
- if (!empty($this->prefixesPsr0)) {
- return call_user_func_array('array_merge', $this->prefixesPsr0);
- }
- return array();
- }
- public function getPrefixesPsr4()
- {
- return $this->prefixDirsPsr4;
- }
- public function getFallbackDirs()
- {
- return $this->fallbackDirsPsr0;
- }
- public function getFallbackDirsPsr4()
- {
- return $this->fallbackDirsPsr4;
- }
- public function getClassMap()
- {
- return $this->classMap;
- }
- public function addClassMap(array $classMap)
- {
- if ($this->classMap) {
- $this->classMap = array_merge($this->classMap, $classMap);
- } else {
- $this->classMap = $classMap;
- }
- }
- public function add($prefix, $paths, $prepend = false)
- {
- if (!$prefix) {
- if ($prepend) {
- $this->fallbackDirsPsr0 = array_merge(
- (array) $paths,
- $this->fallbackDirsPsr0
- );
- } else {
- $this->fallbackDirsPsr0 = array_merge(
- $this->fallbackDirsPsr0,
- (array) $paths
- );
- }
- return;
- }
- $first = $prefix[0];
- if (!isset($this->prefixesPsr0[$first][$prefix])) {
- $this->prefixesPsr0[$first][$prefix] = (array) $paths;
- return;
- }
- if ($prepend) {
- $this->prefixesPsr0[$first][$prefix] = array_merge(
- (array) $paths,
- $this->prefixesPsr0[$first][$prefix]
- );
- } else {
- $this->prefixesPsr0[$first][$prefix] = array_merge(
- $this->prefixesPsr0[$first][$prefix],
- (array) $paths
- );
- }
- }
- public function addPsr4($prefix, $paths, $prepend = false)
- {
- if (!$prefix) {
- if ($prepend) {
- $this->fallbackDirsPsr4 = array_merge(
- (array) $paths,
- $this->fallbackDirsPsr4
- );
- } else {
- $this->fallbackDirsPsr4 = array_merge(
- $this->fallbackDirsPsr4,
- (array) $paths
- );
- }
- } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
- $length = strlen($prefix);
- if ('\\' !== $prefix[$length - 1]) {
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
- }
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
- } elseif ($prepend) {
- $this->prefixDirsPsr4[$prefix] = array_merge(
- (array) $paths,
- $this->prefixDirsPsr4[$prefix]
- );
- } else {
- $this->prefixDirsPsr4[$prefix] = array_merge(
- $this->prefixDirsPsr4[$prefix],
- (array) $paths
- );
- }
- }
- public function set($prefix, $paths)
- {
- if (!$prefix) {
- $this->fallbackDirsPsr0 = (array) $paths;
- } else {
- $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
- }
- }
- public function setPsr4($prefix, $paths)
- {
- if (!$prefix) {
- $this->fallbackDirsPsr4 = (array) $paths;
- } else {
- $length = strlen($prefix);
- if ('\\' !== $prefix[$length - 1]) {
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
- }
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
- }
- }
- public function setUseIncludePath($useIncludePath)
- {
- $this->useIncludePath = $useIncludePath;
- }
- public function getUseIncludePath()
- {
- return $this->useIncludePath;
- }
- public function setClassMapAuthoritative($classMapAuthoritative)
- {
- $this->classMapAuthoritative = $classMapAuthoritative;
- }
- public function isClassMapAuthoritative()
- {
- return $this->classMapAuthoritative;
- }
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
- public function loadClass($class)
- {
- if ($file = $this->findFile($class)) {
- includeFile($file);
- return true;
- }
- }
- public function findFile($class)
- {
- if ('\\' == $class[0]) {
- $class = substr($class, 1);
- }
- if (isset($this->classMap[$class])) {
- return $this->classMap[$class];
- }
- if ($this->classMapAuthoritative) {
- return false;
- }
- $file = $this->findFileWithExtension($class, '.php');
- if ($file === null && defined('HHVM_VERSION')) {
- $file = $this->findFileWithExtension($class, '.hh');
- }
- if ($file === null) {
- return $this->classMap[$class] = false;
- }
- return $file;
- }
- private function findFileWithExtension($class, $ext)
- {
- $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
- $first = $class[0];
- if (isset($this->prefixLengthsPsr4[$first])) {
- foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
- if (0 === strpos($class, $prefix)) {
- foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
- return $file;
- }
- }
- }
- }
- }
- foreach ($this->fallbackDirsPsr4 as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
- return $file;
- }
- }
- if (false !== $pos = strrpos($class, '\\')) {
- $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
- . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
- } else {
- $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
- }
- if (isset($this->prefixesPsr0[$first])) {
- foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
- if (0 === strpos($class, $prefix)) {
- foreach ($dirs as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
- return $file;
- }
- }
- }
- }
- }
- foreach ($this->fallbackDirsPsr0 as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
- return $file;
- }
- }
- if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
- return $file;
- }
- }
- }
- function includeFile($file)
- {
- include $file;
- }
- ##
- ## Bundle of CA Root Certificates
- ##
- ## Certificate data from Mozilla as of: Wed Oct 28 22:42:42 2015
- ##
- ## This is a bundle of X.509 certificates of public Certificate Authorities
- ## (CA). These were automatically extracted from Mozilla's root certificates
- ## file (certdata.txt). This file can be found at
- ## https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt
- ##
- ## It contains the certificates in PEM format and therefore
- ## can be directly used with curl / libcurl / php_curl, or with
- ## an Apache+mod_ssl webserver for SSL client authentication.
- ## Just configure this file as the SSLCACertificateFile.
- ##
- ## Conversion done with mk-ca-bundle.pl version 1.25.
- ## SHA1: 6d7d2f0a4fae587e7431be191a081ac1257d300a
- ##
- Equifax Secure CA
- =================
- -----BEGIN CERTIFICATE-----
- MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE
- ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5
- MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT
- B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB
- nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR
- fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW
- 8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG
- A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE
- CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG
- A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+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MgZK9FGqkjWZCrX
- gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV
- HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF
- AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj
- Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG
- j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH
- hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC
- X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
- -----END CERTIFICATE-----
- GlobalSign Root CA - R2
- =======================
- -----BEGIN CERTIFICATE-----
- MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv
- YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh
- bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT
- aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln
- bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6
- ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp
- s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN
- S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL
- TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C
- ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E
- FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i
- YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN
- BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp
- 9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu
- 01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7
- 9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7
- TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==
- -----END CERTIFICATE-----
- Verisign Class 3 Public Primary Certification Authority - G3
- ============================================================
- -----BEGIN CERTIFICATE-----
- MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
- UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
- cmsxOjA4BgNVBAsTMShjK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- /Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0
- xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa
- t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
- -----END CERTIFICATE-----
- Verisign Class 4 Public Primary Certification Authority - G3
- ============================================================
- -----BEGIN CERTIFICATE-----
- MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
- UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
- cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
- IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh
- dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw
- CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
- dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv
- cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg
- Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
- ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS
- tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM
- 8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW
- Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX
- Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
- j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt
- mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm
- fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd
- RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG
- UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg==
- -----END CERTIFICATE-----
- Entrust.net Premium 2048 Secure Server CA
- =========================================
- -----BEGIN CERTIFICATE-----
- MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u
- ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp
- bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV
- BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx
- NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQ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CNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE=
- -----END CERTIFICATE-----
- Baltimore CyberTrust Root
- =========================
- -----BEGIN CERTIFICATE-----
- MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE
- ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li
- ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC
- SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs
- dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME
- uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB
- UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C
- G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9
- XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr
- l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI
- VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB
- BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh
- cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5
- hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa
- Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H
- RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
- -----END CERTIFICATE-----
- AddTrust Low-Value Services Root
- ================================
- -----BEGIN CERTIFICATE-----
- MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
- QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU
- cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw
- CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO
- ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB
- AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6
- 54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr
- oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1
- Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui
- GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w
- HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD
- AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT
- RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw
- HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt
- ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph
- iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY
- eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr
- mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj
- ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk=
- -----END CERTIFICATE-----
- AddTrust External Root
- ======================
- -----BEGIN CERTIFICATE-----
- MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
- QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD
- VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw
- NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU
- cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29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HxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
- -----END CERTIFICATE-----
- AddTrust Public Services Root
- =============================
- -----BEGIN CERTIFICATE-----
- MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
- QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU
- cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ
- BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l
- dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF
- AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu
- nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i
- d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG
- Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw
- HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G
- A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB
- /zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux
- FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G
- A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4
- JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL
- +YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao
- GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9
- Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H
- EufOX1362KqxMy3ZdvJOOjMMK7MtkAY=
- -----END CERTIFICATE-----
- AddTrust Qualified Certificates Root
- ====================================
- -----BEGIN CERTIFICATE-----
- MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
- QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU
- cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx
- CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ
- IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG
- 9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx
- 64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3
- KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o
- L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR
- wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU
- MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/
- BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE
- BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y
- azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD
- ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG
- GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X
- dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze
- RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB
- iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE=
- -----END CERTIFICATE-----
- Entrust Root Certification Authority
- ====================================
- -----BEGIN CERTIFICATE-----
- MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELM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AQ8AMIIB
- CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo
- BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet
- 8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc
- T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU
- vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD
- AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk
- DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q
- zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4
- d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2
- mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p
- XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm
- Mw==
- -----END CERTIFICATE-----
- GeoTrust Global CA 2
- ====================
- -----BEGIN CERTIFICATE-----
- MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN
- R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0M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BAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0
- XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB
- hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc
- aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2
- qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL
- oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK
- xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF
- KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2
- DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK
- xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU
- p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI
- P/rmMuGNG2+k5o7Y+SlIis5z/iw=
- -----END CERTIFICATE-----
- GeoTrust Universal CA 2
- =======================
- -----BEGIN CERTIFICATE-----
- MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN
- R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwH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MGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz
- LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm
- 7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz
- Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z
- 8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C
- 12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
- -----END CERTIFICATE-----
- Comodo Secure Services root
- ===========================
- -----BEGIN CERTIFICATE-----
- MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS
- R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg
- TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw
- MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu
- Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi
- BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP
- ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP
- 9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc
- rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC
- oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V
- p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E
- FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w
- gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj
- YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm
- aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm
- 4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj
- Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL
- DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw
- pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H
- RR3B7Hzs/Sk=
- -----END CERTIFICATE-----
- Comodo Trusted Services root
- ============================
- -----BEGIN CERTIFICATE-----
- MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkG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FIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul
- LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x
- gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi
- 5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi
- 5nrQNiOKSnQ2+Q==
- -----END CERTIFICATE-----
- QuoVadis Root CA 2
- ==================
- -----BEGIN CERTIFICATE-----
- MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT
- EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx
- ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
- aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC
- DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6
- XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk
- lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB
- lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy
- lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL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IWDmbA4CD/pXvk1B+TJYm5X
- f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II
- 4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8
- VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u
- -----END CERTIFICATE-----
- QuoVadis Root CA 3
- ==================
- -----BEGIN CERTIFICATE-----
- MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT
- EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx
- OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
- aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC
- DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg
- DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij
- KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K
- DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv
- BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp
- p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8
- n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yZlZ25w9Rl6VSDE1JUZU2
- Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp
- 8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC
- bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu
- g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p
- vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr
- qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto=
- -----END CERTIFICATE-----
- Security Communication Root CA
- ==============================
- -----BEGIN CERTIFICATE-----
- MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP
- U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw
- HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP
- U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw
- ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw
- 8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM
- DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX
- 5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd
- DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2
- JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw
- DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g
- 0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a
- mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ
- s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ
- 6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi
- FL39vmwLAw==
- -----END CERTIFICATE-----
- Sonera Class 2 Root CA
- ======================
- -----BEGIN CERTIFICATE-----
- MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG
- U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw
- NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh
- IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3
- /Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT
- dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG
- f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P
- tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH
- nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT
- XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt
- 0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI
- cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph
- Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx
- EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH
- llpwrN9M
- -----END CERTIFICATE-----
- Staat der Nederlanden Root CA
- =============================
- -----BEGIN CERTIFICATE-----
- MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE
- ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g
- Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w
- HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjA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HRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD
- LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3
- DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft
- Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0
- I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx
- EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP
- DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI
- -----END CERTIFICATE-----
- UTN USERFirst Hardware Root CA
- ==============================
- -----BEGIN CERTIFICATE-----
- MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE
- BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl
- IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd
- BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx
- OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0
- eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz
- ZXJ0cnVzdC5jb20xHzAdBgNVBAMTF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END CERTIFICATE-----
- Camerfirma Chambers of Commerce Root
- ====================================
- -----BEGIN CERTIFICATE-----
- MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe
- QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i
- ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx
- NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp
- cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn
- MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC
- AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU
- xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH
- NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW
- DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV
- d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud
- EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v
- cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P
- AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh
- bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD
- VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz
- aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi
- fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD
- L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN
- UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n
- ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1
- erfutGWaIZDgqtCYvDi1czyL+Nw=
- -----END CERTIFICATE-----
- Camerfirma Global Chambersign Root
- ==================================
- -----BEGIN CERTIFICATE-----
- MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe
- QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i
- ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx
- NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt
- YSBTQSBDSUYgQTgyNzQzMjg3MSMw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fKX0j//U2K0X1S0E0T9Y
- gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ
- PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4
- IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes
- t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A==
- -----END CERTIFICATE-----
- NetLock Notary (Class A) Root
- =============================
- -----BEGIN CERTIFICATE-----
- MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI
- EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6
- dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j
- ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX
- DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH
- EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD
- VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz
- cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM
- D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ
- z+qMkjvN9wfcZnSX9EU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- PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt
- I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
- HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI
- Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b
- vZ8=
- -----END CERTIFICATE-----
- Starfield Class 2 CA
- ====================
- -----BEGIN CERTIFICATE-----
- MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc
- U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg
- Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo
- MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG
- A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG
- SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY
- bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ
- JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm
- epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN
- F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF
- MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f
- hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo
- bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g
- QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs
- afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM
- PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl
- xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD
- KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3
- QBFGmh95DmK/D5fs4C8fF5Q=
- -----END CERTIFICATE-----
- StartCom Certification Authority
- ================================
- -----BEGIN CERTIFICATE-----
- MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN
- U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu
- ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0
- NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk
- LjErMCkG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M8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy
- +fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS
- -----END CERTIFICATE-----
- Swisscom Root CA 1
- ==================
- -----BEGIN CERTIFICATE-----
- MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG
- EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy
- dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4
- MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln
- aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC
- IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM
- MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF
- NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe
- AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC
- b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn
- 7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN
- cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyeP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s9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW
- NY6E0F/6MBr1mmz0DlP5OlvRHA==
- -----END CERTIFICATE-----
- DigiCert Assured ID Root CA
- ===========================
- -----BEGIN CERTIFICATE-----
- MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG
- EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw
- IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx
- MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL
- ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew
- ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO
- 9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy
- UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW
- /lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy
- oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf
- GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF
- 66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq
- hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc
- EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn
- SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i
- 8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe
- +o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==
- -----END CERTIFICATE-----
- DigiCert Global Root CA
- =======================
- -----BEGIN CERTIFICATE-----
- MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG
- EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw
- HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw
- MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3
- dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq
- hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn
- TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5
- BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H
- 4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y
- 7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB
- o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm
- 8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF
- BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr
- EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt
- tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886
- UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
- CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
- -----END CERTIFICATE-----
- DigiCert High Assurance EV Root CA
- ==================================
- -----BEGIN CERTIFICATE-----
- MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG
- EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw
- KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw
- MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ
- MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu
- Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t
- Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS
- OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3
- MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ
- NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe
- h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB
- Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY
- JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ
- V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp
- myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK
- mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
- vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K
- -----END CERTIFICATE-----
- Certplus Class 2 Primary CA
- ===========================
- -----BEGIN CERTIFICATE-----
- M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Y3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug
- dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE
- GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw
- RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS
- fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
- -----END CERTIFICATE-----
- DST ACES CA X6
- ==============
- -----BEGIN CERTIFICATE-----
- MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG
- EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT
- MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha
- MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE
- CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC
- AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI
- DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa
- pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow
- GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy
- MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud
- EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu
- Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy
- dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU
- CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2
- 5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t
- Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq
- nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs
- vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3
- oKfN5XozNmr6mis=
- -----END CERTIFICATE-----
- TURKTRUST Certificate Services Provider Root 2
- ==============================================
- -----BEGIN CERTIFICATE-----
- MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF
- bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP
- MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg
- QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0b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JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P
- 9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5
- UrbnBEI=
- -----END CERTIFICATE-----
- SwissSign Gold CA - G2
- ======================
- -----BEGIN CERTIFICATE-----
- MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw
- EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN
- MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp
- c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B
- AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq
- t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C
- jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg
- vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF
- ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR
- AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend
- jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69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bjkQuE4NRb0yG5P94FW6Lqj
- viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ
- -----END CERTIFICATE-----
- SwissSign Silver CA - G2
- ========================
- -----BEGIN CERTIFICATE-----
- MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT
- BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X
- DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3
- aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG
- 9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644
- N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm
- +/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH
- 6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu
- MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h
- qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5
- FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs
- ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3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s5Aq7KkzrCWA5zspi2C5u
- -----END CERTIFICATE-----
- GeoTrust Primary Certification Authority
- ========================================
- -----BEGIN CERTIFICATE-----
- MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG
- EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD
- ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx
- CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ
- cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
- CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN
- b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9
- nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge
- RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt
- tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD
- AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI
- hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K
- Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4g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UROsdB58Hum/u6f1OCyn1PoSgAfGc
- q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K
- aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p
- afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD
- VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF
- AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE
- uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX
- xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89
- jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH
- z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA==
- -----END CERTIFICATE-----
- VeriSign Class 3 Public Primary Certification Authority - G5
- ============================================================
- -----BEGIN CERTIFICATE-----
- MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE
- BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
- ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
- IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcm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GxVaQZx5RNoJLNP2MwhR/jx
- YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ
- bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g
- 8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV
- HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi
- 0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud
- EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn
- oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA
- MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+
- OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn
- CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5
- 3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc
- f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW
- -----END CERTIFICATE-----
- COMODO Certification Authority
- ==============================
- -----BEGIN CERTIFICATE-----
- MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQU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IYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP
- OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/
- RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc
- IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN
- +8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ==
- -----END CERTIFICATE-----
- Network Solutions Certificate Authority
- =======================================
- -----BEGIN CERTIFICATE-----
- MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG
- EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr
- IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx
- MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu
- MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G
- CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx
- jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT
- aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT
- crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc
- /Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB
- AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP
- BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv
- bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA
- A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q
- 4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/
- GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv
- wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD
- ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey
- -----END CERTIFICATE-----
- WellsSecure Public Root Certificate Authority
- =============================================
- -----BEGIN CERTIFICATE-----
- MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM
- F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw
- NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN
- MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVV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ZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0
- bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj
- qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es
- E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ
- tylv2G0xffX8oRAHh84vWdw+WNs=
- -----END CERTIFICATE-----
- COMODO ECC Certification Authority
- ==================================
- -----BEGIN CERTIFICATE-----
- MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC
- R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE
- ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB
- dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix
- GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR
- Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo
- b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X
- 4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni
- wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOB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pAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ
- tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB
- egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC
- iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK
- q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q
- MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg
- Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI
- lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF
- 0mBWWg==
- -----END CERTIFICATE-----
- Security Communication EV RootCA1
- =================================
- -----BEGIN CERTIFICATE-----
- MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc
- U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh
- dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE
- BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl
- Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
- AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO
- /VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX
- WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z
- ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4
- bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK
- 9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG
- SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm
- iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG
- Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW
- mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW
- T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490
- -----END CERTIFICATE-----
- OISTE WISeKey Global Root GA CA
- ===============================
- -----BEGIN CERTIFICATE-----
- MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE
- BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG
- A1UECx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TGfA6b7wP4piFXa
- hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY
- okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0=
- -----END CERTIFICATE-----
- Microsec e-Szigno Root CA
- =========================
- -----BEGIN CERTIFICATE-----
- MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE
- BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL
- EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0
- MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz
- dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT
- GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
- AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG
- d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N
- oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc
- QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ
- PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEF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ICATE-----
- Deutsche Telekom Root CA 2
- ==========================
- -----BEGIN CERTIFICATE-----
- MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT
- RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG
- A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5
- MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G
- A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS
- b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5
- bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI
- KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY
- AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK
- Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV
- jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV
- HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr
- E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy
- zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8
- rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G
- dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU
- Cm26OWMohpLzGITY+9HPBVZkVw==
- -----END CERTIFICATE-----
- Cybertrust Global Root
- ======================
- -----BEGIN CERTIFICATE-----
- MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li
- ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4
- MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD
- ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
- +Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW
- 0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL
- AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin
- 89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT
- 8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP
- BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2
- MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G
- A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO
- lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi
- 5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2
- hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T
- X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW
- WL1WMRJOEcgh4LMRkWXbtKaIOM5V
- -----END CERTIFICATE-----
- ePKI Root Certification Authority
- =================================
- -----BEGIN CERTIFICATE-----
- MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG
- EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg
- Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx
- MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq
- MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B
- AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs
- IZ5qyNUD9WBpj8z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1I0ltabrNMdjmEP
- NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r
- GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE
- xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx
- gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy
- sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD
- BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw=
- -----END CERTIFICATE-----
- T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3
- =============================================================================================================================
- -----BEGIN CERTIFICATE-----
- MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH
- DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q
- aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry
- b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV
- BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg
- S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAt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A1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT
- y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh
- LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M
- dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI=
- -----END CERTIFICATE-----
- Buypass Class 2 CA 1
- ====================
- -----BEGIN CERTIFICATE-----
- MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU
- QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2
- MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh
- c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI
- hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M
- cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83
- 0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4
- 0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R
- uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC
- MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P
- AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV
- 1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt
- 7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2
- fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w
- wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho
- -----END CERTIFICATE-----
- EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1
- ==========================================================================
- -----BEGIN CERTIFICATE-----
- MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF
- bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg
- QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe
- Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p
- ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt
- IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG
- SIb3DQEBAQUAA4ICDwAwggIKAoICA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6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT
- VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or
- czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK
- y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC
- wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S
- lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5
- Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM
- O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8
- BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2
- G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m
- mxE=
- -----END CERTIFICATE-----
- ApplicationCA - Japanese Government
- ===================================
- -----BEGIN CERTIFICATE-----
- MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT
- SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw
- MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3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Certification Authority - G3
- =============================================
- -----BEGIN CERTIFICATE-----
- MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE
- BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0
- IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy
- eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz
- NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo
- YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT
- LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI
- hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j
- K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE
- c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C
- IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu
- dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC
- MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr
- 2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9
- cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE
- Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD
- AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s
- t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt
- -----END CERTIFICATE-----
- thawte Primary Root CA - G2
- ===========================
- -----BEGIN CERTIFICATE-----
- MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC
- VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu
- IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg
- Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV
- MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG
- b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt
- IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS
- LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5
- 8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU
- mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN
- G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K
- rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg==
- -----END CERTIFICATE-----
- thawte Primary Root CA - G3
- ===========================
- -----BEGIN CERTIFICATE-----
- MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE
- BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2
- aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv
- cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w
- ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh
- d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD
- VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG
- A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
- MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At
- P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC
- +BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY
- 7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW
- vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E
- BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ
- KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK
- A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu
- t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC
- 8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm
- er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A=
- -----END CERTIFICATE-----
- GeoTrust Primary Certification Authority - G2
- =============================================
- -----BEGIN CERTIFICATE-----
- MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC
- VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu
- Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD
- ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1
- OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg
- MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl
- b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG
- BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc
- KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD
- VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+
- EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m
- ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2
- npaqBA+K
- -----END CERTIFICATE-----
- VeriSign Universal Root Certification Authority
- ===============================================
- -----BEGIN CERTIFICATE-----
- MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
- BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
- ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
- IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u
- IEF1dGhvcml0eTAeFw0wODA0MDIwM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Wazx
- Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx
- P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P
- wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4
- mJO37M2CYfE45k+XmCpajQ==
- -----END CERTIFICATE-----
- VeriSign Class 3 Public Primary Certification Authority - G4
- ============================================================
- -----BEGIN CERTIFICATE-----
- MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC
- VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3
- b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz
- ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj
- YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL
- MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU
- cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo
- b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5
- IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8
- Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz
- rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB
- /zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw
- HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u
- Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD
- A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx
- AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==
- -----END CERTIFICATE-----
- NetLock Arany (Class Gold) FÅ‘tanúsÃtvány
- ============================================
- -----BEGIN CERTIFICATE-----
- MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G
- A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610
- dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB
- cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx
- MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO
- ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv
- biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6
- c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu
- 0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw
- /HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk
- H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw
- fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1
- neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB
- BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW
- qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta
- YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC
- bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna
- NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu
- dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E=
- -----END CERTIFICATE-----
- Staat der Nederlanden Root CA - G2
- ==================================
- -----BEGIN CERTIFICATE-----
- MIIFyjCCA7K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xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF
- MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD
- HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh
- AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA
- cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr
- AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw
- cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE
- FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G
- A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo
- ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL
- abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678
- IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh
- Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2
- yyqcjg==
- -----END CERTIFICATE-----
- Hongkong Post Root CA 1
- =======================
- -----BEGIN CERTIFICATE-----
- MIIDMDCCAhigAwIBAgIC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hDDl3WY4JxHYB0yvbiAmvZWg==
- -----END CERTIFICATE-----
- SecureSign RootCA11
- ===================
- -----BEGIN CERTIFICATE-----
- MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi
- SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS
- b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw
- KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1
- cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL
- TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO
- wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq
- g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP
- O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA
- bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX
- t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh
- OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r
- bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ
- Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01
- y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061
- lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I=
- -----END CERTIFICATE-----
- ACEDICOM Root
- =============
- -----BEGIN CERTIFICATE-----
- MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD
- T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4
- MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG
- A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF
- AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk
- WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD
- YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew
- MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb
- m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk
- HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT
- xKJxqvQUfecyuB+81fFO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6nOGOp
- MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o
- tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA==
- -----END CERTIFICATE-----
- Microsec e-Szigno Root CA 2009
- ==============================
- -----BEGIN CERTIFICATE-----
- MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER
- MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv
- c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o
- dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE
- BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt
- U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw
- DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA
- fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG
- 0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA
- pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm
- 1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC
- AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf
- QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE
- FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o
- lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX
- I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775
- tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02
- yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi
- LXpUq3DDfSJlgnCW
- -----END CERTIFICATE-----
- GlobalSign Root CA - R3
- =======================
- -----BEGIN CERTIFICATE-----
- MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv
- YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh
- bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT
- aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln
- bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt
- iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ
- 0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3
- rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl
- OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2
- xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE
- FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7
- lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8
- EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E
- bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18
- YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r
- kpeDMdmztcpHWD9f
- -----END CERTIFICATE-----
- Autoridad de Certificacion Firmaprofesional CIF A62634068
- =========================================================
- -----BEGIN CERTIFICATE-----
- MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA
- BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2
- MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw
- QAYDVQQDDDlBdXRvcml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- bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx
- ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx
- 51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk
- R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP
- T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f
- Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl
- osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR
- crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR
- saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD
- KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi
- 6Et8Vcad+qMUu2WFbm5PEn4KPJ2V
- -----END CERTIFICATE-----
- Izenpe.com
- ==========
- -----BEGIN CERTIFICATE-----
- MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG
- EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz
- MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpF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BgNVHQ8BAf8EBAMCAQYwHQYDVR0O
- BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l
- Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga
- kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q
- hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs
- g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5
- aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5
- nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC
- ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo
- Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z
- WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw==
- -----END CERTIFICATE-----
- Chambers of Commerce Root - 2008
- ================================
- -----BEGIN CERTIFICATE-----
- MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD
- MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv
- bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyB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cK
- zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG
- nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg
- OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ
- -----END CERTIFICATE-----
- Global Chambersign Root - 2008
- ==============================
- -----BEGIN CERTIFICATE-----
- MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD
- MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv
- bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu
- QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx
- NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg
- Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ
- QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD
- aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf
- VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf
- XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0
- ZJJ0YPP2zxhPYL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QADggIBAICIf3DekijZBZRG
- /5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6
- ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s
- dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg
- 9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH
- foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du
- qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr
- P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq
- c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z
- 09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B
- -----END CERTIFICATE-----
- Go Daddy Root Certificate Authority - G2
- ========================================
- -----BEGIN CERTIFICATE-----
- MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT
- B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu
- MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5
- MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6
- b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G
- A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI
- hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq
- 9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD
- +qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd
- fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl
- NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC
- MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9
- BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac
- vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r
- 5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV
- N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO
- LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1
- -----END CERTIFICATE-----
- Starfield Root Certificate Authority - G2
- =========================================
- -----BEGIN CERTIFICATE-----
- MIID3TCCA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iKZ3sx
- 4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw
- F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K
- pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ
- c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0
- -----END CERTIFICATE-----
- Starfield Services Root Certificate Authority - G2
- ==================================================
- -----BEGIN CERTIFICATE-----
- MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT
- B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s
- b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl
- IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV
- BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT
- dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg
- Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
- AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2
- h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa
- hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP
- LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB
- rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw
- AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG
- SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP
- E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy
- xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd
- iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza
- YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6
- -----END CERTIFICATE-----
- AffirmTrust Commercial
- ======================
- -----BEGIN CERTIFICATE-----
- MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS
- BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw
- MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly
- bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF
- AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb
- DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV
- C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6
- BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww
- MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV
- HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
- AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG
- hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi
- qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv
- 0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh
- sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8=
- -----END CERTIFICATE-----
- AffirmTrust Networking
- ======================
- -----BEGIN CERTIFICATE-----
- MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS
- BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw
- MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly
- bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF
- AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE
- Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI
- dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24
- /PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb
- h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV
- HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
- AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu
- UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6
- 12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23
- WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9
- /ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s=
- -----END CERTIFICATE-----
- AffirmTrust Premium
- ===================
- -----BEGIN CERTIFICATE-----
- MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS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GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv
- MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg
- Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC
- 6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S
- L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK
- +4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV
- BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg
- IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60
- g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb
- zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw==
- -----END CERTIFICATE-----
- AffirmTrust Premium ECC
- =======================
- -----BEGIN CERTIFICATE-----
- MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV
- BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx
- MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U
- cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA
- IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ
- N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW
- BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK
- BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X
- 57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM
- eQ==
- -----END CERTIFICATE-----
- Certum Trusted Network CA
- =========================
- -----BEGIN CERTIFICATE-----
- MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK
- ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv
- biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy
- MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU
- ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5
- MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC
- AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC
- l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J
- J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4
- fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0
- cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB
- Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw
- DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj
- jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1
- mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj
- Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI
- 03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw=
- -----END CERTIFICATE-----
- Certinomis - Autorité Racine
- =============================
- -----BEGIN CERTIFICATE-----
- MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK
- Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg
- LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG
- A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBA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WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva
- R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40
- nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B
- CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv
- JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE
- qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b
- WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE
- wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/
- vgt2Fl43N+bYdJeimUV5
- -----END CERTIFICATE-----
- Root CA Generalitat Valenciana
- ==============================
- -----BEGIN CERTIFICATE-----
- MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE
- ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290
- IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcNMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3
- WjBoMQswCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UE
- CxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpd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QBjAGEAYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBu
- AHQAcgBhACAAZQBuACAAbABhACAAZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAA
- OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0
- dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV
- BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G
- A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S
- b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh
- TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz
- Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63
- NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH
- iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt
- +GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM=
- -----END CERTIFICATE-----
- A-Trust-nQual-03
- ================
- -----BEGIN CERTIFICATE-----
- MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJBVDFIMEYGA1UE
- Cgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVy
- a2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0HhsnLuP1Hyl0Te2v9+GS
- mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6
- ahq97BvIxYSazQ==
- -----END CERTIFICATE-----
- TWCA Root Certification Authority
- =================================
- -----BEGIN CERTIFICATE-----
- MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ
- VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh
- dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG
- EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB
- IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
- AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx
- QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC
- oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP
- 4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r
- y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB
- BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG
- 9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC
- mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW
- QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY
- T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny
- Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw==
- -----END CERTIFICATE-----
- Security Communication RootCA2
- ==============================
- -----BEGIN CERTIFICATE-----
- MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc
- U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh
- dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC
- SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy
- aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
- ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++
- +T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R
- 3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV
- spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K
-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OZ1Vr/sXE7zDkJ
- lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa
- Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe
- l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2
- E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D
- 5EI=
- -----END CERTIFICATE-----
- Hellenic Academic and Research Institutions RootCA 2011
- =======================================================
- -----BEGIN CERTIFICATE-----
- MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT
- O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y
- aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z
- IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT
- AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z
- IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo
- IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
- AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI
- 1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa
- 71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u
- 8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH
- 3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/
- MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8
- MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu
- b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt
- XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8
- TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD
- /md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N
- 7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4
- -----END CERTIFICATE-----
- Actalis Authentication Root CA
- ==============================
- -----BEGIN CERTIFICATE-----
- MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM
- BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE
- AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDT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EGMA0GCSqGSIb3DQEBCwUAA4ICAQALe3KHwGCmSUyI
- WOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70jsNjLiNmsGe+b7bAEzlgqqI0
- JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx
- K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+
- Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC
- 4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo
- 2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz
- lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem
- OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9
- vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg==
- -----END CERTIFICATE-----
- Trustis FPS Root CA
- ===================
- -----BEGIN CERTIFICATE-----
- MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG
- EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290
- IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV
- BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ
- KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ
- RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk
- H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa
- cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt
- o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA
- AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd
- BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c
- GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC
- yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P
- 8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV
- l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl
- iB6XzCGcKQENZetX2fNXlrtIzYE=
- -----END CERTIFICATE-----
- StartCom Certification Authority
- ================================
- -----BEGIN CERTIFICATE-----
- MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN
- U3RhcnRDb20gTHRkL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h+GlBEXoPBKlCcWw0bdT82AUuoVpaiF8H3VhFyAX
- e2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVFP0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA
- 2MFrLH9ZXF2RsXAiV+uKa0hK1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBs
- HvUwyKMQ5bLmKhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE
- JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ8dCAWZvLMdib
- D4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnmfyWl8kgAwKQB2j8=
- -----END CERTIFICATE-----
- StartCom Certification Authority G2
- ===================================
- -----BEGIN CERTIFICATE-----
- MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMN
- U3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg
- RzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UE
- ChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3Jp
- dHkgRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8O
- o1XJJZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsDvfOpL9HG
- 4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnooD/Uefyf3lLE3PbfHkffi
- Aez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumN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6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5lIxKVCCIc
- l85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoohdVddLHRDiBYmxOlsGOm
- 7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulrso8uBtjRkcfGEvRM/TAXw8HaOFvjqerm
- obp573PYtlNXLfbQ4ddI
- -----END CERTIFICATE-----
- Buypass Class 2 Root CA
- =======================
- -----BEGIN CERTIFICATE-----
- MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU
- QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMiBSb290IENBMB4X
- DTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1owTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1
- eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIw
- DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1
- g1Lr6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPVL4O2fuPn
- 9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC911K2GScuVr1QGbNgGE41b
- /+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHxMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqU
- CqTqc/sLUegTBxj6DvEr0VQVfTzh97QZQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeff
- awrbD02TTqigzXsu8lkBarcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgI
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CtCev9eBCfHJxyYN
- rJgWVqA=
- -----END CERTIFICATE-----
- Buypass Class 3 Root CA
- =======================
- -----BEGIN CERTIFICATE-----
- MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU
- QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X
- DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1
- eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw
- DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH
- sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR
- 5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh
- 7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ
- ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH
- 2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV
- /afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ
- RwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D34xFMFbG02SrZvPA
- Xpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgPK9Dx2hzLabjKSWJtyNBjYt1gD1iq
- j6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD
- VR0OBBYEFEe4zf/lb+74suwvTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF
- AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV
- cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G
- uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG
- Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8
- ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2
- KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz
- 6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug
- UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe
- eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi
- Cp/HuZc=
- -----END CERTIFICATE-----
- T-TeleSec GlobalRoot Class 3
- ============================
- -----BEGIN CERTIFICATE-----
- MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM
- IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY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HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml
- e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw==
- -----END CERTIFICATE-----
- EE Certification Centre Root CA
- ===============================
- -----BEGIN CERTIFICATE-----
- MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG
- EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy
- dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw
- MTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlB
- UyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRy
- ZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IB
- DwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUyeuuOF0+W2Ap7kaJjbMeM
- TC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvObntl8jixwKIy72KyaOBhU8E2lf/slLo2
- rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIwWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw
- 93X2PaRka9ZP585ArQ/dMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtN
- P2MbRMNE1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYDVR0T
- AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/zQas8fElyalL1BSZ
- MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF
- BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj
- xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM
- lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u
- uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU
- 3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM
- dcGWxZ0=
- -----END CERTIFICATE-----
- TURKTRUST Certificate Services Provider Root 2007
- =================================================
- -----BEGIN CERTIFICATE-----
- MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOcUktUUlVTVCBF
- bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP
- MA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg
- QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4X
- DTA3MTIyNTE4MzcxOVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxl
- a3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9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ATE-----
- D-TRUST Root Class 3 CA 2 2009
- ==============================
- -----BEGIN CERTIFICATE-----
- MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK
- DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe
- Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxE
- LVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIw
- DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOAD
- ER03UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42tSHKXzlA
- BF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9RySPocq60vFYJfxLLHLGv
- KZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsMlFqVlNpQmvH/pStmMaTJOKDfHR+4CS7z
- p+hnUquVH+BGPtikw8paxTGA6Eian5Rp/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUC
- AwEAAaOCARowggEWMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ
- 4PGEMA4GA1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVjdG9y
- eS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUyMENBJTIwMiUyMDIw
- MDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3QwQ6BBoD+G
- PWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3JsL2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAw
- OS5jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm
- 2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0
- o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV
- dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph
- X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I=
- -----END CERTIFICATE-----
- D-TRUST Root Class 3 CA 2 EV 2009
- =================================
- -----BEGIN CERTIFICATE-----
- MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK
- DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw
- OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK
- DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw
- OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS
- egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh
- zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+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JgD/ll9ohri4zspV4KuxPX+Y1zMOWj3Y
- eMLEYC/HYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km
- -----END CERTIFICATE-----
- China Internet Network Information Center EV Certificates Root
- ==============================================================
- -----BEGIN CERTIFICATE-----
- MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCQ04xMjAwBgNV
- BAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyMUcwRQYDVQQDDD5D
- aGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0aW9uIENlbnRlciBFViBDZXJ0aWZpY2F0ZXMg
- Um9vdDAeFw0xMDA4MzEwNzExMjVaFw0zMDA4MzEwNzExMjVaMIGKMQswCQYDVQQGEwJDTjEyMDAG
- A1UECgwpQ2hpbmEgSW50ZXJuZXQgTmV0d29yayBJbmZvcm1hdGlvbiBDZW50ZXIxRzBFBgNVBAMM
- PkNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyIEVWIENlcnRpZmljYXRl
- cyBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm35z7r07eKpkQ0H1UN+U8i6y
- jUqORlTSIRLIOTJCBumD1Z9S7eVnAztUwYyZmczpwA//DdmEEbK40ctb3B75aDFk4Zv6dOtouSCV
- 98YPjUesWgbdYavi7NifFy2cyjw1l1VxzUOFsUcW9SxTgHbP0wBkvUCZ3czY28Sf1hNfQYOL+Q2H
- klY0bBoQCxfVWhyXWIQ8hBouXJE0bhlffxdpxWXvayHG1VA6v2G5BY3vbzQ6sm8UY78WO5upKv23
- KzhmBsUs4qpnHkWnjQRmQvaPK++IIGmPMowUc9orhpFjIpryp9vOiYurXccUwVswah+xt54ugQEC
- 7c+WXmPbqOY4twIDAQABo2MwYTAfBgNVHSMEGDAWgBR8cks5x8DbYqVPm6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0vSk3FQQoHt5FRnDsr7p4DooqzgB53MBfGWcs
- a0vvaGgLQ+OswWIJ76bdZWGgr4RVSJFSHMYlkSrQwSIjYVmvRRGFHQEkNI/Ps/8XciATwoCqISxx
- OQ7Qj1zB09GOInJGTB2Wrk9xseEFKZZZ9LuedT3PDTcNYtsmjGOpI99nBjx8Oto0QuFmtEYE3saW
- mA9LSHokMnWRn6z3aOkquVVlzl1h0ydw2Df+n7mvoC5Wt6NlUe07qxS/TFED6F+KBZvuim6c779o
- +sjaC+NCydAXFJy3SuCvkychVSa1ZC+N8f+mQAWFBVzKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TC
- rvJcwhbtkj6EPnNgiLx29CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX
- 5OfNeOI5wSsSnqaeG8XmDtkx2Q==
- -----END CERTIFICATE-----
- Swisscom Root EV CA 2
- =====================
- -----BEGIN CERTIFICATE-----
- MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAwZzELMAkGA1UE
- BhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdpdGFsIENlcnRpZmljYXRlIFNl
- cnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcN
- MzEwNjI1MDg0NTA4WjBnMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsT
- HERpZ2l0YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYg
- Q0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7BxUglgRCgz
- o3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD1ycfMQ4jFrclyxy0uYAy
- Xhqdk/HoPGAs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mO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvkF7mGnjix
- lAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqFa3qdnom2piiZk4hA9z7N
- UaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsTQ6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJ
- a7+h89n07eLw4+1knj0vllJPgFOL
- -----END CERTIFICATE-----
- CA Disig Root R2
- ================
- -----BEGIN CERTIFICATE-----
- MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw
- EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp
- ZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQyMDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sx
- EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp
- c2lnIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbC
- w3OeNcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNHPWSb6Wia
- xswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3Ix2ymrdMxp7zo5eFm1tL7
- A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbeQTg06ov80egEFGEtQX6sx3dOy1FU+16S
- GBsEWmjGycT6txOgmLcRK7fWV8x8nhfRyyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqV
- g8NTEQxzHQuyRpDRQjrOQG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa
- 5Beny912H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wlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2
- qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6
- Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems
- WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY=
- -----END CERTIFICATE-----
- E-Tugra Certification Authority
- ===============================
- -----BEGIN CERTIFICATE-----
- MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w
- DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls
- ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN
- ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw
- NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx
- QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxl
- cmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQD
- DB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
- MIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vd
- hQd2h8y/L5VMzH2nPbxHD5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+X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3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc
- dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV
- KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT
- Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0
- 8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G
- C7TbO6Orb1wdtn7os4I07QZcJA==
- -----END CERTIFICATE-----
- T-TeleSec GlobalRoot Class 2
- ============================
- -----BEGIN CERTIFICATE-----
- MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM
- IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU
- cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx
- MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz
- dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD
- ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3
- DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ
- SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F
- vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970
- 2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV
- WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA
- MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy
- YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4
- r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf
- vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR
- 3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN
- 9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg==
- -----END CERTIFICATE-----
- Atos TrustedRoot 2011
- =====================
- -----BEGIN CERTIFICATE-----
- MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU
- cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4
- MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG
- A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV
- h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FwnMwwDQYJKoZI
- hvcNAQELBQADggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC
- MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2cDMT/uFPpiN3
- GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUNqXsCHKnQO18LwIE6PWThv6ct
- Tr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP
- +V04ikkwj+3x6xn0dxoxGE1nVGwvb2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh
- 3jRJjehZrJ3ydlo28hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fa
- wx/kNSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNjZgKAvQU6
- O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhpq1467HxpvMc7hU6eFbm0
- FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFtnh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOV
- hMJKzRwuJIczYOXD
- -----END CERTIFICATE-----
- QuoVadis Root CA 2 G3
- =====================
- -----BEGIN CERTIFICATE-----
- MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQELBQAwSDELMAkG
- A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv
- b3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJN
- MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDV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50qi+YUbKh4yE8/nxoGib
- Ih6BJpsQBJFxwAYf3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmD
- hPbl8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+DhcI00iX
- 0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HNPlopNLk9hM6xZdRZkZFW
- dSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ywaZWWDYWGWVjUTR939+J399roD1B0y2
- PpxxVJkES/1Y+Zj0
- -----END CERTIFICATE-----
- DigiCert Assured ID Root G2
- ===========================
- -----BEGIN CERTIFICATE-----
- MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQG
- EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw
- IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgw
- MTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL
- ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIw
- ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSAn61UQbVH
- 35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4HteccbiJVMWWXvdMX0h5i89vq
- bFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9HpEgjAALAcKxHad3A2m67OeYfcgnDmCXRw
- VWmvo2ifv922ebPynXApVfSr/5Vh88lAbx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OP
- YLfykqGxvYmJHzDNw6YuYjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+Rn
- lTGNAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTO
- w0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPIQW5pJ6d1Ee88hjZv
- 0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I0jJmwYrA8y8678Dj1JGG0VDjA9tz
- d29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4GnilmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAW
- hsI6yLETcDbYz+70CjTVW0z9B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0M
- jomZmWzwPDCvON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo
- IhNzbM8m9Yop5w==
- -----END CERTIFICATE-----
- DigiCert Assured ID Root G3
- ===========================
- -----BEGIN CERTIFICATE-----
- MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV
- UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYD
- VQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1
- MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
- d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQ
- BgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJfZn4f5dwb
- RXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17QRSAPWXYQ1qAk8C3eNvJs
- KTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgF
- UaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5Fy
- YZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy
- 1vUhZscv6pZjamVFkpUBtA==
- -----END CERTIFICATE-----
- DigiCert Global Root G2
- =======================
- -----BEGIN CERTIFICATE-----
- MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQG
- EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw
- HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUx
- MjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3
- dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkq
- hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI2/Ou8jqJ
- kTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx1x7e/dfgy5SDN67sH0NO
- 3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQq2EGnI/yuum06ZIya7XzV+hdG82MHauV
- BJVJ8zUtluNJbd134/tJS7SsVQepj5WztCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyM
- UNGPHgm+F6HmIcr9g+UQvIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQAB
- o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV5uNu
- 5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY1Yl9PMWLSn/pvtsr
- F9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0U
- WTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBH
- QRFXGU7Aj64GxJUTFy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/
- iyK5S9kJRaTepLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl
- MrY=
- -----END CERTIFICATE-----
- DigiCert Global Root G3
- =======================
- -----BEGIN CERTIFICATE-----
- MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQswCQYDVQQGEwJV
- UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYD
- VQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAw
- MDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5k
- aWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0C
- AQYFK4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FGfp4tn+6O
- YwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPOZ9wj/wMco+I+o0IwQDAP
- BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNp
- Yim8S8YwCgYIKoZIzj0EAwMDaAAwZQIxAK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y
- 3maTD/HMsQmP3Wyr+mt/oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34
- VOKa5Vt8sycX
- -----END CERTIFICATE-----
- DigiCert Trusted Root G4
- ========================
- -----BEGIN CERTIFICATE-----
- MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBiMQswCQYDVQQG
- EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEw
- HwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1
- MTIwMDAwWjBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
- d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0G
- CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3yithZwuEp
- pz1Yq3aaza57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1Ifxp4VpX6+n6lXFllVcq9o
- k3DCsrp1mWpzMpTREEQQL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X2m
- +Jzr5dVjhU1zZmkR/sgO9MHHZklTfuQZa/HpelmjbX7FF+Ynxu8b22/8DU0GAbQOXDBGVWCvOGU6
- yke6rCzMRh+yRpY/8+0mBe53oWprfi1tWFxK1I5nuPHa1UaKJ/kR8slC/k7e3x9cxKSGhxYzoacX
- GKUN5AXlK8IrC6KVkLn9YDxOiT7nnO4fuwECAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud
- EwEB/wQFMAMBAf8wHQYDVR0OBBYEFOBNv9ybQV0T6GTwp+kVpOGBwboxMA0GCSqGSIb3DQEBCwUA
- A4ICAQBqinA4WbbaixjIvirTthnVZil6Xc1bL3McJk6jfW+rtylNpumlEYOnOXOvEESS5iVdT2H6
- yAa+Tkvv/vMx/sZ8cApBWNromUuWyXi8mHwCKe0JgOYKOoICKuLJL8hWGSbueBwj/feTZU7n85iY
- r83d2Z5AiDEoOqsuC7CsDCT6eiaY8xJhEPRdF/d+4niXVOKM6Cm6jBAyvd0zaziGfjk9DgNyp115
- j0WKWa5bIW4xRtVZjc8VX90xJc/bYNaBRHIpAlf2ltTW/+op2znFuCyKGo3Oy+dCMYYFaA6eFN0A
- kLppRQjbbpCBhqcqBT/mhDn4t/lXX0ykeVoQDF7Va/81XwVRHmyjdanPUIPTfPRm94KNPQx96N97
- qA4bLJyuQHCH2u2nFoJavjVsIE4iYdm8UXrNemHcSxH5/mc0zy4EZmFcV5cjjPOGG0jfKq+nwf/Y
- jj4Du9gqsPoUJbJRa4ZDhS4HIxaAjUz7tGM7zMN07RujHv41D198HRaG9Q7DlfEvr10lO1Hm13ZB
- ONFLAzkopR6RctR9q5czxNM+4Gm2KHmgCY0c0f9BckgG/Jou5yD5m6Leie2uPAmvylezkolwQOQv
- T8Jwg0DXJCxr5wkf09XHwQj02w47HAcLQxGEIYbpgNR12KvxAmLBsX5VYc8T1yaw15zLKYs4SgsO
- kI26oQ==
- -----END CERTIFICATE-----
- COMODO RSA Certification Authority
- ==================================
- -----BEG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AuqLZxUpaVICu9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+C
- GCe01a60y1Dma/RMhnEw6abfFobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5
- WdYgGq/yapiqcrxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E
- FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w
- DQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvlwFTPoCWOAvn9sKIN9SCYPBMt
- rFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+
- nq6PK7o9mfjYcwlYRm6mnPTXJ9OV2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSg
- tZx8jb8uk2IntznaFxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwW
- sRqZCuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiKboHGhfKp
- pC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmckejkk9u+UJueBPSZI9FoJA
- zMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yLS0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHq
- ZJx64SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk52
- 7RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7I
- LaZRfyHBNVOFBkpdn627G190
- -----END CERTIFICATE-----
- USERTrust RSA Certification Authority
- =====================================
- -----BEGIN CERTIFICATE-----
- M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ElYGn+SNuZRkg7zJn0cTRe8
- yexDJtC/QV9AqURE9JnnV4eeUB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+
- eLf8ZxXhyVeEHg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd
- BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF
- MAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPFUp/L+M+ZBn8b2kMVn54CVVeW
- FPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KOVWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ
- 7l8wXEskEVX/JJpuXior7gtNn3/3ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQ
- Eg9zKC7F4iRO/Fjs8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM
- 8WcRiQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYzeSf7dNXGi
- FSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZXHlKYC6SQK5MNyosycdi
- yA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9c
- J2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRBVXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGw
- sAvgnEzDHNb842m1R0aBL6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gx
- Q+6IHdfGjjxDah2nGN59PRbxYvnKkKj9
- -----END CERTIFICATE-----
- USERTrust ECC Certification Authority
- =====================================
- -----BEGIN CERTIFICATE-----
- MIIC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FQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD
- EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb
- R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD
- EwpHbG9iYWxTaWduMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprl
- OQcJFspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAwDgYDVR0P
- AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61FuOJAf/sKbvu+M8k8o4TV
- MAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGXkPoUVy0D7O48027KqGx2vKLeuwIgJ6iF
- JzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q=
- -----END CERTIFICATE-----
- GlobalSign ECC Root CA - R5
- ===========================
- -----BEGIN CERTIFICATE-----
- MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UECxMb
- R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD
- EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb
- R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD
- EwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6
- SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8kehOvRnkmS
- h5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd
- BgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYIKoZIzj0EAwMDaAAwZQIxAOVpEslu28Yx
- uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7
- yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3
- -----END CERTIFICATE-----
- Staat der Nederlanden Root CA - G3
- ==================================
- -----BEGIN CERTIFICATE-----
- MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE
- CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g
- Um9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloXDTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMC
- TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l
- ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4y
- olQPcPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WWIkYFsO2t
- x1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqXxz8ecAgwoNzFs21v0IJy
- EavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFyKJLZWyNtZrVtB0LrpjPOktvA9mxjeM3K
- Tj215VKb8b475lRgsGYeCasH/lSJEULR9yS6YHgamPfJEf0WwTUaVHXvQ9Plrk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3jONFrdI54OagQ97wUNNVQQXOEpR1VmiiXTTn74eS9fGbbeI
- JG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/QFH1T/U67cjF68IeHRaVesd+QnGTbksV
- tzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM94B7IWcnMFk=
- -----END CERTIFICATE-----
- Staat der Nederlanden EV Root CA
- ================================
- -----BEGIN CERTIFICATE-----
- MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE
- CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g
- RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M
- MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRl
- cmxhbmRlbiBFViBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkk
- SzrSM4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nCUiY4iKTW
- O0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3dZ//BYY1jTw+bbRcwJu+r
- 0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46prfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8
- Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13lpJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gV
- XJrm0w912fxBmJc+qiXbj5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr
- 08C+eKxCKFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXO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3Z6fJfUEkc7uzXLg==
- -----END CERTIFICATE-----
- IdenTrust Commercial Root CA 1
- ==============================
- -----BEGIN CERTIFICATE-----
- MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYDVQQG
- EwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBS
- b290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzES
- MBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENB
- IDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ld
- hNlT3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU+ehcCuz/
- mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gpS0l4PJNgiCL8mdo2yMKi
- 1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1bVoE/c40yiTcdCMbXTMTEl3EASX2MN0C
- XZ/g1Ue9tOsbobtJSdifWwLziuQkkORiT0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl
- 3ZBWzvurpWCdxJ35UrCLvYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzy
- NeVJSQjKVsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZKdHzV
- WYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHTc+XvvqDtMwt0viAg
- xGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hvl7yTmvmcEpB4eoCHFddydJxVdHix
- uuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5NiGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMC
- AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZI
- hvcNAQELBQADggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH
- 6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwtLRvM7Kqas6pg
- ghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93nAbowacYXVKV7cndJZ5t+qnt
- ozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3+wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmV
- YjzlVYA211QC//G5Xc7UI2/YRYRKW2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUX
- feu+h1sXIFRRk0pTAwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/ro
- kTLql1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG4iZZRHUe
- 2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZmUlO+KWA2yUPHGNiiskz
- Z2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7R
- cGzM7vRX+Bi6hG6H
- -----END CERTIFICATE-----
- IdenTrust Public Sector Root CA 1
- =================================
- -----BEGIN CERTIFICATE-----
- MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQG
- EwJVUzESMBAGA1UEChMJSWRlblR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QELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj
- t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHVDRDtfULAj+7A
- mgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9TaDKQGXSc3z1i9kKlT/YPyNt
- GtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8GlwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFt
- m6/n6J91eEyrRjuazr8FGF1NFTwWmhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMx
- NRF4eKLg6TCMf4DfWN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4
- Mhn5+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJtshquDDI
- ajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhAGaQdp/lLQzfcaFpPz+vC
- ZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ
- 3Wl9af0AVqW3rLatt8o+Ae+c
- -----END CERTIFICATE-----
- Entrust Root Certification Authority - G2
- =========================================
- -----BEGIN CERTIFICATE-----
- MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAUBgNV
- BAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVy
- bXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ug
- b25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5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TJ4vz4RnAuknZoh8/CbCzB428Hch0P+
- vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xO
- e4pIb4tF9g==
- -----END CERTIFICATE-----
- Entrust Root Certification Authority - EC1
- ==========================================
- -----BEGIN CERTIFICATE-----
- MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMCVVMx
- FjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn
- YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXpl
- ZCB1c2Ugb25seTEzMDEGA1UEAxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5
- IC0gRUMxMB4XDTEyMTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYw
- FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2Fs
- LXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQg
- dXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt
- IEVDMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHy
- AsWfoPZb1YsGGYZPUxBtByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef
- 9eNi1KlHBz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE
- FLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVCR98crlOZF7ZvHH3h
- vxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nXhTcGtXsI/esni0qU+eH6p44mCOh8
- kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G
- -----END CERTIFICATE-----
- CFCA EV ROOT
- ============
- -----BEGIN CERTIFICATE-----
- MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJDTjEwMC4GA1UE
- CgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNB
- IEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkxMjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEw
- MC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQD
- DAxDRkNBIEVWIFJPT1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnV
- BU03sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpLTIpTUnrD
- 7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5/ZOkVIBMUtRSqy5J35DN
- uF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp7hZZLDRJGqgG16iI0gNyejLi6mhNbiyW
- ZXvKWfry4t3uMCz7zEasxGPrb382KzRzEpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7
- xzbh72fROdOXW3NiGUgthxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9f
- py25IGvPa931DfSCt/SyZi4QKPaXWnuWFo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqotaK8K
- gW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CKc2Jo5YPSjXnTkLAdc0Hz+Ys63su
- -----END CERTIFICATE-----
- TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H5
- =========================================================
- -----BEGIN CERTIFICATE-----
- MIIEJzCCAw+gAwIBAgIHAI4X/iQggTANBgkqhkiG9w0BAQsFADCBsTELMAkGA1UEBhMCVFIxDzAN
- BgNVBAcMBkFua2FyYTFNMEsGA1UECgxEVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp
- bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4xQjBABgNVBAMMOVTDnFJLVFJVU1Qg
- RWxla3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSBINTAeFw0xMzA0MzAw
- ODA3MDFaFw0yMzA0MjgwODA3MDFaMIGxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMU0w
- SwYDVQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnE
- n2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBFbGVrdHJvbmlrIFNlcnRp
- ZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
- CgKCAQEApCUZ4WWe60ghUEoI5RHwWrom/4NZzkQqL/7hzmAD/I0Dpe3/a6i6zDQGn1k19uwsu537
- jVJp45wnEFPzpALFp/kRGml1bsMdi9GYjZOHp3GXDSHHmflS0yxjXVW86B8BSLlg/kJK9siArs1m
- ep5Fimh34khon6La8eHBEJ/rPCmBp+EyCNSgBbGM+42WAA4+Jd9ThiI7/PS98wl+d+yG6w8z5UNP
- 9FR1bSmZLmZaQ9/LXMrI5Tjxfjs1nQ/0xVqhzPMggCTTV+wVunUlm+hkS7M0hO8EuPbJbKoCPrZV
- 4jI3X/xml1/N1p7HIL9Nxqw/dV8c7TKcfGkAaZHjIxhT6QIDAQABo0IwQDAdBgNVHQ4EFgQUVpkH
- HtOsDGlktAxQR95DLL4gwPswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI
- hvcNAQELBQADggEBAJ5FdnsXSDLyOIspve6WSk6BGLFRRyDN0GSxDsnZAdkJzsiZ3GglE9Rc8qPo
- BP5yCccLqh0lVX6Wmle3usURehnmp349hQ71+S4pL+f5bFgWV1Al9j4uPqrtd3GqqpmWRgqujuwq
- URawXs3qZwQcWDD1YIq9pr1N5Za0/EKJAWv2cMhQOQwt1WbZyNKzMrcbGW3LM/nfpeYVhDfwwvJl
- lpKQd/Ct9JDpEXjXk4nAPQu6KfTomZ1yju2dL+6SfaHx/126M2CFYv4HAqGEVka+lgqaE9chTLd8
- B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW+qtB4Uu2NQvAmxU=
- -----END CERTIFICATE-----
- TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6
- =========================================================
- -----BEGIN CERTIFICATE-----
- MIIEJjCCAw6gAwIBAgIGfaHyZeyKMA0GCSqGSIb3DQEBCwUAMIGxMQswCQYDVQQGEwJUUjEPMA0G
- A1UEBwwGQW5rYXJhMU0wSwYDVQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls
- acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBF
- bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg2MB4XDTEzMTIxODA5
- MDQxMFoXDTIzMTIxNjA5MDQxMFowgbExCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExTTBL
- BgNVBAoMRFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBCaWxpxZ9pbSBHw7x2ZW5sacSf
- aSBIaXptZXRsZXJpIEEuxZ4uMUIwQAYDVQQDDDlUw5xSS1RSVVNUIEVsZWt0cm9uaWsgU2VydGlm
- aWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLEgSDYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
- AoIBAQCdsGjW6L0UlqMACprx9MfMkU1xeHe59yEmFXNRFpQJRwXiM/VomjX/3EsvMsew7eKC5W/a
- 2uqsxgbPJQ1BgfbBOCK9+bGlprMBvD9QFyv26WZV1DOzXPhDIHiTVRZwGTLmiddk671IUP320EED
- wnS3/faAz1vFq6TWlRKb55cTMgPp1KtDWxbtMyJkKbbSk60vbNg9tvYdDjTu0n2pVQ8g9P0pu5Fb
- HH3GQjhtQiht1AH7zYiXSX6484P4tZgvsycLSF5W506jM7NE1qXyGJTtHB6plVxiSvgNZ1GpryHV
- +DKdeboaX+UEVU0TRv/yz3THGmNtwx8XEsMeED5gCLMxAgMBAAGjQjBAMB0GA1UdDgQWBBTdVRcT
- 9qzoSCHK77Wv0QAy7Z6MtTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG
- 9w0BAQsFAAOCAQEAb1gNl0OqFlQ+v6nfkkU/hQu7VtMMUszIv3ZnXuaqs6fvuay0EBQNdH49ba3R
- fdCaqaXKGDsCQC4qnFAUi/5XfldcEQlLNkVS9z2sFP1E34uXI9TDwe7UU5X+LEr+DXCqu4svLcsy
- o4LyVN/Y8t3XSHLuSqMplsNEzm61kod2pLv0kmzOLBQJZo6NrRa1xxsJYTvjIKIDgI6tflEATseW
- hvtDmHd9KMeP2Cpu54Rvl0EpABZeTeIT6lnAY2c6RPuY/ATTMHKm9ocJV612ph1jmv3XZch4gyt1
- O6VbuA1df74jrlZVlFjvH4GMKrLN5ptjnhi85WsGtAuYSyher4hYyw==
- -----END CERTIFICATE-----
- Certinomis - Root CA
- ====================
- -----BEGIN CERTIFICATE-----
- MIIFkjCCA3qg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BhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTvkUz1pcMw6C8I
- 6tNxIqSSaHh02TAfBgNVHSMEGDAWgBTvkUz1pcMw6C8I6tNxIqSSaHh02TANBgkqhkiG9w0BAQsF
- AAOCAgEAfj1U2iJdGlg+O1QnurrMyOMaauo++RLrVl89UM7g6kgmJs95Vn6RHJk/0KGRHCwPT5iV
- WVO90CLYiF2cN/z7ZMF4jIuaYAnq1fohX9B0ZedQxb8uuQsLrbWwF6YSjNRieOpWauwK0kDDPAUw
- Pk2Ut59KA9N9J0u2/kTO+hkzGm2kQtHdzMjI1xZSg081lLMSVX3l4kLr5JyTCcBMWwerx20RoFAX
- lCOotQqSD7J6wWAsOMwaplv/8gzjqh8c3LigkyfeY+N/IZ865Z764BNqdeuWXGKRlI5nU7aJ+BIJ
- y29SWwNyhlCVCNSNh4YVH5Uk2KRvms6knZtt0rJ2BobGVgjF6wnaNsIbW0G+YSrjcOa4pvi2WsS9
- Iff/ql+hbHY5ZtbqTFXhADObE5hjyW/QASAJN1LnDE8+zbz1X5YnpyACleAu6AdBBR8Vbtaw5Bng
- DwKTACdyxYvRVB9dSsNAl35VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwjY/M50n92Uaf0yKHxDHYi
- I0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ8ow7bkrHxuaAKzyBvBGAFhAn1/DNP3nM
- cyrDflOR1m749fPH0FFNjkulW+YZFzvWgQncItzujrnEj1PhZ7szuIgVRs/taTX/dQ1G885x4cVr
- hkIGuUE=
- -----END CERTIFICATE-----
- <?php
- if (PHP_SAPI !== 'cli') {
- echo 'Warning: Composer should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
- }
- require __DIR__.'/../src/bootstrap.php';
- use Composer\Console\Application;
- error_reporting(-1);
- if (function_exists('ini_set')) {
- @ini_set('display_errors', 1);
- $memoryInBytes = function ($value) {
- $unit = strtolower(substr($value, -1, 1));
- $value = (int) $value;
- switch($unit) {
- case 'g':
- $value *= 1024;
- // no break (cumulative multiplier)
- case 'm':
- $value *= 1024;
- // no break (cumulative multiplier)
- case 'k':
- $value *= 1024;
- }
- return $value;
- };
- $memoryLimit = trim(ini_get('memory_limit'));
- // Increase memory_limit if it is lower than 1GB
- if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1024) {
- @ini_set('memory_limit', '1G');
- }
- unset($memoryInBytes, $memoryLimit);
- }
- // run the command application
- $application = new Application();
- $application->run();
- Copyright (c) 2015 Nils Adermann, Jordi Boggiano
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is furnished
- to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- uÐ{j:ª[Ð$ÿØ*”TT.)fñ���GBMB
|