Eclipse plugin PHP programmides leiduvate SQL päringute kontrollimiseks

Date

2015

Journal Title

Journal ISSN

Volume Title

Publisher

Abstract

Käesoleva magistritöö eesmärgiks oli kavandada ja implementeerida Eclipse’i põhine töövahend, mis võimaldaks kontrollida PHP-skriptides leiduvate SQL-päringute süntaktilist ning semantilist korrektsust. Aluseks sai võetud juba eksisteeriv töövahend Alvor, mis on mõeldud Java koodis leiduvate SQL lausete kontrollimiseks. Töö tulemusena valmis laiendus AlvorPHP, mis kogub kokku päringulaused neid sisaldava PHP funktsiooni või skripti skoobis ning tagastab edasiseks käitlemiseks. PHP dünaamilise eripära tõttu ei olnud võimalik realiseerida toetust kõigile temas esinevatele keelelistele konstruktsioonidele. Mõned neist jäid realiseerimata ka ajapuuduse tõttu, mis jätab võimaluse laienduse edaspidiseks täiendamiseks. Sellele vaatamata on toetatud enam levinud ning kasutatavad vahendid. Antud laienduse kasutajate sihtgrupp peaks olema ennekõike algajad programmeerijad, kes saaksid seda kasutada õppimist toetava abivahendina.
During code development it is crucial to get fast feedback about the correctness of our code. Various hints are given by compiler through warnings and error messages that are displayed in the IDE, e.g. Eclipse. Unfortunately, this covers only the general host-language, in which we write the code. Often we need to use another language to communicate with a specific application domain: e.g. SQL for sending queries to a database engine. By default these SQL strings are not checked statically, although it would be highly beneficial. Alvor is a tool that statically checks SQL queries in Java programs. This thesis presents an extension for Alvor to add PHP support. The key challenge when adapting Alvor to PHP was the dynamic nature of PHP. The solution is therefore limited to operate only within the scope of a PHP function or a PHP script. We evaluated the tool on open-source software and the results showed that it would be most beneficial to use it as a tool to support beginners in learning programming.

Description

Keywords

Citation