Transpilátor Z Jazyka PHP Do Jazyka Go Student: Lukáš Simulík Vedoucí: Ing

Total Page:16

File Type:pdf, Size:1020Kb

Transpilátor Z Jazyka PHP Do Jazyka Go Student: Lukáš Simulík Vedoucí: Ing ZADÁNÍ BAKALÁŘSKÉ PRÁCE Název: Transpilátor z jazyka PHP do jazyka Go Student: Lukáš Simulík Vedoucí: Ing. Radomír Polách Studijní program: Informatika Studijní obor: Teoretická informatika Katedra: Katedra teoretické informatiky Platnost zadání: Do konce zimního semestru 2021/22 Pokyny pro vypracování Nastudujte jazyky PHP a Go a principy týkající se konstrukce překladačů. Navrhněte, analyzujte a implementujte transpilátor projektů z jazyka PHP do jazyka Go. Transpilátor přeloží veškeré základní řídící konstrukce, standardní operátory, oblasti platnosti proměnných a také další nezbytné konstrukce jazyka PHP a také detekuje těžko přeložitelné konstrukce a upozorní na potřebné ruční úpravy výsledného kódu. Implementovaný transpilátor testujte na jednoduchých projektech. Seznam odborné literatury Dodá vedoucí práce. doc. Ing. Jan Janoušek, Ph.D. doc. RNDr. Ing. Marcel Jiřina, Ph.D. vedoucí katedry děkan V Praze dne 28. února 2020 Bakal´aˇrsk´apr´ace Transpil´atorz jazyka PHP do jazyka Go Luk´aˇsSimul´ık Katedra teoretick´einformatiky Vedouc´ıpr´ace:Ing. Radom´ırPol´ach 4. ˇcervna2020 Podˇekov´an´ı Dˇekujipanu inˇzen´yrovi Pol´achovi za n´avrhy, jak´ymzp˚usobem pˇrev´adˇet kon- strukce jazyka PHP do Go, a tipy, jak´ymzp˚usobem tento projekt d´alrozˇs´ıˇrit. Rovnˇeˇzdˇekujipanu inˇzen´yrovi Bohusl´avkovi za postˇrehy pˇrirealizaci transpi- l´atorua objeven´ımprojekt˚u,zab´yvaj´ıc´ıse pˇreklademdo jazyka Go. Prohl´aˇsen´ı Prohlaˇsuji,ˇzejsem pˇredloˇzenoupr´acivypracoval samostatnˇea ˇzejsem uvedl veˇsker´epouˇzit´einformaˇcn´ızdroje v souladu s Metodick´ympokynem o dodrˇzo- v´an´ıetick´ych princip˚upˇripˇr´ıpravˇevysokoˇskolsk´ych z´avˇereˇcn´ych prac´ı. Beru na vˇedom´ı,ˇzese na moji pr´acivztahuj´ıpr´ava a povinnosti vypl´yvaj´ıc´ı ze z´akona ˇc.121/2000 Sb., autorsk´ehoz´akona, ve znˇen´ıpozdˇejˇs´ıch pˇredpis˚u. V souladu s ust. § 2373 odst. 2 z´akona ˇc.89/2012 Sb., obˇcansk´yz´akon´ık,ve znˇen´ıpozdˇejˇs´ıch pˇredpis˚u,t´ımto udˇelujinev´yhradn´ıopr´avnˇen´ı(licenci) k uˇzit´ı t´etomoj´ıpr´ace,a to vˇcetnˇevˇsech poˇc´ıtaˇcov´ych program˚u,jeˇzjsou jej´ısouˇc´ast´ı ˇcipˇr´ılohoua veˇsker´ejejich dokumentace (d´alesouhrnnˇejen D´ılo“), a to vˇsem ” osob´am,kter´esi pˇrej´ıD´ılouˇz´ıt.Tyto osoby jsou opr´avnˇeny D´ılouˇz´ıtjak´ymkoli zp˚usobem, kter´ynesniˇzujehodnotu D´ılaa za jak´ymkoli ´uˇcelem(vˇcetnˇeuˇzit´ı k v´ydˇeleˇcn´ym´uˇcel˚um).Toto opr´avnˇen´ıje ˇcasovˇe,teritori´alnˇei mnoˇzstevnˇe neomezen´e.Kaˇzd´aosoba, kter´avyuˇzijev´yˇseuvedenou licenci, se vˇsakzava- zuje udˇelitke kaˇzd´emu d´ılu, kter´evznikne (byt’ jen zˇc´asti)na z´akladˇeD´ıla, ´upravou D´ıla,spojen´ımD´ılas jin´ymd´ılem,zaˇrazen´ımD´ıla do d´ılasouborn´eho ˇcizpracov´an´ımD´ıla(vˇcetnˇepˇrekladu)licenci alespoˇnve v´yˇseuveden´em roz- sahu a z´aroveˇnzpˇr´ıstupnitzdrojov´yk´odtakov´ehod´ılaalespoˇnsrovnateln´ym zp˚usobem a ve srovnateln´em rozsahu, jako je zpˇr´ıstupnˇenzdrojov´yk´odD´ıla. V Praze dne 4. ˇcervna2020 . .. .. .. .. .. .. Cesk´evysok´euˇcen´ıtechnick´evˇ Praze Fakulta informaˇcn´ıch technologi´ı © 2020 Luk´aˇsSimul´ık.Vˇsechna pr´ava vyhrazena. Tato pr´ace vznikla jako ˇskoln´ı d´ılo na Cesk´emvysok´emuˇcen´ıˇ technick´em v Praze, Fakultˇeinformaˇcn´ıch technologi´ı.Pr´ace je chr´anˇenapr´avn´ımipˇredpisy a mezin´arodn´ımi´umluvamio pr´avuautorsk´ema pr´avech souvisej´ıc´ıchs pr´avem autorsk´ym.K jej´ımuuˇzit´ı,s v´yjimkoubez´uplatn´ychz´akonn´ychlicenc´ıa nad r´amec opr´avnˇen´ıuveden´ychv Prohl´aˇsen´ına pˇredchoz´ıstranˇe,je nezbytn´ysou- hlas autora. Odkaz na tuto pr´aci Simul´ık,Luk´aˇs. Transpil´atorz jazyka PHP do jazyka Go. Bakal´aˇrsk´apr´ace. Praha: Cesk´evysok´euˇcen´ıtechnick´evˇ Praze, Fakulta informaˇcn´ıch techno- logi´ı,2020. Abstrakt Pr´acese zab´yv´atvorbou programu, kter´ypˇrev´ad´ıprojekty pro skriptovac´ıja- zyk PHP do jazyka Go. Popisuje historii PHP a jeho v´yvoj, rozeb´ır´azp˚usoby, kter´ymilze k´odpˇrev´adˇet a zrychlovat. Popisuje jiˇzexistuj´ıc´ıprojekty zab´yvaj´ı- c´ıse touto problematikou. Zahrnuje popis konstrukce kompil´atorua jeho jed- notliv´eˇc´asti.Popisuje realizaci n´astroje, zp˚usoby testov´an´ı,a srovn´av´av´ykon p˚uvodn´ıhoˇreˇsen´ıs nov´ym,pˇreloˇzen´ym.Analyzuj´ıse zp˚usoby, jak´ymiˇslojed- notliv´ekonstrukce zdrojov´ehojazyka pˇrev´estdo c´ılov´eho. Kl´ıˇcov´a slova transpil´ator,jazyk Go, jazyk PHP, kompilovan´yjazyk, dy- namick´yjazyk, webov´atechnologie Abstract The thesis deals with the creation of a program which converts projects for the PHP scripting language into the Go language. Describes the history of PHP and its development, discusses ways how to convert and speed up code. Describes existing projects dealing with this issue. Includes a description of the compiler design and its individual parts. Describes implementation of the tool, methods of testing, and compares the performance of the original vii solution with the translated one. Methods how the individual constructions could be translated were analyzed. Keywords transpiler, Go language, PHP language, compiled language, dy- namic language, web technology viii Obsah Uvod´ 1 1 PHP 3 1.1 Historie WWW . 3 1.2 Historie PHP . 4 2 Zp˚usoby zrychlov´an´ı k´odu 5 2.1 Transpilace . 5 2.2 Jin´yinterpret . 6 2.3 JIT kompil´ator . 6 3 Projekty zabyvaj´ ´ıc´ı se upravou´ PHP 7 3.1 Phalanger . 7 3.1.1 PeachPie . 8 3.2 P9 . 9 3.3 Project Zero . 9 3.4 Quercus . 10 3.5 HipHop Compiler for PHP . 10 3.6 HipHop Virtual Machine . 11 3.7 Hack . 13 3.8 PHP 7.1. 13 4 Konstrukce kompil´atoru 17 4.1 Lexik´aln´ıanal´yza . 18 4.2 Syntaktick´aanal´yza . 19 5 Realizace 21 5.1 Poˇzadavky . 21 5.2 Lexik´aln´ıa syntaktick´aanal´yzaPHP . 22 5.3 Struktura . 22 ix 5.4 Konflikty v n´azvech . 23 5.4.1 Promˇenn´e. 24 5.4.2 Funkce . 24 5.4.3 N´avˇest´ı . 24 5.5 Rozsah platnosti promˇenn´e . 24 5.6 Vedlejˇs´ıefekty pˇr´ıkaz˚u. 26 5.7 Break a continue . 27 5.8 Asociativn´ıpole . 27 5.9 Glob´aln´ıpromˇenn´e . 28 5.10 Funkce a promˇenn´ypoˇcetargument˚u. 28 5.11 Vkl´ad´an´ıskript˚u . 29 5.12 SQL . 29 5.13 Generov´an´ık´odu . 31 5.14 Testov´an´ıa porovn´av´an´ıv´ykonu . 31 5.14.1 Testov´an´ı . 31 5.14.2 Porovn´av´an´ıv´ykonu . 32 Z´avˇer 35 Bibliografie 37 A Seznam pouˇzitych´ zkratek 41 B Obsah pˇriloˇzen´eho CD 43 x Seznam obr´azk˚u 3.1 Zlepˇsen´ıpoˇct˚upoˇzadavk˚uza sekundu a ˇcasodezvy napˇr´ıˇcverzemi PHP [5] . 14 3.2 Porovn´an´ıPHP 7.0 a HHVM 3.10.1 [28] . 15 4.1 Struktura kompil´atoru[31] . 17 5.1 Pˇr´ıkladneoˇcek´avan´ehochov´an´ı . 26 5.2 SQL pˇripojen´ıv PHP s definovan´ymn´avratov´ymtypem . 30 5.3 Skript pouˇzit´ypro porovn´av´an´ıˇcasu . 32 xi Uvod´ Transpilace je procesem, ve kter´emse pˇrev´ad´ı zdrojov´yk´odz jednoho do druh´eho.Jde o ud´alostve svˇetˇeinternetov´ych technologi´ıvelmi rozˇs´ıˇrenou. Jde rozdˇelitdo dvou kategori´ı,podle m´ıstapouˇzit´ı. Prvn´ı z nich souvis´ı se zobrazov´an´ım na stranˇeklienta, s internetov´ym prohl´ıˇzeˇcem.M´ıstotoho, aby program´atorpouˇz´ıval jazyk prohl´ıˇzeˇce, pracuje s jin´ym,kter´ym´avˇetˇs´ımoˇznosti,lepˇs´ıstrukturu, kratˇs´ımz´apisem,nebo ob- sahuje konstrukce zn´am´ez jin´ych jazyk˚u. Castoˇ si jsou oba jazyky velmi podobn´e, nov´ynˇejak´ymzp˚usobem vych´az´ı z p˚uvodn´ıho. Toto rozhodnut´ı pouˇz´ıvat jinou technologii s sebou nese probl´emv podobˇenutnosti k´odpˇrekl´a- dat do oˇcek´avan´epodoby. Nemus´ıj´ıtpouze o rozˇs´ıˇren´ımoˇznost´ıjazyka po- moc´ınov´ehodialektu, jde i o zpˇetnoukompatibilitu. Jazyky se vyv´ıjej´ı,ale ne vˇsechni pouˇz´ıvaj´ınejnovˇejˇs´ıprohl´ıˇzeˇce. Druh´akategorie souvis´ıse stranou serveru a tou se bude zab´yvat i tato pr´ace.Jedny z nejrozˇs´ıˇrenˇejˇs´ıch jazyk˚uv t´etooblasti maj´ıdvˇev´yznamn´evlast- nosti. Je velmi jednoduch´ev nich program napsat a zmˇenu jde okamˇzitˇevidˇet, protoˇzejsou interpretovan´e.To s sebou nese dvˇenev´yhody. Kv˚uliinterpretu nejsou tolik v´ykonn´e,zdroj se totiˇzmus´ıpokaˇzd´epˇrekl´adat.Nejde o jedinou vˇeczpomaluj´ıc´ı bˇeh,jazyky jsou tak´eˇcastovelmi dynamick´e,datov´etypy promˇen´ych se mohou mˇenitkaˇzdouchv´ıli. Tato vlastnost zjednoduˇsujepsan´ı,ale sniˇzuje rychlost bˇehu a zp˚usobuje, ˇzekontrola nad programem je niˇzˇs´ı.Kv˚ulitomu se zvyˇsujeˇsance,ˇzese program nebude chovat tak, jak m´a.Projekt˚una zrychlen´ık´oduvzniklo velk´emnoˇzstv´ı. Nepˇr´ımose zab´yvaj´ıvˇsemiprobl´emy interpretovan´ych jazyk˚u. Tato pr´acese bude zab´yvat skriptovac´ımjazykem PHP. Patˇr´ımezi ty nej- rozˇs´ıˇrenˇejˇs´ıa m´avˇsechny neduhy zm´ınˇen´ev´yˇse.Pr´acese bude kr´atcezab´yvat vznikem tohoto jazyka, ˇc´asteˇcnˇeproto, aby byly obh´ajeny nˇekter´ajeho imple- mentaˇcn´ırozhodnut´ı.Jazyk je kritizov´anpro nˇekter´ejeho vlastnosti, vˇetˇsina z nich je ale d´ana historicky, jeho p˚uvodn´ımz´amˇerem. Dalˇs´ımbodem bude pops´an´ızp˚usob˚u,jak ke zrychlen´ıjazyka m˚uˇzedoj´ıt. 1 Uvod´ Nejd˚uleˇzitˇejˇs´ımze vˇsech bude transpilace, kaˇzd´yprojekt ji v nˇejak´em´ıˇreob- sahuje. Prac´ıˇreˇs´ıc´ıtuto problematiku je hned nˇekolik, nˇekter´ez nich budou zm´ınˇeny zde. U pˇrevodu konstrukc´ıposlouˇz´ıjako inspirace pro implementaci vlastn´ıhoˇreˇsen´ı.Posledn´ımkrokem pˇredrealizac´ıje popis jednotliv´ych ˇc´ast´ı pˇrekladaˇce,coˇzje koncept, kter´ymse cel´apr´acezab´yv´a. C´ılemt´etopr´acebude pˇrev´estvybranou mnoˇzinu konstrukc´ınach´azej´ıc´ı se v jazyce PHP a pˇrev´estje do jazyka Go tak, aby se nezmˇenilv´ysledek, a pokud moˇznovylepˇsilyjeho vlastnosti – rychlost bˇehu programu a ˇcas odezvy, pokud bude spuˇstˇenjako server.
Recommended publications
  • Report on Biodiversity and Tropical Forests in Indonesia
    Report on Biodiversity and Tropical Forests in Indonesia Submitted in accordance with Foreign Assistance Act Sections 118/119 February 20, 2004 Prepared for USAID/Indonesia Jl. Medan Merdeka Selatan No. 3-5 Jakarta 10110 Indonesia Prepared by Steve Rhee, M.E.Sc. Darrell Kitchener, Ph.D. Tim Brown, Ph.D. Reed Merrill, M.Sc. Russ Dilts, Ph.D. Stacey Tighe, Ph.D. Table of Contents Table of Contents............................................................................................................................. i List of Tables .................................................................................................................................. v List of Figures............................................................................................................................... vii Acronyms....................................................................................................................................... ix Executive Summary.................................................................................................................... xvii 1. Introduction............................................................................................................................1- 1 2. Legislative and Institutional Structure Affecting Biological Resources...............................2 - 1 2.1 Government of Indonesia................................................................................................2 - 2 2.1.1 Legislative Basis for Protection and Management of Biodiversity and
    [Show full text]
  • Pfc6168.Pdf (438.8Kb)
    ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA DE TELECOMUNICACIÓN UNIVERSIDAD POLITÉCNICA DE CARTAGENA Proyecto Fin de Carrera TÍTULO: Iphone Bookshelf AUTOR: David Zamora Gutiérrez DIRECTOR: Francesc Burrull i Mestres Febrero / 2015 INDEX IPhone application………………………………………………………………... o Tools……………………………………………………………………… . Iphone…………………………………………………………….. Objective-C……………………………………………………….. o Code………………………………………………………………………. Web site…………………………………………………………………………... o Tools……………………………………………………………………… . Codeigniter……………………………………………………….. Php………………………………………………………………... Http……………………………………………………………….. Html………………………………………………………………. Mysql……………………………………………………………... Apache……………………………………………………………. CSS……………………………………………………………….. E-books…………………………………………………………… o Code………………………………………………………………………. References……………………………………………………………………....... IPHONE APPLICATION TOOLS IPHONE The iPhone is a line of Internet- and multimedia-enabled smartphones designed and marketed by Apple Inc. The first iPhone was unveiled by Apple CEO Steve Jobs on January 9, 2007, and released on June 29, 2007. An iPhone can function as a video camera (video recording was not a standard feature until the iPhone 3GS was released), a camera phone, can send texts and receive visual voicemail, a portable media player, and an Internet client with email and web browsing capabilities, and both Wi-Fi and 3G connectivity. The user interface is built around the device's multi-touch screen, including a virtual keyboard rather than a physical one. Third-party as well as Apple application software is available from the App Store, which launched in mid-2008 and now has over 350,000 "apps" approved by Apple. These apps have diverse functionalities, including games, reference, GPS navigation, social networking, e-books... To create applications for this device it’s use the APPLE SDK. APPLE SDK The SDK basically consists of a set of tools that Apple provides to build, debug and test our developments. It contains the following programs: - XCODE: Xcode is a suite of tools, developed by Apple, for developing software for Mac OS X and iOS.
    [Show full text]
  • Phalanger Compiling PHP for .NET and Silverlight
    Phalanger Compiling PHP for .NET and Silverlight http://php-compiler.net Tomáš Petříček, C# MVP ([email protected]) Formerly by: Tomáš Matoušek, Ladislav Prošek, et al. Agenda Phalanger Introduction What is Phalanger? And what is it good for? Phalanger for Silverlight How (and why) to write Silverlight client apps in PHP .NET and PHP interoperability Calling C# code from PHP Calling PHP code from C# Interesting Compilation Problems Conditional type binding Calling overloaded methods DEMO Let’s look at some cool demo first :-)! http://tomasp.net/files/copter/default.html Introduction . Phalanger: PHP Language Compiler for .NET . Initially targeting .NET Framework 1.1 . Now using .NET 2.0, Mono and Silverlight 2.0 . We’re planning to use (parts of) DLR in the future . What can you do with Phalanger? . Compile various open-source PHP applications for .NET . Use PHP functions & objects from (other) .NET languages . Use .NET classes from PHP programs . Write Silverlight applications in PHP Agenda Phalanger Introduction What is Phalanger? And what is it good for? Phalanger for Silverlight How (and why) to write Silverlight client apps in PHP .NET and PHP interoperability Calling C# code from PHP Calling PHP code from C# Interesting Compilation Problems Conditional type binding Calling overloaded methods Phalanger: PHP for Silverlight . Similar as other Silverlight dynamic languages . XAML file is loaded by Silverlight plugin in the browser . PHP source code referenced using XAML element: <php:PhalangerLoader Source="script.phpx" /> . Downloaded, compiled and executed on the client . “Loader” element, compiler and runtime in one DLL file <Canvas xmlns="http://schemas.microsoft.com/client/2007" xmlns:php="clr-namespace:PHP.Silverlight; assembly=Bin/PhpNetCore.dll" Width="800" Height="600" Background="White"> <php:PhalangerLoader Source="simpledemo_php.phpx" /> </Canvas> Phalanger: PHP for Silverlight .
    [Show full text]
  • Les Possibilités De Dispersion Et Éléments D'habitat-Refuge Dans Un
    Les possibilités de dispersion et éléments d’habitat-refuge dans un paysage d’agriculture intensive fragmenté par un réseau routier dense : le cas de la petite faune dans la plaine du Bas-Rhin Jonathan Jumeau To cite this version: Jonathan Jumeau. Les possibilités de dispersion et éléments d’habitat-refuge dans un paysage d’agriculture intensive fragmenté par un réseau routier dense : le cas de la petite faune dans la plaine du Bas-Rhin. Ecosystèmes. Université de Strasbourg, 2017. Français. NNT : 2017STRAJ120. tel-01768001 HAL Id: tel-01768001 https://tel.archives-ouvertes.fr/tel-01768001 Submitted on 16 Apr 2018 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. UNIVERSITÉ DE STRASBOURG ÉCOLE DOCTORALE 414 UMR7178 – UMR6553 THÈSE présentée par : Jonathan JUMEAU soutenue le : 16 octobre 2017 pour obtenir le grade de : Docteur de l’université de Strasbourg Discipline/ Spécialité : Biologie de la conservation Les possibilités de dispersion et éléments d’habitat-refuge dans un paysage d'agriculture intensive fragmenté par un réseau routier dense : le cas de la petite faune dans la plaine du Bas-Rhin THÈSE dirigée par : Dr. HANDRICH Yves Chargé de recherches, Université de Strasbourg Dr.
    [Show full text]
  • Towards Left Duff S Mdbg Holt Winters Gai Incl Tax Drupal Fapi Icici
    jimportneoneo_clienterrorentitynotfoundrelatedtonoeneo_j_sdn neo_j_traversalcyperneo_jclientpy_neo_neo_jneo_jphpgraphesrelsjshelltraverserwritebatchtransactioneventhandlerbatchinsertereverymangraphenedbgraphdatabaseserviceneo_j_communityjconfigurationjserverstartnodenotintransactionexceptionrest_graphdbneographytransactionfailureexceptionrelationshipentityneo_j_ogmsdnwrappingneoserverbootstrappergraphrepositoryneo_j_graphdbnodeentityembeddedgraphdatabaseneo_jtemplate neo_j_spatialcypher_neo_jneo_j_cyphercypher_querynoe_jcypherneo_jrestclientpy_neoallshortestpathscypher_querieslinkuriousneoclipseexecutionresultbatch_importerwebadmingraphdatabasetimetreegraphawarerelatedtoviacypherqueryrecorelationshiptypespringrestgraphdatabaseflockdbneomodelneo_j_rbshortpathpersistable withindistancegraphdbneo_jneo_j_webadminmiddle_ground_betweenanormcypher materialised handaling hinted finds_nothingbulbsbulbflowrexprorexster cayleygremlintitandborient_dbaurelius tinkerpoptitan_cassandratitan_graph_dbtitan_graphorientdbtitan rexter enough_ram arangotinkerpop_gremlinpyorientlinkset arangodb_graphfoxxodocumentarangodborientjssails_orientdborientgraphexectedbaasbox spark_javarddrddsunpersist asigned aql fetchplanoriento bsonobjectpyspark_rddrddmatrixfactorizationmodelresultiterablemlibpushdownlineage transforamtionspark_rddpairrddreducebykeymappartitionstakeorderedrowmatrixpair_rddblockmanagerlinearregressionwithsgddstreamsencouter fieldtypes spark_dataframejavarddgroupbykeyorg_apache_spark_rddlabeledpointdatabricksaggregatebykeyjavasparkcontextsaveastextfilejavapairdstreamcombinebykeysparkcontext_textfilejavadstreammappartitionswithindexupdatestatebykeyreducebykeyandwindowrepartitioning
    [Show full text]
  • Call C# Dll from Php
    Call c# dll from php click here to download PHP has a built-in Windows-only extension called DOTNET that allows you to www.doorway.ru libraries in a PHP application. Note that you'll need to make sure your assemblies are declared as COM visible: [assembly: ComVisible(true)]. Here are two examples. php $stack = new DOTNET("mscorlib", "System. Build it as dll library output type www.doorway.ru framework ver as target. 4. load it to GAC vA. 5. Get public token from assembly list. 6. Put the token, and the class into php code and let Apache run: php $phpdotnet = new DOTNET("ClassLibraryTestPHP, Version=, Culture=neutral. Net assembly and call its methods and access its properties. $obj = new . exercise to try different type of method signature and calling them in php. www.doorway.ru Code . IMPORTANT NOTE: PHP "caches" the dll library, so every time that the dll library is compiled, the php service should be restarted (restart the apache service). A project of mine requires that I call a dll using php via a COM object call: $obj = new COM("www.doorway.ruObj") or die ("Unable to instantiate the COM!"); This call seems to work ok but the moment I try to call a function from the object using: $result = $obj->put_Name("A") ; none of the code after this. I currently have a classic ASP Web Application, it calls www.doorway.ru dll, setting it up as not easy but its possible. This year we will start moving all the ASP code and MS SQL to MySQL and PHP.
    [Show full text]
  • PHP Programming Language
    PHP Programming Language PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Thu, 17 Jun 2010 01:34:21 UTC Contents Articles Active Agenda 1 Active Calendar 2 Adminer 8 Aigaion 10 Aiki Framework 12 Asido 13 Associate- O- Matic 16 AutoTheme 18 Avactis 19 BakeSale 22 Beehive Forum 23 bitcart 25 BlueErp 29 BuddyPress 30 ccHost 32 Claroline 34 Comparison of knowledge base management software 36 concrete5 42 Coppermine Photo Gallery 44 Croogo 46 DBG 47 Delphi for PHP 47 Doctrine (PHP) 49 Dokeos 52 dotProject 55 User:Drietsch/ pimcore 57 DynPG 58 eAccelerator 59 Elgg (software) 60 EpesiBIM 62 Flash Gallery 64 Flash MP3 Player 66 FluxBB 68 Frog CMS 71 Gallery Project 73 Gamboo Web Suite 75 Gateway Anti- Virus 77 GoogleTap 78 Group- Office 79 Habari 81 Horde (software) 85 HuMo- gen 86 IPBWI 89 Icy Phoenix 91 Ingo (software) 94 Injader 95 Intelestream 96 Internet Messaging Program 98 Invision Power Board 99 ionCube 101 Joomla 103 Joomsef 106 KnowledgeBase Manager Pro 108 List of PHP accelerators 109 List of PHP libraries 112 Magic quotes 113 Mambo (software) 115 Merlintalk 120 MetaBB 122 MiaCMS 123 Midgard (software) 125 Midgard Lite 129 MindTouch Deki 130 Monkey Boards 134 Moodle 135 Moxietype 140 MyBB 141 NETSOFTWARE 144 net2ftp 146 User:Nichescript/ Affiliate Niche Sript 147 Ning (website) 148 NolaPro 152 ORMer 154 ocPortal 155 Open Realty 158 OpenBiblio 159 Opus (content management system) 161 osCommerce 163 PEAR 166 PHP accelerator 167 PHP syntax and semantics 168 PHP/
    [Show full text]
  • The Hiphop Virtual Machine
    The HipHop Virtual Machine Keith Adams Jason Evans Bertrand Maher Guilherme Ottoni Andrew Paroski Brett Simmers Edwin Smith Owen Yamauchi Facebook #"5/+ 4 # 3 '($ # % #$ % # #$ {kma,je,bertrand,ottoni,andrewparoski,bsimmers,smith,oyamauchi}@fb.com "! ) $ ! # $ % ( ( " * ! % + , $ ! . , $ $ 2 1 # $ - # / 0 % ! . / ( , - / $ # Abstract The most popular PHP implementation is a straightfor- The HipHop Virtual Machine (HHVM) is a JIT compiler ward interpreter [25]. While interpreters have the benefits of and runtime for PHP. While PHP values are dynamically simplicity and portability, they incur high CPU overheads. typed, real programs often have latent types that are use- As shown in Section 5, these overheads limit the perfor- ful for optimization once discovered. Some types can be mance of some of the most important and common PHP ap- proven through static analysis, but limitations in the ahead- plications. In this paper, we present the HipHop Virtual Machine of-time approach leave some types to be discovered at run 1 time. And even though many values have latent types, PHP (HHVM), a JIT and runtime for PHP designed with the programs can also contain polymorphic variables and ex- following goals: pressions, which must be handled without catastrophic slow- 1. Compatibility. Run large and complex PHP programs, down. whose development history was unrelated to that of HHVM discovers latent types by structuring its JIT HHVM, without modification. around the concept of a tracelet. A tracelet is approximately 2. High performance. Efficiently map PHP programs to a basic block specialized for a particular set of run-time the hardware, weakening PHP’s flexible primitives to types for its input values.
    [Show full text]
  • Framework Pro Strategické Webové Hry
    Univerzita Karlova v Praze Matematicko-fyzikální fakulta BAKALÁŘSKÁ PRÁCE Jan Pešek Framework pro strategické webové hry Katedra softwarového inženýrství Vedoucí bakalářské práce: Mgr. Miroslav Čermák Studijní program: Informatika Studijní obor: Obecná informatika Praha 2013 Rád bych zde poděkoval svému vedoucímu ročníkového projektu a bakalářské práce Mgr. Miroslavu Čermákovi, za jeho podporu, připomínky, odborné rady a vstřícný přístup během zpracování této práce. Dále bych chtěl poděkovat mému příteli Petru Šiškovi za vytvoření ilustrací pro vzorovou hru. Prohlašuji, že jsem tuto bakalářskou práci vypracoval samostatně a výhradně s použitím citovaných pramenů, literatury a dalších odborných zdrojů. Beru na vědomí, že se na moji práci vztahují práva a povinnosti vyplývající ze zákona č. 121/2000 Sb., autorského zákona v platném znění, zejména skutečnost, že Univerzita Karlova v Praze má právo na uzavření licenční smlouvy o užití této práce jako školního díla podle §60 odst. 1 autorského zákona. V Praze dne ............ Jan Pešek Název práce: Framework pro strategické webové hry Autor: Jan Pešek Katedra: Katedra softwarového inženýrství MFF UK Vedoucí bakalářské práce: Mgr. Miroslav Čermák, Katedra softwarového inženýr- ství MFF UK Abstrakt: Tato bakalářská práce popisuje softwarový projekt, který umožňuje tvorbu internetových tahových her v internetovém prohlížeči s důrazem na upra- vitelnost, tzv. framework. Výsledná aplikace umožňuje snadnou tvorbu tahové hry pro dva hráče, a poskytuje mechanismy pro pokročilou konfiguraci prostřed- nictvím modulů naprogramovaných uživatelem. Součástí projektu je vzorová hra s předdefinovanými daty, ukázkovými moduly a grafickou úpravou. V práci jsou zhodnoceny současné technologie použitelné pro vývoj interaktivních interneto- vých aplikací a diskutovány některé klíčové problémy, na které se při vývoji apli- kace naráží.
    [Show full text]
  • Improving Memory Management for HHVM
    Improving Memory Management Within the HipHop Virtual Machine Timothy Sergeant A thesis submitted in partial fulfilment of the degree of Bachelor of Advanced Computing (Honours) The Australian National University October 2014 c Timothy Sergeant 2014 Except where otherwise indicated, this thesis is my own original work. Timothy Sergeant 24 October 2014 To my parents, Evan and Elizabeth Acknowledgments Firstly, an enormous thank you to my supervisor, Steve Blackburn. Steve’s wealth of knowledge in the area has been endlessly valuable for this project. He was always able to provide useful advice for the problems I was facing, and talking with Steve always left me with renewed vigor for the project. Thank you to the members of the HHVM team at Facebook who I have talked to throughout the year, especially Bert Maher, Guilherme Ottoni and Joel Pobar, who have provided useful insight and speedy answers to my questions. A particular thanks to Joel for giving me the opportunity to experience Silicon Valley. To everyone else in the #hhvm IRC channel: Sorry for spamming you with endless failed build notifications. Thank you to Wayne Tsai and Peter Marshall for providing valuable feedback on draft copies of this thesis, as well as to everyone else in the honours cohort who has helped me throughout the year. Thank you to my housemates, Tom and Wayne, who somehow put up with the decreasing quality of my jokes as my stress level increased. Thank you also to the rest of my friends for being there for me throughout the year. Finally, thank you to my family, Evan, Elizabeth and Steph.
    [Show full text]
  • A Framework for Static Analysis of Dynamic Code Via Emulation
    Submission Version Emulization: a Framework for Static Analysis of Dynamic Code via Emulation Abbas Naderi-Afooshteh, Anh Nguyen-Tuong, Jason D. Hiser, Jack W. Davidson Department of Computer Science, University of Virginia [email protected], [email protected], [email protected], [email protected] Abstract Categories and Subject Descriptors F.3.2 [Logics and Static analysis of dynamic scripting code is a very chal- Meanings of Programs]: Semantics of Programming Languages— lenging problem due to the extensive use of dynamic features Program Analysis; D.3.4 [Programming Languages]: Processors— such as run-time code generation, dynamic aliasing, dynamic Interpreters; D.3.1 [Programming Languages]: Formal Defi- weak typing, and implicit object creation, to name a few. nitions and Theory With increasing popularity of dynamic languages, prior General Terms Design, Security research has focused on theoretical, or practical but ad- hoc solutions to handle many of these dynamic features. Keywords Dynamic Analysis, Static Analysis, Emulation Unfortunately, a comprehensive static analysis method that scales to popular real-world applications is lacking. 1. Introduction This work tackles the problem from a new perspective. Our Static analysis of dynamic applications, such as those writ- approach enables us to have an accurate, scalable method for ten in PHP, Javascript, Python or Bash Script, is an open analysis of dynamic applications. research problem. Several challenging problems plague anal- Our method, emulization, is based on a novel dynamic ysis of dynamic code. Constructing a sound or complete analysis powered by emulation, combined with static analysis. control flow graph (CFG), reasoning about dynamic evalua- The combination provides a framework for context and flow tions (i.e., calls to eval), type inference, error handling and sensitive dynamic and static analysis of dynamic applications.
    [Show full text]
  • The Hiphop Compiler for PHP
    The HipHop Compiler for PHP Haiping Zhao Iain Proctor Minghui Yang Xin Qi Mark Williams Qi Gao Guilherme Ottoni ∗ Andrew Paroski Scott MacVicar Jason Evans Stephen Tu † Facebook, Inc. Abstract 1. Introduction Scripting languages are widely used to quickly accomplish General-purpose scripting languages like Perl, Python, PHP, a variety of tasks because of the high productivity they en- Ruby, and Lua have been widely used to quickly accom- able. Among other reasons, this increased productivity re- plish a broad variety of tasks. Although there are several sults from a combination of extensive libraries, fast devel- reasons for the widespread adoption of these languages, the opment cycle, dynamic typing, and polymorphism. The dy- key common factor across all of them is the high program- namic features of scripting languages are traditionally asso- mers’ productivity that they enable [14]. This high produc- ciated with interpreters, which is the approach used to imple- tivity is the result of a number of factors. First, these lan- ment most scripting languages. Although easy to implement, guages typically provide a rich set of libraries, which re- interpreters are generally slow, which makes scripting lan- duce the amount of code that programmers need to write, guages prohibitive for implementing large, CPU-intensive test, and debug. Second, the dynamically-typed nature of applications. This efficiency problem is particularly impor- scripting languages provides flexibility and high degrees of tant for PHP given that it is the most commonly used lan- dynamic polymorphism. Last, and most important, dynamic guage for server-side web development. languages are in general purely interpreted, thus providing This paper presents the design, implementation, and an a fast cycle to modify and test source changes.
    [Show full text]