Book Image

PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax

By : Yuli Vasiliev
Book Image

PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax

By: Yuli Vasiliev

Overview of this book

Oracle Database gets high marks for performance, reliability, and scalability. Building and deploying your PHP applications on Oracle Database enables you to combine the power and robustness of Oracle and the ease of use, short development time, and high performance of PHP. When used in a complementary way, PHP and Oracle allow you to build high-performance, scalable, and reliable data-driven Web applications with a minimum of effort.When building a PHP/Oracle application, you have two general options. The first is to use an Oracle database just to store data, performing all the operations on that data on the client side; the other is to use the database not only to store data, but also to process it, thus moving data processing to the data. While building the key business logic of a database-driven PHP application inside the database is always a good idea, you should bear in mind that not all of the databases available today allow you to do. The Oracle database, which offers record-breaking performance, scalability, and reliability, does. The partnership of Oracle and the open-source scripting language PHP is an excellent solution for building high-performance, scalable, and reliable data-driven web applications.This 100% practical book is crammed full of easy-to-follow examples. It provides all the tools a PHP/Oracle developer needs to take advantage of the winning combination. It addresses the needs of a wide spectrum of PHP/Oracle developers, placing the emphasis on the most up-to-date topics, such as new PHP and Oracle Database features, stored procedure programming, handling transactions, security, caching, web services, and Ajax.
Table of Contents (16 chapters)
PHP Oracle Web Development
Credits
About the Author
About the Reviewer
Preface

Preface

Oracle Database is the premier commercial database available today, providing support for a wide range of features for professional developers. It's incomparable in terms of performance, reliability, and scalability. With the advent of Oracle Database XE, a lightweight edition of Oracle Database, you now have the option to use an Oracle database for free even in a final product.

PHP is the most popular tool when it comes to building dynamic web applications. Unlike Oracle Database, PHP is an open-source product. The key reasons behind PHP's popularity are its ease of use, short development time, and high performance. Even if you are new to PHP, getting started is pretty simple. When used in a complementary way, though, PHP and Oracle allow you to build high-performance, scalable, and reliable data-driven web applications with minimum effort.

PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and AJAX is a 100% practical book crammed full of easy-to-follow examples. The book provides all the tools a PHP/Oracle developer needs to take advantage of the winning combination. It addresses the needs of a wide spectrum of PHP/Oracle developers, placing the emphasis on the most up-to‑date topics, such as new PHP and Oracle Database features, stored procedure programming, handling transactions, security, caching, web services, and AJAX.

What This Book Covers

Chapter 1 gives an overview of the PHP and Oracle technologies, explaining why you might want to use PHP in conjunction with Oracle.

Chapter 2 covers the basics of using the PHP OCI8 extension to interact with an Oracle database from PHP. It also briefly discusses some popular alternatives to the OCI8 extension to connect to Oracle from within PHP.

Chapter 3 discusses how you can move data processing performed by your PHP/Oracle application into the database by using sophisticated SQL queries, stored PL/SQL subprograms, and database triggers.

Chapter 4 discusses the various mechanisms that can be used to perform transactions with PHP and Oracle.

Chapter 5 examines the object-oriented approach to developing PHP/Oracle applications, as an efficient means to reduce the development time and complexity, and increase the maintainability and flexibility of your applications.

Chapter 6 looks at how to effectively use the security features of both PHP and Oracle together, examining the fundamental aspects of building a secure PHP/Oracle application.

Chapter 7 discusses how to effectively use caching mechanisms available in PHP and Oracle and provides several examples of caching in action.

Chapter 8 explains how to effectively use XML techniques and technologies available in PHP and Oracle when building XML-enabled PHP/Oracle applications.

Chapter 9 shows how to build a SOAP web service exposing the functionality of a PHP/Oracle application, using the PHP SOAP extension and Oracle XML technologies.

Chapter 10 explains how AJAX and some other client-side (browser-side) JavaScript technologies can be used along with the Oracle Database technologies as well as PHP features to improve the responsiveness of PHP/Oracle applications.

Appendix A discusses how to install and configure the PHP and Oracle software components required to follow the book's examples.

Who is This Book For?

Although the book covers only the most popular and up-to-date topic areas on the use of PHP in conjunction with Oracle, the author does not make any assumption about the skill level of the reader. Packed with information in an easy-to-read format, the book is ideal for any PHP developer who deals with Oracle.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

There are three styles for code. Code words in text are shown as follows: "We can include other contexts through the use of the include directive."

A block of code will be set as follows:

<?php
//File: dbtime.php
$dbHost = "localhost";
$dbHostPort="1521";
$dbServiceName = "orcl";

When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:

$stmt = oci_parse($conn, $query);
$deptno = '60';
oci_bind_by_name($stmt, ':deptid', $deptno);

oci_define_by_name($stmt, "EMPLOYEE_ID", $empno);

Any command-line input and output is written as follows:

# cp /usr/src/asterisk-addons/configs/cdr_mysql.conf.sample
/etc/asterisk/cdr_mysql.conf

New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "clicking the Next button moves you to the next screen".

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader Feedback

Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply drop an email to , making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer Support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the Example Code for the Book

Visit http://www.packtpub.com/support, and select this book from the list of titles to download any example code or extra resources for this book. The files available for download will then be displayed.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the Submit Errata link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Questions

You can contact us at if you are having a problem with some aspect of the book, and we will do our best to address it.