1 Star 0 Fork 661

世博/pros

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
install.php 73.97 KB
一键复制 编辑 原始数据 按行查看 历史
brjun 提交于 2019-06-10 12:05 . 支持离线(本地)安装
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197
<?php
/**
* [WeEngine System] Copyright (c) 2014 WE7.CC
* WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
*/
ini_set('display_errors', '1');
error_reporting(E_ALL ^ E_NOTICE);
set_time_limit(0);
ob_start();
define('IA_ROOT', str_replace("\\",'/', dirname(__FILE__)));
define('APP_URL', 'http://v2.addons.we7.cc/web/');
define('APP_STORE_URL', 'http://v2.addons.we7.cc/web');
define('APP_STORE_API', 'http://v2.addons.we7.cc/api.php');
if($_GET['res']) {
$res = $_GET['res'];
$reses = tpl_resources();
if(array_key_exists($res, $reses)) {
if($res == 'css') {
header('content-type:text/css');
} else {
header('content-type:image/png');
}
echo base64_decode($reses[$res]);
exit();
}
}
// $actions = array('license', 'env', 'db', 'cloud', 'upgrade', 'finish');
$actions = array('license', 'env', 'db', 'finish');
$action = !empty($_GET['step']) ? $_GET['step'] : $_COOKIE['action'];
$action = in_array($action, $actions) ? $action : 'license';
$ispost = strtolower($_SERVER['REQUEST_METHOD']) == 'post';
if(file_exists(IA_ROOT . '/data/install.lock') && $action != 'finish' && $action != 'cloud' && $action != 'upgrade') {
header('location: ./index.php');
exit;
}
header('content-type: text/html; charset=utf-8');
if($action == 'license') {
if($ispost) {
setcookie('action', 'env');
header('location: ?refresh');
exit;
}
tpl_install_license();
}
if($action == 'env') {
if($ispost) {
setcookie('action', $_POST['do'] == 'continue' ? 'db' : 'license');
header('location: ?refresh');
exit;
}
$ret = array();
$ret['server']['os']['value'] = php_uname();
if(PHP_SHLIB_SUFFIX == 'dll') {
$ret['server']['os']['remark'] = '建议使用 Linux 系统以提升程序性能';
$ret['server']['os']['class'] = 'warning';
}
$ret['server']['sapi']['value'] = $_SERVER['SERVER_SOFTWARE'];
if(PHP_SAPI == 'isapi') {
$ret['server']['sapi']['remark'] = '建议使用 Apache 或 Nginx 以提升程序性能';
$ret['server']['sapi']['class'] = 'warning';
}
$ret['server']['php']['value'] = PHP_VERSION;
$ret['server']['dir']['value'] = IA_ROOT;
if(function_exists('disk_free_space')) {
$ret['server']['disk']['value'] = floor(disk_free_space(IA_ROOT) / (1024*1024)).'M';
} else {
$ret['server']['disk']['value'] = 'unknow';
}
$ret['server']['upload']['value'] = @ini_get('file_uploads') ? ini_get('upload_max_filesize') : 'unknow';
$ret['php']['version']['value'] = PHP_VERSION;
$ret['php']['version']['class'] = 'success';
if(version_compare(PHP_VERSION, '5.3.0') == -1) {
$ret['php']['version']['class'] = 'danger';
$ret['php']['version']['failed'] = true;
$ret['php']['version']['remark'] = 'PHP版本必须为 5.3.0 以上. <a href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58062">详情</a>';
}
$ret['php']['pdo']['ok'] = extension_loaded('pdo') && extension_loaded('pdo_mysql');
if($ret['php']['pdo']['ok']) {
$ret['php']['pdo']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
$ret['php']['pdo']['class'] = 'success';
} else {
$ret['php']['pdo']['failed'] = true;
$ret['php']['pdo']['value'] = '<span class="glyphicon glyphicon-remove text-warning"></span>';
$ret['php']['pdo']['class'] = 'warning';
$ret['php']['pdo']['remark'] = '您的PHP环境不支持PDO, 请开启此扩展. <a target="_blank" href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58074">详情</a>';
}
$ret['php']['fopen']['ok'] = @ini_get('allow_url_fopen') && function_exists('fsockopen');
if($ret['php']['fopen']['ok']) {
$ret['php']['fopen']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
} else {
$ret['php']['fopen']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
}
$ret['php']['curl']['ok'] = extension_loaded('curl') && function_exists('curl_init');
if($ret['php']['curl']['ok']) {
$ret['php']['curl']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
$ret['php']['curl']['class'] = 'success';
} else {
$ret['php']['curl']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
$ret['php']['curl']['class'] = 'danger';
$ret['php']['curl']['remark'] = '您的PHP环境不支持cURL, 也不支持 allow_url_fopen, 系统无法正常运行. <a target="_blank" href="http://bbs.we7.cc/thread-26119-1-1.html">详情</a>';
$ret['php']['curl']['failed'] = true;
}
$ret['php']['ssl']['ok'] = extension_loaded('openssl');
if($ret['php']['ssl']['ok']) {
$ret['php']['ssl']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
$ret['php']['ssl']['class'] = 'success';
} else {
$ret['php']['ssl']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
$ret['php']['ssl']['class'] = 'danger';
$ret['php']['ssl']['failed'] = true;
$ret['php']['ssl']['remark'] = '没有启用OpenSSL, 将无法访问公众平台的接口, 系统无法正常运行. <a target="_blank" href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58109">详情</a>';
}
$ret['php']['gd']['ok'] = extension_loaded('gd');
if($ret['php']['gd']['ok']) {
$ret['php']['gd']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
$ret['php']['gd']['class'] = 'success';
} else {
$ret['php']['gd']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
$ret['php']['gd']['class'] = 'danger';
$ret['php']['gd']['failed'] = true;
$ret['php']['gd']['remark'] = '没有启用GD, 将无法正常上传和压缩图片, 系统无法正常运行. <a target="_blank" href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58110">详情</a>';
}
$ret['php']['dom']['ok'] = class_exists('DOMDocument');
if($ret['php']['dom']['ok']) {
$ret['php']['dom']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
$ret['php']['dom']['class'] = 'success';
} else {
$ret['php']['dom']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
$ret['php']['dom']['class'] = 'danger';
$ret['php']['dom']['failed'] = true;
$ret['php']['dom']['remark'] = '没有启用DOMDocument, 将无法正常安装使用模块, 系统无法正常运行. <a target="_blank" href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58111">详情</a>';
}
$ret['php']['session']['ok'] = ini_get('session.auto_start');
if($ret['php']['session']['ok'] == 0 || strtolower($ret['php']['session']['ok']) == 'off') {
$ret['php']['session']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
$ret['php']['session']['class'] = 'success';
} else {
$ret['php']['session']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
$ret['php']['session']['class'] = 'danger';
$ret['php']['session']['failed'] = true;
$ret['php']['session']['remark'] = '系统session.auto_start开启, 将无法正常注册会员, 系统无法正常运行. <a target="_blank" href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58111">详情</a>';
}
$ret['php']['asp_tags']['ok'] = ini_get('asp_tags');
if(empty($ret['php']['asp_tags']['ok']) || strtolower($ret['php']['asp_tags']['ok']) == 'off') {
$ret['php']['asp_tags']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
$ret['php']['asp_tags']['class'] = 'success';
} else {
$ret['php']['asp_tags']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
$ret['php']['asp_tags']['class'] = 'danger';
$ret['php']['asp_tags']['failed'] = true;
$ret['php']['asp_tags']['remark'] = '请禁用可以使用ASP 风格的标志,配置php.ini中asp_tags = Off';
}
$ret['write']['root']['ok'] = local_writeable(IA_ROOT . '/');
if($ret['write']['root']['ok']) {
$ret['write']['root']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
$ret['write']['root']['class'] = 'success';
} else {
$ret['write']['root']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
$ret['write']['root']['class'] = 'danger';
$ret['write']['root']['failed'] = true;
$ret['write']['root']['remark'] = '本地目录无法写入, 将无法使用自动更新功能, 系统无法正常运行. <a href="http://bbs.we7.cc/">详情</a>';
}
$ret['write']['data']['ok'] = local_writeable(IA_ROOT . '/data');
if($ret['write']['data']['ok']) {
$ret['write']['data']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
$ret['write']['data']['class'] = 'success';
} else {
$ret['write']['data']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
$ret['write']['data']['class'] = 'danger';
$ret['write']['data']['failed'] = true;
$ret['write']['data']['remark'] = 'data目录无法写入, 将无法写入配置文件, 系统无法正常安装. ';
}
$ret['continue'] = true;
foreach($ret['php'] as $opt) {
if($opt['failed']) {
$ret['continue'] = false;
break;
}
}
if($ret['write']['failed']) {
$ret['continue'] = false;
}
tpl_install_env($ret);
}
if($action == 'db') {
if($ispost) {
if($_POST['do'] != 'continue') {
setcookie('action', 'env');
header('location: ?refresh');
exit();
}
$family = $_POST['family'] == 'x' ? 'x' : 'v';
$db = $_POST['db'];
$user = $_POST['user'];
try {
$pieces = explode(':', $db['server']);
$db['server'] = $pieces[0];
$db['port'] = !empty($pieces[1]) ? $pieces[1] : '3306';
$link = new PDO("mysql:host={$db['server']};port={$db['port']}", $db['username'], $db['password']); // dns可以没有dbname
$link->exec("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary");
$link->exec("SET sql_mode=''");
if ($link->errorCode() != '00000') {
$errorInfo = $link->errorInfo();
$error = $errorInfo[2];
} else {
$statement = $link->query("SHOW DATABASES LIKE '{$db['name']}';");
$fetch = $statement->fetch();
if (empty($fetch)){
if (substr($link->getAttribute(PDO::ATTR_SERVER_VERSION), 0, 3) > '4.1') {
$link->query("CREATE DATABASE IF NOT EXISTS `{$db['name']}` DEFAULT CHARACTER SET utf8");
} else {
$link->query("CREATE DATABASE IF NOT EXISTS `{$db['name']}`");
}
}
$statement = $link->query("SHOW DATABASES LIKE '{$db['name']}';");
$fetch = $statement->fetch();
if (empty($fetch)) {
$error .= "数据库不存在且创建数据库失败. <br />";
}
if ($link->errorCode() != '00000') {
$errorInfo = $link->errorInfo();
$error .= $errorInfo[2];
}
}
} catch (PDOException $e) {
$error = $e->getMessage();
if (strpos($error, 'Access denied for user') !== false) {
$error = '您的数据库访问用户名或是密码错误. <br />';
} else {
$error = iconv('gbk', 'utf8', $error);
}
}
if(empty($error)) {
$link->exec("USE {$db['name']}");
$statement = $link->query("SHOW TABLES LIKE '{$db['prefix']}%';");
if ($statement->fetch()) {
$error = '您的数据库不为空,请重新建立数据库或是清空该数据库或更改表前缀!';
}
}
if(empty($error)) {
$config = local_config();
$cookiepre = local_salt(4) . '_';
$authkey = local_salt(8);
$config = str_replace(array(
'{db-server}', '{db-username}', '{db-password}', '{db-port}', '{db-name}', '{db-tablepre}', '{cookiepre}', '{authkey}', '{attachdir}'
), array(
$db['server'], $db['username'], $db['password'], $db['port'], $db['name'], $db['prefix'], $cookiepre, $authkey, 'attachment'
), $config);
$verfile = IA_ROOT . '/framework/version.inc.php';
$dbfile = IA_ROOT . '/data/db.php';
if($_POST['type'] == 'remote') {
$link = NULL;
$ins = remote_install();
if(empty($ins)) {
die('<script type="text/javascript">alert("连接不到服务器, 请稍后重试!");history.back();</script>');
}
if($ins == 'error') {
die('<script type="text/javascript">alert("版本错误,请确认是否为微擎最新版安装文件!");history.back();</script>');
}
$link = new PDO("mysql:dbname={$db['name']};host={$db['server']};port={$db['port']}", $db['username'], $db['password']);
$link->exec("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary");
$link->exec("SET sql_mode=''");
$tmpfile = IA_ROOT . '/we7source.tmp';
file_put_contents($tmpfile, $ins);
$zip = new ZipArchive;
$res = $zip->open($tmpfile);
if ($res === TRUE) {
$zip->extractTo(IA_ROOT);
$zip->close();
} else {
die('<script type="text/javascript">alert("安装失败,请确认当前目录是否有写入权限!");history.back();</script>');
}
unlink($tmpfile);
}
if(file_exists(IA_ROOT . '/index.php') && is_dir(IA_ROOT . '/web') && file_exists($verfile) && file_exists($dbfile)) {
$dat = require $dbfile;
if(empty($dat) || !is_array($dat)) {
die('<script type="text/javascript">alert("安装包不正确, 数据安装脚本缺失.");history.back();</script>');
}
foreach($dat['schemas'] as $schema) {
$sql = local_create_sql($schema);
local_run($sql);
}
foreach($dat['datas'] as $data) {
local_run($data);
}
} else {
die('<script type="text/javascript">alert("你正在使用本地安装, 但未下载完整安装包, 请从微擎官网下载完整安装包后重试.");history.back();</script>');
}
$salt = local_salt(8);
$password = sha1("{$user['password']}-{$salt}-{$authkey}");
$link->exec("INSERT INTO {$db['prefix']}users (username, password, salt, joindate, groupid) VALUES('{$user['username']}', '{$password}', '{$salt}', '" . time() . "', 1)");
$cookie = array('lastvisit' => '', 'lastip' => '');
$cookie['uid'] = $link->lastInsertId();
$cookie['hash'] = md5($password . $salt);
$session = install_authcode(json_encode($cookie), 'encode', $authkey);
setcookie("{$cookiepre}__session", $session);
local_mkdirs(IA_ROOT . '/data');
file_put_contents(IA_ROOT . '/data/config.php', $config);
touch(IA_ROOT . '/data/install.lock');
// setcookie('action', 'cloud');
setcookie('action', 'finish');
header('location: ?refresh');
exit();
}
}
tpl_install_db($error);
}
if ($action == 'cloud') {
if($ispost) {
setcookie('action', $_POST['do'] == 'continue' ? 'upgrade' : 'db');
header('location: ?refresh');
exit;
}
if (!file_exists(IA_ROOT . '/framework/bootstrap.inc.php')) {
setcookie('action', '');
header('location: ?refresh');
exit;
}
define('IN_SYS', true);
require IA_ROOT . '/framework/bootstrap.inc.php';
require IA_ROOT . '/web/common/bootstrap.sys.inc.php';
load()->model('cloud');
$iframe = cloud_auth_url('profile');
$title = '注册站点';
tpl_install_cloud($iframe . '&' . '__session=' . urlencode($_COOKIE['session']) . '&r=' . time());
}
if ($action == 'upgrade') {
setcookie('action', 'upgrade');
define('IN_SYS', true);
if (!file_exists(IA_ROOT . '/framework/bootstrap.inc.php')) {
setcookie('action', '');
header('location: ?refresh');
exit;
}
require IA_ROOT . '/framework/bootstrap.inc.php';
require IA_ROOT . '/web/common/bootstrap.sys.inc.php';
load()->model('cloud');
if (!empty($_GPC['path']) && $_W['ispost']) {
$ret = cloud_download($_GPC['path'], $_GPC['type']);
if (!is_error($ret)) {
exit('success');
}
exit($ret['message']);
}
if (!empty($_GPC['fname']) && $_W['ispost']) {
$fname = trim($_GPC['fname']);
$entry = IA_ROOT . '/data/update/' . $fname;
if (is_file($entry) && preg_match('/^update\(\d{12}\-\d{12}\)\.php$/', $fname)) {
$evalret = include $entry;
if (!empty($evalret)) {
cache_build_users_struct();
cache_build_setting();
@unlink($entry);
exit('success');
}
}
exit('failed');
}
$m = '';
$packet = cloud_build();
if (empty($packet)) {
$packet = array(
'files' => array(),
'task' => 1,
);
}
$schemas = $packet['schemas'];
$packet['schemas'] = array();
if (!empty($schemas)) {
foreach ($schemas as $schema) {
$packet['schemas'][] = substr($schema['tablename'], 4);
}
}
$scripts = array();
$updatefiles = array();
if (!empty($packet['scripts']) && empty($packet['type'])) {
$updatedir = IA_ROOT . '/data/update/';
load()->func('file');
rmdirs($updatedir, true);
mkdirs($updatedir);
$cversion = IMS_VERSION;
$crelease = IMS_RELEASE_DATE;
foreach ($packet['scripts'] as $script) {
if ($script['release'] <= $crelease) {
continue;
}
$fname = "update({$crelease}-{$script['release']}).php";
$crelease = $script['release'];
$script['script'] = @base64_decode($script['script']);
if (empty($script['script'])) {
$script['script'] = <<<DAT
<?php
load()->model('setting');
setting_upgrade_version('{$packet['family']}', '{$script['version']}', '{$script['release']}');
return true;
DAT;
}
$updatefile = $updatedir . $fname;
file_put_contents($updatefile, $script['script']);
$updatefiles[] = $updatefile;
$s = array_elements(array('message', 'release', 'version'), $script);
$s['fname'] = $fname;
$scripts[] = $s;
}
}
if (!empty($_POST['table']) && $_W['ispost']) {
$tablename = $_POST['table'];
foreach ($schemas as $schema) {
if (substr($schema['tablename'], 4) == $tablename) {
$remote = $schema;
break;
}
}
if (!empty($remote)) {
load()->func('db');
$local = db_table_schema(pdo(), $tablename);
$sqls = db_table_fix_sql($local, $remote);
$error = false;
foreach ($sqls as $sql) {
if (pdo_query($sql) === false) {
$error = true;
$errormsg .= pdo_debug(false);
break;
}
}
if (!$error) {
exit('success');
}
}
exit;
}
tpl_install_upgrade();
exit;
}
if($action == 'finish') {
setcookie('action', '', -10);
$dbfile = IA_ROOT . '/data/db.php';
@unlink($dbfile);
define('IN_SYS', true);
require IA_ROOT . '/framework/bootstrap.inc.php';
require IA_ROOT . '/web/common/bootstrap.sys.inc.php';
$_W['uid'] = $_W['isfounder'] = 1;
load()->web('common');
load()->web('template');
load()->model('setting');
load()->model('cache');
cache_build_frame_menu();
cache_build_setting();
cache_build_users_struct();
cache_build_module_subscribe_type();
tpl_install_finish();
}
function local_writeable($dir) {
$writeable = 0;
if(!is_dir($dir)) {
@mkdir($dir, 0777);
}
if(is_dir($dir)) {
if($fp = fopen("$dir/test.txt", 'w')) {
fclose($fp);
unlink("$dir/test.txt");
$writeable = 1;
} else {
$writeable = 0;
}
}
return $writeable;
}
function local_salt($length = 8) {
$result = '';
while(strlen($result) < $length) {
$result .= sha1(uniqid('', true));
}
return substr($result, 0, $length);
}
function local_config() {
$cfg = <<<EOF
<?php
defined('IN_IA') or exit('Access Denied');
\$config = array();
\$config['db']['master']['host'] = '{db-server}';
\$config['db']['master']['username'] = '{db-username}';
\$config['db']['master']['password'] = '{db-password}';
\$config['db']['master']['port'] = '{db-port}';
\$config['db']['master']['database'] = '{db-name}';
\$config['db']['master']['charset'] = 'utf8';
\$config['db']['master']['pconnect'] = 0;
\$config['db']['master']['tablepre'] = '{db-tablepre}';
\$config['db']['slave_status'] = false;
\$config['db']['slave']['1']['host'] = '';
\$config['db']['slave']['1']['username'] = '';
\$config['db']['slave']['1']['password'] = '';
\$config['db']['slave']['1']['port'] = '3307';
\$config['db']['slave']['1']['database'] = '';
\$config['db']['slave']['1']['charset'] = 'utf8';
\$config['db']['slave']['1']['pconnect'] = 0;
\$config['db']['slave']['1']['tablepre'] = 'ims_';
\$config['db']['slave']['1']['weight'] = 0;
\$config['db']['common']['slave_except_table'] = array('core_sessions');
// -------------------------- CONFIG COOKIE --------------------------- //
\$config['cookie']['pre'] = '{cookiepre}';
\$config['cookie']['domain'] = '';
\$config['cookie']['path'] = '/';
// -------------------------- CONFIG SETTING --------------------------- //
\$config['setting']['charset'] = 'utf-8';
\$config['setting']['cache'] = 'mysql';
\$config['setting']['timezone'] = 'Asia/Shanghai';
\$config['setting']['memory_limit'] = '256M';
\$config['setting']['filemode'] = 0644;
\$config['setting']['authkey'] = '{authkey}';
\$config['setting']['founder'] = '1';
\$config['setting']['development'] = 0;
\$config['setting']['referrer'] = 0;
// -------------------------- CONFIG UPLOAD --------------------------- //
\$config['upload']['image']['extentions'] = array('gif', 'jpg', 'jpeg', 'png');
\$config['upload']['image']['limit'] = 5000;
\$config['upload']['attachdir'] = '{attachdir}';
\$config['upload']['audio']['extentions'] = array('mp3');
\$config['upload']['audio']['limit'] = 5000;
// -------------------------- CONFIG MEMCACHE --------------------------- //
\$config['setting']['memcache']['server'] = '';
\$config['setting']['memcache']['port'] = 11211;
\$config['setting']['memcache']['pconnect'] = 1;
\$config['setting']['memcache']['timeout'] = 30;
\$config['setting']['memcache']['session'] = 1;
// -------------------------- CONFIG PROXY --------------------------- //
\$config['setting']['proxy']['host'] = '';
\$config['setting']['proxy']['auth'] = '';
EOF;
return trim($cfg);
}
function local_mkdirs($path) {
if(!is_dir($path)) {
local_mkdirs(dirname($path));
mkdir($path);
}
return is_dir($path);
}
function local_run($sql) {
global $link, $db;
if(!isset($sql) || empty($sql)) return;
$sql = str_replace("\r", "\n", str_replace(' ims_', ' '.$db['prefix'], $sql));
$sql = str_replace("\r", "\n", str_replace(' `ims_', ' `'.$db['prefix'], $sql));
$ret = array();
$num = 0;
foreach(explode(";\n", trim($sql)) as $query) {
$ret[$num] = '';
$queries = explode("\n", trim($query));
foreach($queries as $query) {
$ret[$num] .= (isset($query[0]) && $query[0] == '#') || (isset($query[1]) && isset($query[1]) && $query[0].$query[1] == '--') ? '' : $query;
}
$num++;
}
unset($sql);
foreach($ret as $query) {
$query = trim($query);
if($query) {
$link->exec($query);
if($link->errorCode() != '00000') {
$errorInfo = $link->errorInfo();
echo $errorInfo[0] . ": " . $errorInfo[2] . "<br />";
exit($query);
}
}
}
}
function local_create_sql($schema) {
$pieces = explode('_', $schema['charset']);
$charset = $pieces[0];
$engine = $schema['engine'];
$sql = "CREATE TABLE IF NOT EXISTS `{$schema['tablename']}` (\n";
foreach ($schema['fields'] as $value) {
if(!empty($value['length'])) {
$length = "({$value['length']})";
} else {
$length = '';
}
$signed = empty($value['signed']) ? ' unsigned' : '';
if(empty($value['null'])) {
$null = ' NOT NULL';
} else {
$null = '';
}
if(isset($value['default'])) {
$default = " DEFAULT '" . $value['default'] . "'";
} else {
$default = '';
}
if($value['increment']) {
$increment = ' AUTO_INCREMENT';
} else {
$increment = '';
}
$sql .= "`{$value['name']}` {$value['type']}{$length}{$signed}{$null}{$default}{$increment},\n";
}
foreach ($schema['indexes'] as $value) {
$fields = implode('`,`', $value['fields']);
if($value['type'] == 'index') {
$sql .= "KEY `{$value['name']}` (`{$fields}`),\n";
}
if($value['type'] == 'unique') {
$sql .= "UNIQUE KEY `{$value['name']}` (`{$fields}`),\n";
}
if($value['type'] == 'primary') {
$sql .= "PRIMARY KEY (`{$fields}`),\n";
}
}
$sql = rtrim($sql);
$sql = rtrim($sql, ',');
$sql .= "\n) ENGINE=$engine DEFAULT CHARSET=$charset;\n\n";
return $sql;
}
function remote_install() {
global $family;
$token = '';
$pars = array();
$pars['host'] = $_SERVER['HTTP_HOST'];
$pars['version'] = '1.0';
$pars['type'] = 'install';
$pars['method'] = 'application.install';
$url = 'http://v2.addons.we7.cc/gateway.php';
$urlset = parse_url($url);
$cloudip = gethostbyname($urlset['host']);
$headers[] = "Host: {$urlset['host']}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $urlset['scheme'] . '://' . $cloudip . $urlset['path']);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($pars, '', '&'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$content = curl_exec($ch);
curl_close($ch);
if (empty($content)) {
return showerror(-1, '获取安装信息失败,可能是由于网络不稳定,请重试。');
}
return $content;
}
function tpl_frame() {
global $action, $actions;
$action = $_COOKIE['action'];
$step = array_search($action, $actions);
$steps = array();
for($i = 0; $i <= $step; $i++) {
if($i == $step) {
$steps[$i] = ' list-group-item-info';
} else {
$steps[$i] = ' list-group-item-success';
}
}
$progress = $step * 25 + 25;
$content = ob_get_contents();
ob_clean();
$tpl = <<<EOF
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>安装系统 - 微擎 - 公众平台自助开源引擎</title>
<link rel="stylesheet" href="//cdn.w7.cc/web/resource/css/wechat/bootstrap.css">
<style>
html,body{font-size:13px;font-family:"Microsoft YaHei UI", "微软雅黑", "宋体";}
.pager li.previous a{margin-right:10px;}
.header a{color:#FFF;}
.header a:hover{color:#428bca;}
.footer{padding:10px;}
.footer a,.footer{color:#eee;font-size:14px;line-height:25px;}
</style>
<!--[if lt IE 9]>
<script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body style="background-color:#28b0e4;">
<div class="container" style="width:1200px;">
<div class="header" style="margin:15px auto;">
<ul class="nav nav-pills pull-right" role="tablist">
<li role="presentation" class="active"><a href="javascript:;">安装微擎系统</a></li>
<li role="presentation"><a href="http://www.w7.cc">微擎官网</a></li>
<li role="presentation"><a href="http://bbs.w7.cc">访问论坛</a></li>
</ul>
<img src="?res=logo" />
</div>
<div class="row well" style="margin:auto 0;">
<div class="col-xs-2" style="padding:0; width:14%;">
<div class="progress" title="安装进度">
<div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" aria-valuenow="{$progress}" aria-valuemin="0" aria-valuemax="100" style="width: {$progress}%;">
{$progress}%
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
安装步骤
</div>
<ul class="list-group">
<a href="javascript:;" class="list-group-item{$steps[0]}"><span class="glyphicon glyphicon-copyright-mark"></span> &nbsp; 许可协议</a>
<a href="javascript:;" class="list-group-item{$steps[1]}"><span class="glyphicon glyphicon-eye-open"></span> &nbsp; 环境监测</a>
<a href="javascript:;" class="list-group-item{$steps[2]}"><span class="glyphicon glyphicon-cog"></span> &nbsp; 参数配置</a>
<a href="javascript:;" class="hidden list-group-item{$steps[3]}"><span class="glyphicon glyphicon-cloud"></span> &nbsp; 注册云服务</a>
<a href="javascript:;" class="hidden list-group-item{$steps[4]}"><span class="glyphicon glyphicon-refresh"></span> &nbsp; 更新到完整版</a>
<a href="javascript:;" class="list-group-item{$steps[5]}"><span class="glyphicon glyphicon-ok"></span> &nbsp; 成功</a>
</ul>
</div>
</div>
<div class="col-xs-10">
{$content}
</div>
</div>
<div class="footer" style="margin:15px auto;">
<div class="text-center">
<a href="http://www.w7.cc">关于微擎</a> &nbsp; &nbsp; <a href="http://bbs.w7.cc">微擎帮助</a> &nbsp; &nbsp; <a href="http://www.w7.cc">购买授权</a>
</div>
<div class="text-center">
Powered by <a href="http://www.w7.cc"><b>微擎</b></a> v2.0.0 &copy; 2014 <a href="http://www.w7.cc">www.w7.cc</a>
</div>
</div>
</div>
<script src="//cdn.w7.cc/web/resource/js/lib/jquery-1.11.1.min.js"></script>
<script src="//cdn.w7.cc/web/resource/js/lib/bootstrap.min.js"></script>
</body>
</html>
EOF;
echo trim($tpl);
}
function tpl_install_license() {
echo <<<EOF
<div class="panel panel-default">
<div class="panel-heading">阅读许可协议</div>
<div class="panel-body" style="overflow-y:scroll;max-height:400px;line-height:20px;">
<h3>版权所有 (c)2014,微擎团队保留所有权利。 </h3>
<p>
感谢您选择微擎 - 微信公众平台自助开源引擎(以下简称WE7,WE7基于 PHP + MySQL的技术开发,全部源码开放。 <br />
为了使你正确并合法的使用本软件,请你在使用前务必阅读清楚下面的协议条款:
</p>
<p>
<strong>一、本授权协议适用且仅适用于微擎系统(We7, MicroEngine. 以下简称微擎)任何版本,微擎官方对本授权协议的最终解释权。</strong>
</p>
<p>
<strong>二、协议许可的权利 </strong>
<ol>
<li>您可以在完全遵守本最终用户授权协议的基础上,将本软件应用于非商业用途,而不必支付软件版权授权费用。</li>
<li>您可以在协议规定的约束和限制范围内修改微擎源代码或界面风格以适应您的网站要求。</li>
<li>您拥有使用本软件构建的网站全部内容所有权,并独立承担与这些内容的相关法律义务。</li>
<li>获得商业授权之后,您可以将本软件应用于商业用途,同时依据所购买的授权类型中确定的技术支持内容,自购买时刻起,在技术支持期限内拥有通过指定的方式获得指定范围内的技术支持服务。商业授权用户享有反映和提出意见的权力,相关意见将被作为首要考虑,但没有一定被采纳的承诺或保证。</li>
</ol>
</p>
<p>
<strong>三、协议规定的约束和限制 </strong>
<ol>
<li>未获商业授权之前,不得将本软件用于商业用途(包括但不限于企业网站、经营性网站、以营利为目的或实现盈利的网站)。</li>
<li>未经官方许可,不得对本软件或与之关联的商业授权进行出租、出售、抵押或发放子许可证。</li>
<li>未经官方许可,禁止在微擎的整体或任何部分基础上以发展任何派生版本、修改版本或第三方版本用于重新分发。</li>
<li>如果您未能遵守本协议的条款,您的授权将被终止,所被许可的权利将被收回,并承担相应法律责任。</li>
</ol>
</p>
<p>
<strong>四、有限担保和免责声明 </strong>
<ol>
<li>本软件及所附带的文件是作为不提供任何明确的或隐含的赔偿或担保的形式提供的。</li>
<li>用户出于自愿而使用本软件,您必须了解使用本软件的风险,在尚未购买产品技术服务之前,我们不承诺对免费用户提供任何形式的技术支持、使用担保,也不承担任何因使用本软件而产生问题的相关责任。</li>
<li>电子文本形式的授权协议如同双方书面签署的协议一样,具有完全的和等同的法律效力。您一旦开始确认本协议并安装 WE7,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的权力的同时,受到相关的约束和限制。协议许可范围以外的行为,将直接违反本授权协议并构成侵权,我们有权随时终止授权,责令停止损害,并保留追究相关责任的权力。</li>
<li>如果本软件带有其它软件的整合API示范例子包,这些文件版权不属于本软件官方,并且这些文件是没经过授权发布的,请参考相关软件的使用许可合法的使用。</li>
</ol>
</p>
</div>
</div>
<form class="form-inline" role="form" method="post">
<ul class="pager">
<li class="pull-left" style="display:block;padding:5px 10px 5px 0;">
<div class="checkbox">
<label>
<input type="checkbox"> 我已经阅读并同意此协议
</label>
</div>
</li>
<li class="previous"><a href="javascript:;" onclick="if(jQuery(':checkbox:checked').length == 1){jQuery('form')[0].submit();}else{alert('您必须同意软件许可协议才能安装!')};">继续 <span class="glyphicon glyphicon-chevron-right"></span></a></li>
</ul>
</form>
EOF;
tpl_frame();
}
function tpl_install_env($ret = array()) {
if(empty($ret['continue'])) {
$continue = '<li class="previous disabled"><a href="javascript:;">请先解决环境问题后继续</a></li>';
} else {
$continue = '<li class="previous"><a href="javascript:;" onclick="$(\'#do\').val(\'continue\');$(\'form\')[0].submit();">继续 <span class="glyphicon glyphicon-chevron-right"></span></a></li>';
}
echo <<<EOF
<div class="panel panel-default">
<div class="panel-heading">服务器信息</div>
<table class="table table-striped">
<tr>
<th style="width:150px;">参数</th>
<th>值</th>
<th></th>
</tr>
<tr class="{$ret['server']['os']['class']}">
<td>服务器操作系统</td>
<td>{$ret['server']['os']['value']}</td>
<td>{$ret['server']['os']['remark']}</td>
</tr>
<tr class="{$ret['server']['sapi']['class']}">
<td>Web服务器环境</td>
<td>{$ret['server']['sapi']['value']}</td>
<td>{$ret['server']['sapi']['remark']}</td>
</tr>
<tr class="{$ret['server']['php']['class']}">
<td>PHP版本</td>
<td>{$ret['server']['php']['value']}</td>
<td>{$ret['server']['php']['remark']}</td>
</tr>
<tr class="{$ret['server']['dir']['class']}">
<td>程序安装目录</td>
<td>{$ret['server']['dir']['value']}</td>
<td>{$ret['server']['dir']['remark']}</td>
</tr>
<tr class="{$ret['server']['disk']['class']}">
<td>磁盘空间</td>
<td>{$ret['server']['disk']['value']}</td>
<td>{$ret['server']['disk']['remark']}</td>
</tr>
<tr class="{$ret['server']['upload']['class']}">
<td>上传限制</td>
<td>{$ret['server']['upload']['value']}</td>
<td>{$ret['server']['upload']['remark']}</td>
</tr>
</table>
</div>
<div class="alert alert-info">PHP环境要求必须满足下列所有条件,否则系统或系统部份功能将无法使用。</div>
<div class="panel panel-default">
<div class="panel-heading">PHP环境要求</div>
<table class="table table-striped">
<tr>
<th style="width:150px;">选项</th>
<th style="width:180px;">要求</th>
<th style="width:50px;">状态</th>
<th>说明及帮助</th>
</tr>
<tr class="{$ret['php']['version']['class']}">
<td>PHP版本</td>
<td>5.3或者5.3以上</td>
<td>{$ret['php']['version']['value']}</td>
<td>{$ret['php']['version']['remark']}</td>
</tr>
<tr class="{$ret['php']['curl']['class']}">
<td>cURL</td>
<td>支持</td>
<td>{$ret['php']['curl']['value']}</td>
<td>{$ret['php']['curl']['remark']}</td>
</tr>
<tr class="{$ret['php']['pdo']['class']}">
<td>PDO</td>
<td>支持</td>
<td>{$ret['php']['pdo']['value']}</td>
<td>{$ret['php']['pdo']['remark']}</td>
</tr>
<tr class="{$ret['php']['ssl']['class']}">
<td>openSSL</td>
<td>支持</td>
<td>{$ret['php']['ssl']['value']}</td>
<td>{$ret['php']['ssl']['remark']}</td>
</tr>
<tr class="{$ret['php']['gd']['class']}">
<td>GD2</td>
<td>支持</td>
<td>{$ret['php']['gd']['value']}</td>
<td>{$ret['php']['gd']['remark']}</td>
</tr>
<tr class="{$ret['php']['dom']['class']}">
<td>DOM</td>
<td>支持</td>
<td>{$ret['php']['dom']['value']}</td>
<td>{$ret['php']['dom']['remark']}</td>
</tr>
<tr class="{$ret['php']['session']['class']}">
<td>session.auto_start</td>
<td>关闭</td>
<td>{$ret['php']['session']['value']}</td>
<td>{$ret['php']['session']['remark']}</td>
</tr>
<tr class="{$ret['php']['asp_tags']['class']}">
<td>asp_tags</td>
<td>关闭</td>
<td>{$ret['php']['asp_tags']['value']}</td>
<td>{$ret['php']['asp_tags']['remark']}</td>
</tr>
</table>
</div>
<div class="alert alert-info">系统要求微擎整个安装目录必须可写, 才能使用微擎所有功能。</div>
<div class="panel panel-default">
<div class="panel-heading">目录权限监测</div>
<table class="table table-striped">
<tr>
<th style="width:150px;">目录</th>
<th style="width:180px;">要求</th>
<th style="width:50px;">状态</th>
<th>说明及帮助</th>
</tr>
<tr class="{$ret['write']['root']['class']}">
<td>/</td>
<td>整目录可写</td>
<td>{$ret['write']['root']['value']}</td>
<td>{$ret['write']['root']['remark']}</td>
</tr>
<tr class="{$ret['write']['data']['class']}">
<td>/</td>
<td>data目录可写</td>
<td>{$ret['write']['data']['value']}</td>
<td>{$ret['write']['data']['remark']}</td>
</tr>
</table>
</div>
<form class="form-inline" role="form" method="post">
<input type="hidden" name="do" id="do" />
<ul class="pager">
<li class="previous"><a href="javascript:;" onclick="$('#do').val('back');$('form')[0].submit();"><span class="glyphicon glyphicon-chevron-left"></span> 返回</a></li>
{$continue}
</ul>
</form>
EOF;
tpl_frame();
}
function tpl_install_db($error = '') {
if(!empty($error)) {
$message = '<div class="alert alert-danger">发生错误: ' . $error . '</div>';
}
$insTypes = array();
if(file_exists(IA_ROOT . '/index.php') && is_dir(IA_ROOT . '/app') && is_dir(IA_ROOT . '/web')) {
$insTypes['local'] = ' checked="checked"';
} else {
$insTypes['remote'] = ' checked="checked"';
}
if (!empty($_POST['type'])) {
$insTypes = array();
$insTypes[$_POST['type']] = ' checked="checked"';
}
$disabled = empty($insTypes['local']) ? ' disabled="disabled"' : '';
echo <<<EOF
{$message}
<form class="form-horizontal" method="post" role="form">
<div class="panel panel-default">
<div class="panel-heading">安装选项</div>
<div class="panel-body">
<div class="form-group">
<label class="col-sm-2 control-label">安装方式</label>
<div class="col-sm-10">
<label class="radio-inline hidden">
<input type="radio" name="type" value="remote"{$insTypes['remote']}> 在线安装
</label>
<label class="radio-inline">
<input type="radio" name="type" value="local"{$insTypes['local']}{$disabled}> 离线安装
</label>
<div class="help-block hidden">
<span style="color:red">由于在线安装是精简版,安装后,请务必注册云服务更新到完整版</span> <br/>
在线安装能够直接安装最新版本微擎系统, 如果在线安装困难, 请下载离线安装包后使用本地安装. <br/>
离线安装包可能不是最新程序, 如果你不确定, 可以现在访问官网重新下载一份最新的.
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">数据库选项</div>
<div class="panel-body">
<div class="form-group">
<label class="col-sm-2 control-label">数据库主机</label>
<div class="col-sm-4">
<input class="form-control" type="text" name="db[server]" value="127.0.0.1">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">数据库用户</label>
<div class="col-sm-4">
<input class="form-control" type="text" name="db[username]" value="root">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">数据库密码</label>
<div class="col-sm-4">
<input class="form-control" type="text" name="db[password]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">表前缀</label>
<div class="col-sm-4">
<input class="form-control" type="text" name="db[prefix]" value="ims_">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">数据库名称</label>
<div class="col-sm-4">
<input class="form-control" type="text" name="db[name]" value="we7">
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">管理选项</div>
<div class="panel-body">
<div class="form-group">
<label class="col-sm-2 control-label">管理员账号</label>
<div class="col-sm-4">
<input class="form-control" type="username" name="user[username]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">管理员密码</label>
<div class="col-sm-4">
<input class="form-control" type="password" name="user[password]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">确认密码</label>
<div class="col-sm-4">
<input class="form-control" type="password"">
</div>
</div>
</div>
</div>
<input type="hidden" name="do" id="do" />
<ul class="pager">
<li class="previous"><a href="javascript:;" onclick="$('#do').val('back');$('form')[0].submit();"><span class="glyphicon glyphicon-chevron-left"></span> 返回</a></li>
<li class="previous"><a href="javascript:;" onclick="if(check(this)){jQuery('#do').val('continue');if($('input[name=type]:checked').val() == 'remote'){alert('在线安装时,安装程序会下载精简版快速完成安装,完成后请务必注册云服务更新到完整版。')}$('form')[0].submit();}">继续 <span class="glyphicon glyphicon-chevron-right"></span></a></li>
</ul>
</form>
<script>
var lock = false;
function check(obj) {
if(lock) {
return;
}
$('.form-control').parent().parent().removeClass('has-error');
var error = false;
$('.form-control').each(function(){
if($(this).val() == '') {
$(this).parent().parent().addClass('has-error');
this.focus();
error = true;
}
});
if(error) {
alert('请检查未填项');
return false;
}
if($(':password').eq(0).val() != $(':password').eq(1).val()) {
$(':password').parent().parent().addClass('has-error');
alert('确认密码不正确.');
return false;
}
lock = true;
$(obj).parent().addClass('disabled');
$(obj).html('正在执行安装');
return true;
}
</script>
EOF;
tpl_frame();
}
function tpl_install_cloud($iframe) {
echo <<<EOF
<iframe src="{$iframe}" onload="" marginheight="0" marginwidth="0" frameborder="0" width="960px" style="height:1500px;" scrolling="no" allowTransparency="true"></iframe>
<form class="form-inline" role="form" method="post">
<input type="hidden" name="do" id="do" />
<ul class="pager">
<li class="previous"><a href="javascript:;" onclick="jQuery('#do').val('continue');$('form')[0].submit();"><span class="glyphicon glyphicon-chevron-right"></span> 继续</a></li>
</ul>
</form>
EOF;
tpl_frame();
}
function tpl_install_upgrade($iframe) {
global $packet, $scripts;
echo <<<EOF
<link href="./web/resource/css/common.css?v=20170719" rel="stylesheet">
<script type="text/javascript">
window.sysinfo = {
'siteroot': '{$_W['siteroot']}',
'siteurl': '{$_W['siteurl']}',
'cookie' : {'pre': '{$_W['config']['cookie']['pre']}'},
'server' : {'php' : ''},
};
</script>
<script type="text/javascript" src="./web/resource/js/lib/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="./web/resource/js/lib/bootstrap.min.js"></script>
<script type="text/javascript" src="./web/resource/js/app/util.js?v=20170719"></script>
<script type="text/javascript" src="./web/resource/js/app/common.min.js?v=20170719"></script>
EOF;
?>
<script type="text/javascript">
<!--
var packet = <?php echo ($packet ? json_encode($packet) : 'null'); ?>;
angular.module('cloudApp');
angular.module('cloudApp')
.controller('FileProcessorCtrl', function($scope, $http, config) {
$scope.files = config.files;
$scope.fails = [];
var total = $scope.files.length;
var i = 1;
var errormsg = '';
var tasknum = config.tasknum && config.type != '' ? config.tasknum : 1;
if (tasknum > total) {
tasknum = 1;
}
var proc = function() {
var path = $scope.files.pop();
if(!path && i >= total) {
if ($scope.fails && $scope.fails.length > 0) {
util.message('文件同步失败,可能是目录权限问题,请重试同步成功后继续。', './install.php?step=upgrade', 'info');
} else {
util.message('文件同步完成,正在处理数据同步......', './install.php?step=upgrade&type=schemas', 'success');
}
return;
}
$scope.file = path;
$scope.pragress = i + '/' + total;
var params = {path: path, type : config.type, step : 'upgrade'};
$http.post(location.href, params).success(function(dat){
i++;
if(dat != 'success') {
$scope.fails.push('['+dat+'] ' + path);
errormsg = dat;
}
proc();
}).error(function(){
i++;
$scope.fails.push(path);
proc();
});
}
for (j = 0; j < tasknum; j++) {
proc();
}
})
.controller('SchemasProcessorCtrl', function($scope, $http, config){
if (packet && (packet.files.length > 0)) {
util.message('请先完成文件同步', './install.php?step=upgrade&type=files');
return false;
}
$scope.schemas = config.schemas;
$scope.fails = [];
var is_m_install = config.is_module_install;
var total = $scope.schemas.length;
var i = 1;
var error = function() {
util.message('未能成功执行处理数据库, 请联系开发商解决. ');
}
var proc = function() {
var schema = $scope.schemas.pop();
if(!schema) {
if($scope.fails.length > 0) {
error();
return;
} else {
util.message('数据库同步完成,正在处理升级脚本......', './install.php?step=upgrade&type=scripts', 'success');
return;
}
}
$scope.schema = schema;
$scope.pragress = i + '/' + total;
var params = {table: schema};
$http.post(location.href, params).success(function(dat){
i++;
if(dat != 'success') {
$scope.fails.push(schema)
}
if (dat['message']) {
util.message(dat['message']);
return;
}
proc();
}).error(function(){
i++;
$scope.fails.push(schema);
proc();
});
}
proc();
})
.controller('CloudDiagnoseCtrl', ['$scope', '$http', 'config', function($scope, $http, config){
$scope.showToken = function() {
util.message('Token:' + $('#token').val(), '', 'info');
};
$('.js-checkip p').each(function(){
var $this = $(this);
$.getJSON('./index.php?c=cloud&a=diagnose&do=testapi&ip='+$this.find('#serverdnsip').html(), function(testdata) {
$this.find('#checkresult').html(testdata.message.message);
});
});
$.ajax({
type : "get",
data : {'date' : config.date, 'version' : config.version, 'siteurl' : config.siteurl},
url : "https://v2.addons.we7.cc/web/index.php?c=site&a=diagnose&jsonpcallback=?",
dataType : "jsonp",
success : function(data){
if (data['check_time']['errno'] == '0') {
$('#check-time').html('<i class="fa fa-check text-success"></i> 正常');
} else {
$('#check-time').html('<i class="fa fa-remove text-warning"></i> 异常,当前时间为:'+data['check_time']['message']['localtime']+"; 服务器时间为:"+data['check_time']['message']['servertime']);
}
if (data['check_touch']['errno'] == '0') {
$('#check-touch').html('<i class="fa fa-check text-success"></i> 正常');
} else {
$('#check-touch').html('<i class="fa fa-remove text-warning"></i> 异常,'+data['check_touch']['message']);
}
},
error:function(){
alert('fail');
}
});
}]).controller('processor', function($scope, $http){
if (packet && (packet.files.length > 0 || packet.files.schemas > 0)) {
util.message('请先完成文件或是数据库同步', './index.php?c=cloud&a=upgrade');
return false;
}
$scope.scripts = <?php echo $scripts ? json_encode($scripts) : '[]'; ?>;
$scope.fails = [];
var total = $scope.scripts.length;
var i = 1;
var error = function() {
util.message('未能成功执行清理升级操作, 请联系开发者. ');
}
var proc = function() {
var script = $scope.scripts ? $scope.scripts.shift() : {};
if(!script) {
if($scope.fails.length > 0) {
error();
} else {
util.message('升级完成.', './install.php?step=finish', 'success');
return;
}
}
$scope.script = script.fname;
$scope.message = script.message;
$scope.pragress = i + '/' + total;
var params = {fname: script.fname};
$http.post(location.href, params).success(function(dat){
i++;
if(dat != 'success') {
$scope.fails.push(script.fname)
error();
return;
}
proc();
}).error(function(){
i++;
$scope.fails.push(script.fname);
error();
});
}
proc();
});
//-->
</script>
<?php
if (empty($_GET['type']) || $_GET['type'] == 'files') {
echo <<<EOF
<div class="clearfix js-processor">
<div class="alert alert-warning">
正在更新系统文件, 请不要关闭窗口.
</div>
<div class="alert alert-warning">
如果下载文件失败,可能造成的原因:写入失败,请仔细检查写入权限是否正确。
</div>
<div class="alert alert-info form-horizontal ng-cloak" ng-controller="FileProcessorCtrl">
<dl class="dl-horizontal">
<dt>整体进度</dt>
<dd>{{pragress}}</dd>
<dt>正在下载文件</dt>
<dd>{{file}}</dd>
</dl>
<dl class="dl-horizontal" ng-show="fails.length > 0">
<dt>下载失败的文件</dt>
<dd>
<p class="text-danger" ng-repeat="file in fails" style="margin:0;">{{file}}</p>
</dd>
</dl>
</div>
<script type="text/javascript">
angular.module('cloudApp').value('config', {
files : packet['files'],
type : '{$type}',
account_type : "{$_GPC['account_type']}",
tasknum : '{$packet['task']}',
});
angular.bootstrap($('.js-processor'), ['cloudApp']);
</script>
</div>
EOF;
} elseif ($_GET['type'] == 'schemas') {
echo <<<EOF
<div class="clearfix js-processor">
<div class="alert alert-warning">
正在更新数据库, 请不要关闭窗口.
</div>
<div class="alert alert-info form-horizontal ng-cloak" ng-controller="SchemasProcessorCtrl">
<dl class="dl-horizontal">
<dt>整体进度</dt>
<dd>{{pragress}}</dd>
<dt>正在处理数据表</dt>
<dd>{{schema}}</dd>
</dl>
<dl class="dl-horizontal" ng-show="fails.length > 0">
<dt>处理失败的数据表</dt>
<dd>
<p class="text-danger" ng-repeat="schema in fails" style="margin:0;">{{schema}}</p>
</dd>
</dl>
</div>
<script type="text/javascript">
angular.module('cloudApp').value('config', {
schemas : packet['schemas'],
});
angular.bootstrap($('.js-processor'), ['cloudApp']);
</script>
</div>
EOF;
} elseif ($_GET['type'] == 'scripts') {
echo <<<EOF
<div class="clearfix js-processor">
<div class="alert alert-warning">
正在数据迁移及清理操作, 请不要关闭窗口.
</div>
<div class="alert alert-info form-horizontal ng-cloak" ng-controller="processor">
<dl class="dl-horizontal">
<dt>整体进度</dt>
<dd>{{pragress}}</dd>
<dt>正在处理</dt>
<dd>{{script}}<br />{{message}}</dd>
</dl>
<dl class="dl-horizontal" ng-show="fails.length > 0">
<dt>处理失败的操作</dt>
<dd>
<p class="text-danger" ng-repeat="script in fails" style="margin:0;">{{script}}</p>
</dd>
</dl>
</div>
<script>
angular.bootstrap($('.js-processor'), ['cloudApp']);
</script>
</div>
EOF;
}
tpl_frame();
}
function tpl_install_finish() {
$modules = get_store_module();
$themes = get_store_theme();
echo <<<EOF
<div class="page-header"><h3>安装完成</h3></div>
<div class="alert alert-success">
恭喜您!已成功安装“微擎 - 公众平台自助开源引擎”系统,您现在可以: <a target="_blank" class="btn btn-success" href="">访问网站首页</a>
</div>
<div class="form-group hidden">
<h5><strong>微擎应用商城</strong></h5>
<span class="help-block">应用商城特意为您推荐了一批优秀模块、主题,赶紧来安装几个吧!</span>
<table class="table table-bordered">
<tbody>
{$modules}
{$themes}
</tbody>
</table>
</div>
<div class="alert alert-warning">
我们强烈建议您立即注册云服务,享受“在线更新”等云服务。
<a target="_blank" class="btn btn-success" href="./web/index.php?c=cloud&a=profile">马上去注册</a>
<a target="_blank" class="btn btn-success" href="http://s.w7.cc" target="_blank">访问应用商城首页</a>
</div>
EOF;
tpl_frame();
}
function tpl_resources() {
static $res = array(
'logo' => 'iVBORw0KGgoAAAANSUhEUgAAAaQAAABfCAYAAACnbrNbAAAACXBIWXMAAC4jAAAuIwF4pT92AAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt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qbNM9rR8V1EMp8Yv3dEe4I2QVIxi3dEG6X4EZEy6+4g/vySG475yTclzMRuoWWst7QIZC28dhwPYzL/RZWQv5gKbKzYdJv2QKpBPJmpU1hNvY7isfm8QjPmF/h8HWAAm70+yyJS5AX8NV1lE+hbKSPzdGB8unnsVPLFwll3o4hOL5ga6sHzGrjZjC+2MoojcyhiNfLZ61tao7fTx5MtOEyS5PN404cJw/bHpi9d55lheA81p7rsZZdzJ1pGYAPWZmYl4PfNQtmgrcpa49n8Puow9ph5QzfR1pDnBBoXysCbphKiJcfTxJIy/m9kNVnXkN0dypgFnimM0CfATNZ3YQHnsqOPloJxlVsZ8UOto/1gfbRMlAmxX/bymU9ob4+zPD3SDRjQU1WfVVCaWbsqHzORyuYebFT2EopQtmIWcqgj21CZvOKM1Aa+fsVj0cbA4rcL2DmiM5mhXhK4HdeB3l+0EUvmGCtFLfhwTgMSRERFEVRFOVQk6dVoCiKoqhAUhRFURQVSIqiKIoKJEVRFEVRgaQoiqKoQFIURVEUFUiKoiiKCiRFURRFUYGkKIqiqEBSFEVRFBVIiqIoigokRVEURVGBpCiKoqhAUhRFURQVSIqiKIoKJEVRFEVRgaQoiqIcDvzfAOi6dmYBSbinAAAAAElFTkSuQmCC',
);
return $res;
}
function showerror($errno, $message = '') {
return array(
'errno' => $errno,
'error' => $message,
);
}
function get_store_module() {
load()->func('communication');
$response = ihttp_request(APP_STORE_API, array('controller' => 'store', 'action' => 'api', 'do' => 'module'));
$response = json_decode($response['content'], true);
$modules = '';
foreach ($response['message'] as $key => $module) {
if ($key % 3 < 1) {
$modules .= '</tr><tr>';
}
$module['detail_link'] = APP_STORE_URL . trim($module['detail_link'], '.');
$modules .= '<td>';
$modules .= '<div class="col-sm-4">';
$modules .= '<a href="' . $module['detail_link'] . '" title="查看详情" target="_blank">';
$modules .= '<img src="' . $module['logo']. '"' . ' width="50" height="50" ' . $module['title'] . '" /></a>';
$modules .= '</div>';
$modules .= '<div class="col-sm-8">';
$modules .= '<p><a href="' . $module['detail_link'] .'" title="查看详情" target="_blank">' . $module['title'] . '</a></p>';
$modules .= '<p>安装量:<span class="text-danger">' . $module['purchases'] . '</span></p>';
$modules .= '</div>';
$modules .= '</td>';
}
$modules = substr($modules, 5) . '</tr>';
return $modules;
}
function get_store_theme() {
load()->func('communication');
$response = ihttp_request(APP_STORE_API, array('controller' => 'store', 'action' => 'api', 'do' => 'theme'));
$response = json_decode($response['content'], true);
$themes = '<tr><td colspan="' . count($response['message']) . '">';
$themes .= '<div class="form-group">';
foreach ($response['message'] as $key => $theme) {
$theme['detail_link'] = APP_STORE_URL . trim($theme['detail_link'], '.');
$themes .= '<div class="col-sm-2" style="padding-left: 7px;margin-right: 25px;">';
$themes .= '<a href="' . $theme['detail_link'] .'" title="查看详情" target="_blank" /><img src="' . $theme['logo']. '" /></a>';
$themes .= '<p></p><p class="text-right">';
$themes .= '<a href="' . $theme['detail_link']. '" title="查看详情" target="_blank">' . $theme['title'] . '</a></p>';
$themes .= '</div>';
}
$themes .= '</div>';
return $themes;
}
function install_authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
$ckey_length = 4;
$key = md5($key != '' ? $key : $GLOBALS['_W']['config']['setting']['authkey']);
$keya = md5(substr($key, 0, 16));
$keyb = md5(substr($key, 16, 16));
$keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length) : substr(md5(microtime()), -$ckey_length)) : '';
$cryptkey = $keya . md5($keya . $keyc);
$key_length = strlen($cryptkey);
$string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0) . substr(md5($string . $keyb), 0, 16) . $string;
$string_length = strlen($string);
$result = '';
$box = range(0, 255);
$rndkey = array();
for ($i = 0; $i <= 255; $i++) {
$rndkey[$i] = ord($cryptkey[$i % $key_length]);
}
for ($j = $i = 0; $i < 256; $i++) {
$j = ($j + $box[$i] + $rndkey[$i]) % 256;
$tmp = $box[$i];
$box[$i] = $box[$j];
$box[$j] = $tmp;
}
for ($a = $j = $i = 0; $i < $string_length; $i++) {
$a = ($a + 1) % 256;
$j = ($j + $box[$a]) % 256;
$tmp = $box[$a];
$box[$a] = $box[$j];
$box[$j] = $tmp;
$result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256]));
}
if ($operation == 'DECODE') {
if ((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26) . $keyb), 0, 16)) {
return substr($result, 26);
} else {
return '';
}
} else {
return $keyc . str_replace('=', '', base64_encode($result));
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/hools/pros.git
git@gitee.com:hools/pros.git
hools
pros
pros
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385