php - firebird · 22. oktober 2019 martin köditz 3 firebird conference 2019 | php + firebird...

16
PHP + Firebird Firebird Conference 2019, Berlin, 17. - 19. October

Upload: others

Post on 14-Oct-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

PHP + FirebirdFirebird Conference 2019, Berlin, 17. - 19. October

Page 2: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 2

Firebird Conference 2019 | PHP + Firebird

Firebird Conference 2019Berlin, 17-19 October

Page 3: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 3

Firebird Conference 2019 | PHP + Firebird

Agenda

● How does it work?● How to get started?● Start development using ibase driver● Using a framework – Zend Framework● Future of the PHP driver

Page 4: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 4

Firebird Conference 2019 | PHP + Firebird

How does it work?

HTMLCSS

JS

PHP

HTMLrenderer

CSS renderer

JSinterpreter

Request

Response

Web-Server

Browser

FirebirdServer

Mail, SMS, RSS,

...

Response is no PHP, but result of thePHP interpreter:

HTML, CSS, JSON ...

Can be request for HTML, CSS, JS, PHPor a combination.

ibase driver

Page 5: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 5

Firebird Conference 2019 | PHP + Firebird

How to get started?

● Check the PHP environment● Install ibase extension● Install correct fbclient library● Restart web server● Check loaded PHP modules● php.ini

Page 6: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 6

Firebird Conference 2019 | PHP + Firebird

php.ini

● Core section– display_errors = On (development only)– display_startup_errors = On (development only)– date.timezone = 'Europe/Berlin'

● Firebird specific– ibase.timestampformat = "%Y-%m-%d %H:%M:%S"– ibase.dateformat = "%Y-%m-%d"– ibase.default_charset = "UTF8" (optional)

Page 7: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 7

Firebird Conference 2019 | PHP + Firebird

Start development using the ibase driver

● Demos– Connect database– Error handling– Transactions– Statements– Using services

Page 8: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 8

Firebird Conference 2019 | PHP + Firebird

Using a Framework

● Object oriented● Integrated DB adapters● Modules● Speedup of development● Learning curve

Page 9: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 9

Firebird Conference 2019 | PHP + Firebird

Zend Framework I // Start a transaction explicitly.

$db->beginTransaction();

try {

// Attempt to execute one or more queries:

$db->query(...);

$db->query(...);

// If all succeed, commit the transaction and all changes are committed at once.

$db->commit();

} catch (Exception $e) {

// Rollback on error

$db->rollBack();

echo $e->getMessage();

}

Page 10: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 10

Firebird Conference 2019 | PHP + Firebird

Zend Framework I - advantages

● Object oriented● Modules● Reusable code

Page 11: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 11

Firebird Conference 2019 | PHP + Firebird

Zend Framework I - disadvantages

● ZendX extension● EOL

Page 12: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 12

Firebird Conference 2019 | PHP + Firebird

Application based on Zend Framework and Firebird

● SynDesk ERP– Multi client– Multi user– Web based– Responsive– Etc.

Page 13: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 13

Firebird Conference 2019 | PHP + Firebird

Frameworks

● Cake PHP● Zend Framework III● Yii● Symphony● Laravel● CodeIgniter

Page 14: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 14

Firebird Conference 2019 | PHP + Firebird

Future of the Firebird PHP driver

● New maintainer: Martin Köditz● ibase driver moved from PHP core to PHP

PECL● Integration in FirebirdSQL as submodule● Development independent of PHP community● Replace Interbase identifiers

Page 15: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 15

Firebird Conference 2019 | PHP + Firebird

Summary

● How does it work?● How to get started?● Start development using ibase driver● Using a framework – Zend Framework● Future of the PHP driver

Page 16: PHP - Firebird · 22. Oktober 2019 Martin Köditz 3 Firebird Conference 2019 | PHP + Firebird Agenda How does it work? How to get started? Start development using ibase driver Using

22. Oktober 2019 Martin Köditz 16

Firebird Conference 2019 | PHP + Firebird

Helpful resources

● https://firebirdsql.org/file/documentation/reference_manuals/fbdevgd-en/html/fbdevgd30-php.html

● firebirdforum.de● Mailing list Firebird-PHP