100% found this document useful (1 vote)
19 views

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax A practical guide to combining the power performance scalability time and high performance of PHP 1st Ed. Edition Yuli Vasiliev - Download the ebook now for an unlimited reading experience

The document provides a comprehensive guide on PHP Oracle Web Development, covering data processing, security, caching, XML, web services, and AJAX. It includes practical examples, best practices, and insights from the author Yuli Vasiliev, who specializes in open-source development and Oracle technologies. Additionally, it offers links to download the full version and other related ebooks on the topic.

Uploaded by

jalamoobille94
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
19 views

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax A practical guide to combining the power performance scalability time and high performance of PHP 1st Ed. Edition Yuli Vasiliev - Download the ebook now for an unlimited reading experience

The document provides a comprehensive guide on PHP Oracle Web Development, covering data processing, security, caching, XML, web services, and AJAX. It includes practical examples, best practices, and insights from the author Yuli Vasiliev, who specializes in open-source development and Oracle technologies. Additionally, it offers links to download the full version and other related ebooks on the topic.

Uploaded by

jalamoobille94
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Visit ebookfinal.

com to download the full version and


explore more ebooks or textbooks

PHP Oracle Web Development Data processing


Security Caching XML Web Services and Ajax A
practical guide to combining the power performance
scalability time and high performance of PHP 1st
Ed. Edition Yuli Vasiliev
_____ Click the link below to download _____
https://ebookfinal.com/download/php-oracle-web-development-
data-processing-security-caching-xml-web-services-and-ajax-
a-practical-guide-to-combining-the-power-performance-
scalability-time-and-high-performance-of-php-1st-ed-edition/

Explore and download more ebooks or textbook at ebookfinal.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

PHP and MySQL Web development fourth edition Thomson

https://ebookfinal.com/download/php-and-mysql-web-development-fourth-
edition-thomson/

AJAX and PHP Building Modern Web Applications 2nd Edition


Bogdan Brinzarea-Iamandi

https://ebookfinal.com/download/ajax-and-php-building-modern-web-
applications-2nd-edition-bogdan-brinzarea-iamandi/

PHP and MySQL Web Development Second Edition Welling L.

https://ebookfinal.com/download/php-and-mysql-web-development-second-
edition-welling-l/

Web Application Development with Yii and PHP 2nd Revised


ed. Edition Jeffrey Winesett

https://ebookfinal.com/download/web-application-development-with-yii-
and-php-2nd-revised-ed-edition-jeffrey-winesett/
Core web application development with PHP and MySQL 1.
printing Edition Wandschneider

https://ebookfinal.com/download/core-web-application-development-with-
php-and-mysql-1-printing-edition-wandschneider/

PHP Web 2 0 Mashup Projects Practical PHP Mashups with


Google Maps Flickr Amazon YouTube MSN Search Yahoo Create
practical mashups in PHP grabbing MSN Search Yahoo Last fm
and 411Sync com 1st Ed. Edition Shu-Wai Chow
https://ebookfinal.com/download/php-web-2-0-mashup-projects-practical-
php-mashups-with-google-maps-flickr-amazon-youtube-msn-search-yahoo-
create-practical-mashups-in-php-grabbing-msn-search-yahoo-last-fm-
and-411sync-com-1st-ed-edit/

Understanding Web Services XML WSDL SOAP and UDDI 1st


Edition Eric Newcomer

https://ebookfinal.com/download/understanding-web-services-xml-wsdl-
soap-and-uddi-1st-edition-eric-newcomer/

Building Web Applications with ADO NET and XML Web


Services Gearhead Press In the Trenches 1st Edition
Richard Hundhausen
https://ebookfinal.com/download/building-web-applications-with-ado-
net-and-xml-web-services-gearhead-press-in-the-trenches-1st-edition-
richard-hundhausen/

Beginning PHP and Oracle From Novice to Professional 1st


Edition Bob Bryla

https://ebookfinal.com/download/beginning-php-and-oracle-from-novice-
to-professional-1st-edition-bob-bryla/
PHP Oracle Web Development Data processing Security
Caching XML Web Services and Ajax A practical guide
to combining the power performance scalability time and
high performance of PHP 1st Ed. Edition Yuli Vasiliev
Digital Instant Download
Author(s): Yuli Vasiliev
ISBN(s): 9781847193643, 1847193641
Edition: 1st Ed.
File Details: PDF, 6.92 MB
Year: 2007
Language: english
PHP Oracle Web Development

Data Processing, Security, Caching, XML,


Web Services, and AJAX

A practical guide to combining the power, performance,


scalability, and reliability of Oracle Database with
the ease of use, short development time, and high
performance of PHP

Yuli Vasiliev

BIRMINGHAM - MUMBAI
PHP Oracle Web Development
Data Processing, Security, Caching, XML, Web Services, and AJAX

Copyright © 2007 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of
the information presented. However, the information contained in this book is sold
without warranty, either express or implied. Neither the author, Packt Publishing,
nor its dealers or distributors will be held liable for any damages caused or alleged to
be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: August 2007

Production Reference: 1240707

Published by Packt Publishing Ltd.


32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.

ISBN 978-1-847193-63-6

www.packtpub.com

Cover Image by Vinayak Chittar (vinayak.chittar@gmail.com)


Credits

Author Project Manager


Yuli Vasiliev Patricia Weir

Reviewer Indexer
Anup Nanda Bhushan Pangaonkar

Acquisition Editor Proofreader


Priyanka Baruah Chris Smith

Technical Editor Production Coordinator


Akshara Aware Shantanu Zagade

Code Testing Cover Designer


Bansari Barot Shantanu Zagade

Editorial Manager
Dipali Chittar
About the Author

Yuli Vasiliev is a software developer, freelance author, and a consultant currently


specializing in open-source development, Oracle technologies, and service-oriented
architecture (SOA). He has over 10 years of software development experience as well
as several years of technical writing experience. He has written a series of technical
articles for Oracle Technology Network (OTN) and Oracle Magazine.
About the Reviewer

Arup Nanda (arup@proligence.com) has been an Oracle DBA since 1993, when
the world was slowly turning its attention to a big force to reckon with—Oracle7. But
he was not so lucky; he was entrusted with a production Oracle database running
Oracle 6. Since then, he has never been out of the Oracle DBA career path—weaving
several interesting situations from modeling to performance tuning to backup/
recovery and beyond, with lots of gray hairs to document each ORA-600. He has
written several articles for publications such as Oracle Magazine and for Oracle Tech
Net, he has presented at conferences such as Oracle World and IOUG Live, and he
has coauthored four books. In 2003, Oracle chose him as the DBA of the Year. He
lives in Danbury, Connecticut, with his wife, Anu, and their son, Anish.
Table of Contents
Preface 1
Chapter 1: Getting Started with PHP and Oracle 5
Why PHP and Oracle? 6
Simplicity and Flexibility 6
Performance 7
Robustness 7
Exploring PHP and Oracle Alternatives 8
PHP and MySQL 8
JSF and Oracle 8
What You Need to Start 9
Pieces of Software Required 9
Oracle Database Considerations 10
Understanding the Oracle Database 10
Choosing Between Oracle Database Editions 11
Obtaining Oracle Database Software 12
PHP Considerations 13
Apache HTTP Server 13
Why PHP 5 14
Obtaining PHP 15
Making PHP and Oracle Work Together 15
Oracle Instant Client 15
Zend Core for Oracle 16
Using Oracle SQL*Plus 17
Why Use SQL*Plus in PHP/Oracle Development? 17
Connecting to a Database with SQL*Plus 18
Running Scripts in SQL*Plus 20
Putting It All Together 21
Creating Your First PHP/Oracle Application 23
Connecting to a Database 26
Using the Local Naming Method 26
Using the Easy Connect Method 27
Table of Contents

Issuing an SQL Statement Against the Database 28


Fetching and Displaying Results 28
Summary 29
Chapter 2: PHP and Oracle Connection 31
Introducing the PHP OCI8 Extension 31
Why Use OCI8 Extension? 32
Processing SQL Statements with OCI8 32
Connecting to Oracle with OCI8 36
Defining a Connection String 37
OCI8 Functions for Connecting to Oracle 38
Parsing and Executing SQL Statements with OCI8 39
Preparing SQL Statements for Execution 39
Using Bind Variables 40
Executing SQL Statements 42
Handling Errors 42
Using the oci_error Function 42
Using the trigger_error Function 43
Using Exceptions 44
Fetching Results with OCI8 44
OCI8 Functions for Fetching 45
Fetching the Next Row 46
Fetching All the Rows 47
Alternatives to PHP OCI8 Extension 49
Using PEAR DB 49
Using ADOdb 51
Using PDO 52
Creating Your Own Library on Top of OCI8 53
Summary 54
Chapter 3: Data Processing 57
Implementing the Business Logic of a PHP/Oracle Application 58
When to Move the Data to the Processing 58
Advantages of Moving the Processing to the Data 59
Ways of Implementing Business Logic Inside the Database 60
Interaction between Components Implementing Business Logic 61
Using Complex SQL Statements 62
Employing Oracle SQL Functions in Queries 62
Oracle SQL Functions versus PHP Data Processing 62
Aggregate Functions 65
The GROUP BY Clause 66
Using Join Queries 66
Taking Advantage of Views 69

[ ii ]
Table of Contents

The Key Benefits of Using Views 69


Hiding Data Complexity with Views 70
Using the WHERE Clause 71
Using Stored Subprograms 73
What are Stored Subprograms? 73
Advantages of Stored Subprograms 75
An Example of When to Use a Stored Subprogram 76
Creating Stored Subprograms 80
Calling Stored Subprograms from PHP 82
Using Triggers 83
Creating Triggers 84
Firing Triggers 85
Calling Stored Procedures from a Trigger 85
Summary 86
Chapter 4: Transactions 89
Overview of Transactions 89
What is a Transaction? 90
What are ACID Rules? 91
How Transactions Work in Oracle 92
Using Transactions in PHP/Oracle Applications 93
Structuring a PHP/Oracle Application to Control Transactions 96
Developing Transactional Code 99
Controlling Transactions from PHP 99
Moving Transactional Code to the Database 105
Using Triggers 105
Dealing with Statement-Level Rollbacks 106
Transaction Isolation Considerations 109
What OCI8 Connection Function to Choose 110
Concurrent Update Issues 113
Locking Issues 114
Lost Updates 115
Autonomous Transactions 118
Summary 121
Chapter 5: Object-Oriented Approach 123
Implementing PHP Classes to Interact with Oracle 123
Building Blocks of Applications 124
Creating a Custom PHP Class from Scratch 125
Testing the Newly Created Class 127
Taking Advantage of PHP 5's Object-Oriented Features 128
Functionality and Implementation 130
Reusability 132
Handling Exceptions 132

[ iii ]
Table of Contents

Modifying an Existing Class to use Exceptions 133


Distinguishing between Different Error Types 136
Are Exceptions Necessarily Errors? 138
Extending Existing Classes 138
Using Standard Classes 139
PEAR::Auth in Action 139
Securing Pages with PEAR::Auth 141
Customizing Standard Classes 144
Customizing PEAR::Auth 144
Building More Compact Client Code 146
Interactions between Objects 147
Composition 148
Aggregation 150
Event-Driven Communication 155
Using Oracle Object-Relational Features 157
Using Oracle Object Types 157
Implementing Business Logic with Methods of Oracle Objects 158
Using Oracle Objects to Simplify Application Creation 161
Summary 162
Chapter 6: Security 163
Securing PHP/Oracle Applications 164
Authenticating Users 164
Separating Security Management and Data 165
Using Two Database Schemas to Improve Security 166
Using Three Database Schemas to Improve Security 168
Employing PL/SQL Packages and Table Functions to Securely Access Database Data 169
Using the %ROWTYPE Attribute 173
Building a Custom Storage Container for the PEAR::Auth Class 175
Testing the Authentication System 176
Performing Authorization Based on the User Identity 178
Using Sessions to Hold Information about the Authenticated User 179
Holding a User's Information in Package Variables 179
Protecting Resources Based on Information about the Authenticated User 182
Hashing 186
Hashing Passwords 186
Modifying an Authentication System to Use Hashing 188
Setting Up Fine-Grained Access with Database Views 191
Implementing Column-Level Security with Views 192
Masking the Column Values Returned to the Application 195
Using the DECODE Function 195
Implementing Row-Level Security with Views 198
Using VPD to Implement Row-Level Security 201
Summary 204

[ iv ]
Table of Contents

Chapter 7: Caching 205


Caching Data with Oracle and PHP 205
Caching Queries on the Database Server 206
Processing SQL Statements 206
Using Bind Variables to Increase the Probability of Shared Pool Cache Hits 208
Using Oracle's Application Contexts for Caching 210
Creating a Global Application Context 212
Manipulating Data Held in a Global Context 214
Resetting Values in a Global Context 219
Caching Mechanisms Available in PHP 222
Choosing a Caching Strategy 223
Caching Function Calls with the PEAR::Cache_Lite Package 223
Updating Cached Data 227
Implementing Notification-Based Caching 229
Using Database Change Notification 231
Auditing Notification Messages 231
Building a PL/SQL Procedure Sending Notifications to the Web Server 232
Performing Configuration Steps Required for Change Notification 234
Building the Notification Handler 234
Creating a Query Registration for the Notification Handler 236
Quick Test 238
Implementing Notification-Based Caching with PEAR::Cache_Lite 238
Summary 241
Chapter 8: XML-Enabled Applications 243
Processing XML in PHP/Oracle Applications 243
Processing XML Data with PHP 244
Creating XML with the DOM PHP Extension 245
Querying a DOM Document with XPath 247
Transforming and Processing XML with XSLT 248
Performing XML Processing inside the Database 254
Using Oracle SQL/XML Generation Functions 254
Moving All the XML Processing into the Database 257
Storing XML Data in the Database 258
Performing XSLT Transformations inside the Database 260
Building PHP Applications on Oracle XML DB 261
Using Oracle Database for Storing, Modifying, and Retrieving XML Data 262
Database Storage Options for XML Data in Oracle Database 263
Using XMLType for Handling XML Data in the Database 265
Using XML Schemas 267
Retrieving XML Data 272
Accessing Relational Data Through XMLType Views 275
Using XMLType Views 276
Creating XML Schema-Based XMLType Views 277
Performing DML Operations on XML Schema-Based XMLType Views 280
Using Oracle XML DB Repository 284

[]
Table of Contents

Manipulating Repository Resources with PL/SQL 285


Accessing Repository Resources with SQL 286
Taking Advantage of Standard Internet Protocols 287
Handling Transactions 289
Querying Data with Oracle XQuery 290
Using XQuery to Construct XML from Relational Data 291
Breaking up XML into Relational Data 293
Summary 294
Chapter 9: Web Services 295
Exposing a PHP/Oracle Application as a Web Service
Using PHP SOAP Extension 295
Communicating Using SOAP 296
What you Need to Build a SOAP Web Service 297
Building a SOAP Web Service on Top of a PHP/Oracle Application 299
Building the Business Logic of a Web Service Inside the Database 300
Creating an XML Schema to Validate Incoming Documents 301
Generating Unique IDs for Incoming Documents 304
Creating PL/SQL Subprograms Implementing the Business Logic of the Web Service 305
Building a PHP Handler Class 310
Using WSDL 312
Creating a SOAP Server with PHP's SOAP Extension 315
Building a SOAP Client to Test the SOAP Server 316
Adding Security 319
Implementing Authorization Logic Inside the Database 320
Creating a PHP Handler Class 323
Creating a WSDL Document 324
Creating a Client Script 326
Summary 327
Chapter 10: AJAX-Based Applications 329
Building AJAX-Based PHP/Oracle Applications 329
AJAX Interactions 330
Designing an AJAX/PHP/Oracle Monitoring Application 331
Building Blocks of an AJAX-Based Solution 333
Creating the Data Structures 333
Building the PHP Script that will Process AJAX Requests 334
Using the XMLHttpRequest JavaScript Object 335
Putting It All Together 340
Using Caching to Further Improve Responsiveness 342
Implementing Master/Detail Solutions with AJAX 342
Planning a Master/Detail Solution that uses AJAX 343
Building the Sample Application 344
Creating the Data Structures 346

[ vi ]
Table of Contents

Generating HTML with Oracle XQuery 348


Sending Post Requests with AJAX 350
Styling with CSS 352
Putting It All Together 353
Summary 354
Appendix A: Installing PHP and Oracle Software 355
Installing Oracle Database Software 355
Installing Oracle Database Enterprise/Standard Editions 356
Installing Oracle Database Express Edition (XE) 359
Installing Oracle Database XE on Windows 359
Installing Oracle Database XE on Linux 361
Installing Apache HTTP Server 361
Installing PHP 363
Installing PHP on Windows 363
Installing PHP on Unix-Like Systems 364
Testing PHP 365
Bridging the Gap Between Oracle and PHP 366
Oracle Instant Client 367
Enabling the OCI8 Extension in an Existing PHP Installation 368
Installing SQL*Plus Instant Client 368
Installing Zend Core for Oracle 369
Installing Zend Core for Oracle on Windows 369
Installing Zend Core for Oracle on Linux 370
Index 373

[ vii ]
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.
Preface

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.

[]
Preface

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".

Warnings or important notes appear in a box like this.

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 feedback@packtpub.com,


making sure to mention the book title in the subject of your message.

[]
Preface

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
suggest@packtpub.com.

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 questions@packtpub.com if you are having a problem with
some aspect of the book, and we will do our best to address it.

[]
Getting Started with PHP
and Oracle
There are two kinds of database-driven applications. Ones that use databases just
to store data, performing all the operations on it on the client side; and the others
that use databases 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
application inside the database is always a good idea, you should bear in mind that
not all the databases available today allow you to put this into practice. However,
the Oracle database offers record‑breaking performance, scalability, and reliability.
The partnership formed by Oracle and PHP, an open-source scripting language, is an
excellent solution for building high-performance, scalable, and reliable data-driven
web applications.

This chapter contains technical information that will help you to quickly start
developing PHP applications on top of Oracle. It begins with a concise discussion of
why you might want to use PHP in conjunction with Oracle, followed by the PHP and
Oracle alternatives. Having learned what advantages the PHP/Oracle combination
has over its competitors, you might want to see its strengths in action. If you don't
have PHP and Oracle database software installed, you can read the What You Need to
Start section in this chapter. This section discusses the pieces of software required to
run the examples provided in this book. You could also read Appendix A Installing
PHP and Oracle Software, which provides a quick-and-dirty guide to installing and
configuring these software components to work together in your system.

Once you have all the required pieces of software installed, configured, and working
properly, you are ready to build your first PHP/Oracle application. For the sake of
simplicity, the sample application provided in this chapter simply obtains the current
time from the database and then displays it to the user. In spite of its simplicity,
the example demonstrates how to perform two basic things that every PHP/Oracle
application must take care of. Specifically, it demonstrates how a PHP application
can connect to an Oracle database and then interact with it.
Discovering Diverse Content Through
Random Scribd Documents
indeed, a few faces were protruded from windows and balconies,
and feeble cries of Vivent les Anglois! and the waving of threescore
or so of handkerchiefs, greeted our progress. But the persons so
conducting themselves belonged exclusively to the lower orders, for
the gentry and municipality were gone. It is just to add, however, that
in the course of a very few days both the gentry and municipal
authorities returned, and that they, and indeed all the inhabitants of
the place, were not only protected from insult and wrong, but
encouraged to resume, as they did, their usual occupations.
While the column halted till the bridge should be so far repaired as to
permit the infantry to cross, I happened to stray a little from the main
street, and beheld, in a lane which ran parallel with the river, a
spectacle exceedingly shocking. I saw no fewer than fifty-three
donkeys standing with the sinews of the hinder legs cut through. On
inquiring from an inhabitant the cause of this, he told me that these
poor brutes, being overloaded with the baggage of the French army,
had knocked up; when the soldiers, rather than suffer them to fall
into our hands in a serviceable condition, hamstrung them all. Why
they were not merciful enough to shoot them, I know not; unless,
indeed, they were apprehensive of causing an alarm among us by
the report. But what their caution hindered we performed: the poor
creatures were all shot dead ere we advanced.
The town of St Jean de Luz covers about as much ground, and, I
should imagine, contains about as many inhabitants, as Carlisle or
Canterbury. It is divided into two parts by the river Nivelle, which falls
into the sea about a couple or three miles below, at a village, or
rather port, called Secoa. Like other French towns of its size, St Jean
de Luz is not remarkable for its air of neatness; but there are in it a
good market-place, two or three churches, and a theatre. The
Nivelle, where it flows through the city, may be about the width of the
Eden or the Isis. It is rendered passable, and the two quarters of the
city are connected, by a stone bridge of three arches—beside which,
the stream itself is fordable, both for cavalry and infantry, at low
water. When we came in this morning the tide was up, but it had
been for some time on the turn; and hence, in about a couple of
hours, we were perfectly independent of the repairs. By this time,
however, the broken arch had been united by means of planks and
beams of wood; but as the junction was none of the most firm, it was
deemed prudent to send the troopers through the water, the infantry
only crossing by the bridge. Along with the cavalry was sent the
artillery also; and thus, by noon on the 11th of November, the whole
of the left column had passed the Nivelle.
We had hardly quitted St Jean de Luz when the weather, which
during the entire morning had looked suspicious, broke, and a cold
heavy rain began to fall. This lasted without any intermission till dark,
by which means our march became the reverse of agreeable; and
we felt as if we would have given the enemy a safe-conduct as far as
Bayonne, in return for permission to halt and dry ourselves before a
fire. But of halting no hint was dropped; nor was it till our advanced-
guard came up with the rear of the French army, posted in the village
of Bidart, and along the heights adjoining, that any check was given
to our progress. As it was now late, the sun having set and twilight
coming on, it was not judged expedient to dislodge the enemy till
morning; in consequence of which our troops were commanded to
halt. But there was no cover for them. Only a few cottages stood
near the road, and the tents were at least fourteen miles in the rear;
the night was accordingly spent by most of us on the wet ground.
From the moment that the rain began to fall we remarked that the
Spanish, and in some instances the Portuguese troops, setting the
commands of their officers at defiance, left their ranks, and scattered
themselves over the face of the country. While this was going on, I
have good reason to believe that several horrible crimes were
perpetrated. Of the French peasants, many, trusting to our
proclamations, remained quietly in their houses; these were, in too
many instances, plundered and cruelly treated by the marauders,
who were, I suspect, urged on to the commission of numerous
atrocities by a feeling far more powerful than the desire of plunder. A
strong and overwhelming thirst of vengeance drew, I am convinced,
many to the perpetration of terrible deeds; indeed, one case of the
kind came under my own immediate notice, which I shall here relate.
About three o'clock in the afternoon, a temporary check took place in
the line of march, when the corps to which I belonged was about two
miles distant from Bidart. A brigade of cavalry alone was in front of
us. A Portuguese brigade, including one regiment of caçadores, was
in our rear. We stood still in our places; but the caçadore regiment,
breaking its ranks, rushed in a tumultuous manner towards two or
three cottages on the left of the road. The officers, with the utmost
difficulty, recalled them; but a few individuals, as the event proved,
succeeded in their effort of insubordination. These, however, were
not noticed at the time, and it was thought that all were where they
ought to be.
A little way, perhaps a couple of hundred yards, in front, stood
another French cottage, surrounded by a garden, and detached from
all others. In about five minutes after order had been restored, we
heard a female shriek come from that cottage. It was followed by the
report of a musket; and ere we had time to reach the spot, another
shot was fired. We ran up and found a poor old French peasant lying
dead at the bottom of the garden. A bullet had passed through his
head, and his thin grey hairs were dyed with his own blood. We
hastened towards the house; and just as we neared the door, a
caçadore rushed out, and attempted to elude us. But he was hotly
pursued and taken. When he was brought back, we entered the
cottage, and, to our horror, we saw an old woman, in all probability
the wife of the aged peasant, lying dead in the kitchen.
The desperate Portuguese did not deny having perpetrated these
murders. He seemed, on the contrary, wound up to a pitch of frenzy.
"They murdered my father, they cut my mother's throat, and they
ravished my sister," said he; "and I vowed at the time that I would put
to death the first French family that fell into my hands. You may hang
me, if you will, but I have kept my oath, and I don't care for dying." It
is unnecessary to add that the man was hanged; indeed, not fewer
than eighteen Spanish and Portuguese soldiers were tucked up, in
the course of this and the following days, to the branches of trees.
But I could not at the time avoid thinking that if any shadow of
excuse for murder can be framed, the unfortunate Portuguese who
butchered this French family deserves the benefit of it.
I have said that the greater part of the left column spent this night in
no very comfortable plight, upon the wet ground. For ourselves, we
were moved into what had once been a grass field, just at the base
of the hill of Bidart, but which, with the tread of men's feet and
horses' hoofs, was now battered into mud. Here, with the utmost
difficulty, we succeeded in lighting fires, round which we crowded as
we best might. But the rain still came down in torrents; and though
our lad arrived shortly after with the cloaks, and rations of beef and
biscuit and rum were served out to us, I cannot enumerate this
among the nights of pure enjoyment which my life as a soldier has
frequently brought in my way.
CHAPTER X.
When I awoke next morning, I found myself lying in a perfect puddle
beside the decaying embers of a fire. The rain had come down so
incessantly and with such violence during the night, that my cloak,
though excellent of its kind, stood not out against it, and I was now
as thoroughly saturated with water as if I had been dragged through
the Nivelle. Of course my sensations were not of a very pleasant
nature; but I considered that I was far from singular in my condition,
and, like my comrades, I laughed at an evil for which there was no
remedy.
Having remained under arms till day had fully dawned, we began to
make ready for a further advance. When we lay down on the
preceding evening, several brigades of French troops were in
possession of Bidart. These we naturally laid our account with
attacking; but on sending forward a patrol, it was found that the
village had been abandoned, and that Soult had fallen back to his
intrenched camp in front of Bayonne. Our parade was accordingly
dismissed; and we remained in the same situation for about four
hours, when the arrival of the tents and baggage invited us to make
ourselves somewhat more comfortable. For this purpose the brigade
was moved about a quarter of a mile to the left of the main road; and
there, on a skirt of turf comparatively sound and unbroken, the camp
was pitched.
In the immediate vicinity of the tents stood a small farmhouse, or
rather a large cottage, containing three rooms and a kitchen. Thither
a good many of the officers, and myself among the number, removed
their canteens and portmanteaus, till no fewer than forty-five
individuals, including servants as well as masters, found a temporary
shelter under its roof. I am sure, after all, that I was not more
comfortable there than I should have been in my tent; but I fancied
that to sleep upon a bed once more, even though it was a French
one, would prove a luxury; and I made the experiment. It is needless
to add that the bed contained whole hordes of living occupants
besides myself, and that I did not venture again to dispute with them
the possession of their ancient domain.
From the 12th to the 17th November nothing occurred to myself, nor
were any movements made by the left of the British army worthy of
being related. The rain continued, with hardly any intermission,
during the whole of that time, rendering the cross-roads utterly
impassable for artillery, and holding out no prospect of fresh battles
or fresh adventures. It was indeed manifest that the troops could not
be kept much longer in the field without material injury to their health,
which began already to be threatened with dysentery and ague. Nor
is it surprising that the case should be so; for the tents were not
proof against showers so heavy and incessant as fell, and canvas,
when once completely soaked, allows water to pass through it like a
sieve. The consequence was that our men were never dry, and
many began to exhibit symptoms of the complaints above alluded to.
Under these circumstances, we received with sincere rejoicing an
order in the evening of the 17th to strike our tents at dawn next
morning, and to march into winter quarters. The rain descended,
however, in such torrents, that though a temporary inconvenience
promised to lead to permanent comfort, it was deemed prudent to
delay fulfilling that order for at least some hours. We accordingly
remained quiet till about one o'clock in the afternoon of the 18th,
when, the weather breaking up, and the sun shining out, our camp
was struck, and we turned our faces towards the cantonments which
had been allotted to us.
Having cleared the few fields which intervened between the situation
of the camp and the highroad, we left Bidart behind, and took a
retrograde direction towards St Jean de Luz. We had not, however,
proceeded above five or six miles, and were still a full league distant
from the town, when, on reaching a cross-road which ran in a
direction to the left, we filed off and made for a piece of elevated
country, over which some half-dozen farmhouses were scattered.
These were assigned to the corps to which I belonged. We
accordingly halted on a sort of common near the centre of them, and
having cast lots as to which house should fall to the share of the
different companies, Grey, myself, and two others, with about a
hundred men, took possession of one, with which we were perfectly
satisfied.
It would be difficult for an ordinary reader to form any adequate
notion of the extreme satisfaction which soldiers experience when
first they establish themselves in winter quarters. As long as the
weather continues fine, and summer suns shed their influence over
it, there are indeed few places more agreeable than a camp. But it is
not so after the summer has departed. I have already hinted that
against heavy and continued rains a tent supplies but an inadequate
shelter. A tent is, moreover, but a narrow chamber, in which it is not
easy so much as to stand upright, excepting in one spot, and where
all opportunity of locomotion is denied. It furnishes, moreover, little
protection against cold—to light a fire within being impossible on
account of the smoke; and hence the only means of keeping yourself
warm is to wrap your cloak or a blanket about you, and to lie down.
Occasionally, indeed, I have seen red-hot shot employed as heaters;
but the kind of warmth which arises from heated iron is, at least to
me, hardly more agreeable than that which is produced by charcoal.
In a word, however enthusiastic a man may be in his profession, he
begins, about the end of October or the beginning of November, to
grow heartily tired of campaigning, and looks forward to a few weeks'
rest, and a substantial protection against cold and damps, with
almost as much pleasure as he experiences when the return of
spring calls him once more into the field.
The farmhouses in the south of France, like those in Spain, are
rarely provided with fireplaces in any other apartment than the
kitchen. It is, indeed, customary for families to live during the winter
months entirely with their servants; and hence the want of a fireplace
in the parlour is not felt any more than in the bedrooms. I observed,
likewise, that hardly any maison of the kind was furnished with
glazed windows, wooden lattices being almost universally
substituted. These, during the summer months, are kept open all
day, and closed only at night; and I believe that the extreme
mildness of the climate renders an open window at such seasons
very agreeable. On the present occasion, however, we anticipated
no slight annoyance from the absence of these two essential
matters, a chimney and a window in our room; and we immediately
set our wits to work to remove the evil.
Both Grey's servant and my own chanced to be exceedingly
ingenious fellows; the former, in particular, could, to use a vulgar
phrase, turn his hand to anything. Under his directions we set a party
of men to work, and, knocking a hole through one corner of our
room, we speedily converted it into a fireplace. To give vent to the
smoke, we took the trouble to build an external chimney, carrying it
up as high as the roof of the house; and our pride and satisfaction
were neither of them trifling when we found that it drew to
admiration. I cannot say that the masonry was very exact, or that the
sort of buttress added to the mansion improved its general
appearance; but it had the effect of rendering our apartment
exceedingly comfortable, and that was the sole object which we had
in view.
Having thus provided for our warmth, the next thing to be done was
to manufacture such a window as might supply us with light, and at
the same time resist the weather. For this purpose we lifted a couple
of lattices from their hinges, and having cut out four panels in each,
we covered the spaces with white paper soaked in oil. The light thus
admitted was not, indeed, very brilliant, but it was sufficient for all our
purposes; and we found, when the storm again returned, that our oil-
paper stood out against it stoutly. Then, having swept our floor,
unpacked and arranged the contents of our canteen, and provided
good dry hay-sacks for our couches, we felt as if the whole world
could have supplied no better or more desirable habitation.
To build the chimney and construct the window furnished occupation
enough for one day; the next was spent in cutting wood, and laying
in a store of fuel against the winter. In effecting this, it must be
confessed that we were not over-fastidious as to the source from
which it was derived; and hence a greater number of fruit-trees were
felled and cut to pieces than perhaps there was any positive
necessity to destroy. But it is impossible to guard against every little
excess when troops have established themselves in an enemy's
country; and the French have just cause of thankfulness that so little
comparative devastation marked the progress of our armies. Their
own, it is well known, were not remarkable for their orderly conduct
in such countries as they overran.
I have dwelt upon these little circumstances longer perhaps than
their insignificance in the eyes of my reader may warrant, but I could
not help it. There is no period of my life on which I look back with
more unmixed pleasure than that which saw me for the first time set
down in winter quarters. And hence every trifling incident connected
with it, however unimportant to others, appears the reverse of
unimportant to me. And such, I believe, is universally the case when
a man undertakes to be his own biographer. Things and occurrences
which, to the world at large, seem wholly undeserving of record, his
own feelings prompt him to detail with unusual minuteness, even
though he may be conscious all the while that he is entering upon
details which his readers will scarcely take the trouble to follow.
Having thus rendered our quarters as snug as they were capable of
being made, my friend and myself proceeded daily into the adjoining
woods in search of game; and as the frost set in we found them
amply stored, not only with hares and rabbits, but with woodcocks,
snipes, and other birds of passage. We were not, however, so
fortunate as to fall in with any of the wild boars which are said to
frequent these thickets, though we devoted more than one morning
to the search; but we managed to supply our own table, and the
tables of several of our comrades, with a very agreeable addition to
the lean beef which was issued out to us. Nor were other luxuries
wanting. The peasantry, having recovered their confidence, returned
in great numbers to their homes, and seldom failed to call at our
mansion once or twice a-week with wine, fresh bread, cider, and
bottled beer; by the help of which we continued to fare well as long
as our fast-diminishing stock of money lasted. I say fast-diminishing
stock of money, for as yet no addition had been made to that which
each of us brought with him from England; and though the pay of the
army was now six months in arrear, but faint hopes were entertained
of any immediate donative.
It was not, however, among regimental and other inferior officers
alone that this period of military inaction was esteemed and acted
upon as one of enjoyment. Lord Wellington's fox-hounds were
unkennelled; and he himself took the field regularly twice a-week, as
if he had been a denizen of Leicestershire, or any other sporting
county in England. I need not add that few packs in any county could
be better attended. Not that the horses of all the huntsmen were of
the best breed, or of the gayest appearance; but what was wanting
in individual splendour, was made up by the number of Nimrods; nor
would it be easy to discover a field more fruitful in laughable
occurrences, which no man more heartily enjoyed than the gallant
Marquess himself. When the hounds were out, he was no longer the
Commander of the Forces, the General-in-Chief of three nations,
and the representative of three sovereigns, but the gay merry
country gentleman, who rode at everything, and laughed as loud
when he fell himself as when he witnessed the fall of a brother
sportsman.
Thus passed about twenty days, during the greater number of which
the sky was clear and the air cold and bracing. Occasionally, indeed,
we varied our sporting life by visits to St Jean de Luz, and other
towns in the rear, and by seeking out old friends in other divisions of
the army. Nor were we altogether without military occupation. Here
and there a redoubt was thrown up for the purpose of rendering our
position doubly secure; and the various brigades of each division
relieved one another in taking the duty of the outposts. A trifling
skirmish or two likewise tended to keep us alive; but these were
followed by no movement of importance, nor were they very fatal
either to the enemy or ourselves.
The position which Lord Wellington thus took up extended from the
village of Bidart on the left to a place called Garret's House on the
right. It embraced various other villages, such as that of Arcanques,
Gauthory, &c. &c., between these points, and kept the extremities of
the line at a distance of perhaps six or seven miles from each other.
To a common observer it certainly had in it nothing imposing, or
calculated to give the idea of great natural strength. On the left, in
particular, our troops, when called into the field, occupied a level
plain, wooded indeed, but very little broken; whilst at different points
in the centre there were passes easy of approach, and far from
defensible in any extraordinary degree. But its strength was well
tried, as I shall take occasion shortly to relate; and the issue of the
trial proved that no error had been committed in its selection.
Of the manner in which the right and centre columns were disposed I
knew but little. The left column, consisting of the first and fifth
divisions, of two or three brigades of Portuguese infantry, one
brigade of light and one of heavy cavalry, was thus posted: The town
of St Jean de Luz, in which Lord Wellington had fixed his quarters,
was occupied by three or four battalions of Guards; its suburbs were
given up to such corps of the German legion as were attached to the
first division. In and about the town the light cavalry was likewise
quartered; whilst the heavy was sent back to Handaye and the
villages near it, on account of the facility of procuring forage which
there existed. The Spaniards had again fallen back as far as Irun,
and were not brought up during the remainder of the winter; but the
Portuguese regiments were scattered, like ourselves, among a
number of detached cottages near the road. In the village of Bidart
was posted the fifth division, a battery or two of field-artillery, and the
men and horses attached to them; and to it the duty of watching the
enemy, and keeping possession of the ground on which the pickets
stood, was committed. Thus, along the line of the highroad was
housed a corps of about fifteen thousand infantry, twelve hundred
cavalry, and a due proportion of artillery—all under the immediate
command of Sir John Hope.
In direct communication with the head of this column was the light
division, under the command of Major-General Baron Alten. It
consisted of the 43d, 52d, and 95th regiments, of a brigade or two of
caçadores, and mustered in all about four or five thousand bayonets.
These occupied the church and village of Arcanques, situated upon
a rising ground, and of considerable natural strength. Beyond this
division again lay the fourth; in connection with which were the third,
the seventh, and the second divisions; whilst the sixth took post a
little in the rear, and acted as a reserve, in case a reserve should be
wanting.
I have said that Lord Wellington's headquarters were in St Jean de
Luz. Here also Sir John Hope, and several generals of division and
of brigade, established themselves; and here all the general staff of
the army was posted. Of course the place was kept in a state of
warlike gaiety, such as it had not probably witnessed before, at least
in modern times; but everything was done which could be thought of
to conciliate the goodwill of the inhabitants: nor was the slightest
outrage or riot permitted. Such is the manner in which the British
army was disposed of from the 18th of November, when it first went
into cantonments, till the 9th of December, when it was found
necessary once more to take the field.
CHAPTER XI.
I had been out with my gun during the whole of the 8th of December,
and returned at a late hour in the evening, not a little weary with
wandering, when the first intelligence communicated to me was that
the corps had received orders to be under arms at an early hour next
morning, when the whole of the army would advance. In a former
chapter I have hinted that a continued tract of rainy weather drove
Lord Wellington, earlier than he had intended, and against his
inclination, into winter quarters. The consequence was, that the
position of the army was not in every respect to his mind. The right,
in particular, was too far thrown back; and the course of the Nivelle
interfered in a very inconvenient degree with the communications
between it and the left. We were accordingly given to understand
that the object of our present movement was merely to facilitate the
crossing of that river by Sir Rowland Hill's corps; and that as soon as
this object was attained, we should be permitted to return in peace to
our comfortable quarters.
In consequence of this information, Grey and myself made fewer
preparations than we had been in the habit of doing on other and
similar occasions. Instead of packing up our baggage, and ordering
out our sumpter-pony and faithful Portuguese, we left everything in
our apartment in its ordinary condition. Strict charges were indeed
given to the servants that a cheerful fire and a substantial meal
should be prepared against our return in the evening; but we put up
neither food nor clothes for immediate use, in full expectation that
such things would not be required.
The night of the 8th passed quietly over, and I arose about two hours
before dawn on the 9th, perfectly fresh, and, like those around me, in
high spirits. We had been so long idle, that the near prospect of a
little fighting, instead of creating gloomy sensations, was viewed with
sincere delight; and we took our places, and began our march
towards the highroad, in silence, it is true, but with extreme goodwill.
There we remained stationary till the day broke; when the word
being given to advance, we pushed forward in the direction of
Bayonne.
The brigade to which I belonged took post at the head of the first
division, and immediately in rear of the fifth. The situation afforded to
me on several occasions, as the inequalities of the road placed me
from time to time on the summit of an eminence, very favourable
opportunities of beholding the whole of the warlike mass which was
moving; nor is it easy to imagine a more imposing or more elevating
spectacle. The entire left wing of the army advanced in a single
continuous column along the main road, and covered, at the most
moderate computation, a space of four miles. As far, indeed, as the
eye could reach, nothing was to be seen except swarms of infantry,
clothed not only in scarlet, but in green, blue, and brown uniforms.
Here and there a brigade of guns occupied a vacant space between
the last files of one division and the first of another, and in rear of all
came the cavalry. Of their appearance I was unable accurately to
judge, they were so distant.
We had proceeded about five miles, and it was past eight o'clock,
when, our advanced-guard falling in with the French pickets, a smart
skirmish began. It was really a beautiful sight. The enemy made, it is
true, no very determined stand; but they did not give up a rood of
ground without exchanging a few shots with their assailants, who
pressed forward, vigorously indeed, but with all the caution and
circumspection which mark the advance of a skilful skirmisher. The
column, in the meanwhile, moved slowly but steadily on; nor was it
once called upon, during the whole of the day, to deploy into line.
When the light troops of an army are engaged as ours were this
morning, the heavy infantry marches at a slow rate; and short halts
or checks are constantly occurring. These befel to-day with unusual
frequency. The fact, I believe, was, that Lord Wellington had no
desire to bring his left into determined action at all. His object was
fully attained as long as he kept the right of the enemy in a state of
anxiety and irresolution; but the ground which we gained was in no
degree important to the furtherance of the sole design which we had
in view. Of course the tardiness of our motions gave a better
opportunity of watching the progress of those connected with us; nor
have I ever beheld a field-day at home more regularly gone through
than this trifling affair of the 9th December.
It was getting somewhat late—perhaps it might be three or four
o'clock in the afternoon—when our column, having overcome all
opposition, halted on some rising ground about three miles from the
walls of Bayonne. From this point we obtained a perfect view of the
outworks of that town, as well as of the formidable line of
fortifications which Soult had thrown up along the course of the
Adour; but of the city itself we saw little, on account of several groves
of elm and other trees which intervened. It will readily be imagined
that we turned our glasses towards the intrenched camp with
feelings very different from those which actuate an ordinary observer
of the face of a strange country. That the French marshal had been
at work upon these lines not only from the moment of his last defeat,
but from the very first day of his assuming the command of the army
of Spain, we were aware; and hence we were by no means
surprised at beholding such an obstacle presented to our further
progress in France. But I cannot say that the sight cast even a damp
upon our usual confidence. We knew that whatever could be done to
render these mighty preparations useless our gallant general would
effect; and perhaps we were each of us vain enough to believe that
nothing could resist our own individual valour. Be that as it may,
though we freely acknowledged that many a brave fellow must find a
grave ere these works could come into our possession, we would
have advanced to the attack at the instant, not only without
reluctance, but with the most perfect assurance of success.
The sound of firing had gradually subsided—the enemy having
withdrawn within their intrenchments, and our skirmishers being
called in to join their respective corps. The left column, dividing itself
according to its brigades, had taken post along a ridge of high
ground, and our men, piling their arms, set about lighting fires in all
directions, when I wandered from the corps, as my invariable custom
was, in search of adventures. I had strolled forward for the purpose
of obtaining, if possible, a more perfect view of the enemy's lines,
and was stepping across a ditch on my return, when a low groan, as
if from some person in acute pain, attracted my notice. I looked down
into the ditch, which was, perhaps, four feet deep, and beheld three
human beings lying at the bottom of it. They were all perfectly naked,
and two of them were motionless. On farther examination, I found
that they were three French soldiers, of whom one only was alive;
and he lay bleeding from a severe wound in the face, a musket-ball
having broken both cheek-bones. He was, however, sensible; so I
ran for help, and he was carried by some of our people to a
neighbouring house. Here the poor fellow, whom his own
countrymen had stripped and deserted, was well taken care of; but
he had suffered so much from exposure to cold that all attempts to
preserve life were vain, and he died in about a quarter of an hour
after his wound was dressed.
In the meanwhile Lord Wellington, putting himself at the head of a
small body of cavalry, and attended by a few companies of light
infantry, proceeded to the front in order to reconnoitre the enemy's
works. This he was permitted to do without any further molestation
than arose from the occasional discharge of a field-gun, as he and
his party presented a favourable mark to the gunners. But neither he
nor his followers received the slightest injury from these discharges;
and by six in the evening he had effected every object which he
desired to accomplish. Orders were accordingly issued for the troops
to fall back to their former quarters; and the main road was again
crowded with armed men marching to the rear, in a fashion not
perhaps quite so orderly as that which distinguished their advance.
A heavy rain had begun about an hour previous to this movement,
accompanied by a cold wind which blew directly in our faces;
darkness, too, set rapidly in; the road soon became deep and
muddy, from the trampling of a multitude of men and horses; and
something like an inclination to grumble began to arise in our
bosoms. Perhaps I need not tell the reader that between the infantry
and cavalry in the British army a considerable degree of jealousy
exists—the former description of force regarding the latter as more
ornamental than useful, the latter regarding the former as extremely
ungenteel. I was myself an officer of infantry; and I perfectly recollect
the feelings which were excited at a particular period of the march
when the corps, weary, wet, and hungry, was rudely ordered by a
squadron or two of light troopers to "get out of the way, and allow
them to pass." Recollect, good reader, that the rain was falling as if it
had come from buckets; that each infantry soldier carries a load of
perhaps fifty pounds weight about his person; that our brave fellows
had walked under this load upwards of fourteen miles, and were still
six long miles from a place of rest,—and you will not wonder that the
troopers were saluted with "curses not loud but deep," as they
somewhat wantonly jostled their less fortunate comrades into the
deepest and dirtiest sides of the way. I must confess that I shared in
the indignation of my men; though, of course, I exerted myself as
much as possible to prevent its being more openly displayed.
Never has any saloon, when brilliantly lighted up and filled with the
splendour and elegance of a fashionable assembly, appeared half so
attractive to my eyes as did our own humble apartment this evening,
with its carpetless floor, its logs of wood arranged instead of chairs,
and a few deals, or rather a piece of scaffolding, placed in the centre
as a substitute for a table. A large fire was blazing on the rudely-
constructed hearth, which shed a bright glare over the white walls;
and our unpolished table being covered with a clean cloth, over
which were arranged plates, knives, forks, and drinking-cups, gave
promise of a substantial meal, and of an evening of real enjoyment.
Nor were our hopes blighted. We had just time to strip off our wet
and muddy garments, and to substitute others in their room, when a
huge piece of roast-beef smoked upon the board, and summoned us
to an occupation more agreeable than any which could have been at
that moment proposed to us. Moreover, our faithful valets had taken
care to provide an ample supply of wine, a bottle or two of
champagne, with claret of no mean quality, which, with a little French
beer, brisk and weak, and well-flavoured, served exceedingly well to
wash down the more solid portions of our repast. To complete the
thing, a few of our most intimate companions dropping in soon after
the fragments had been cleared away, our cigars were lighted, and
the atmosphere of the apartment became speedily impregnated with
the delicious fumes of tobacco—in sending forth clouds of which, no
other interruption took place than was produced by an occasional
uplifting of the wine-cup to the lips, and an expression, or short
ejaculation, indicative of the perfect satisfaction of him who uttered it.
I have seen many merry and many happy days and nights, both
before and since, but an evening of more quiet luxury than this I
certainly do not recollect at any period to have spent.
At length the fatigues of the day began to tell upon us in a degree
somewhat too powerful for enjoyment. We had been under arms
from four in the morning till nine at night, during the whole of which
time no opportunity of eating had been supplied to us; nor had we
been permitted to unbend either our minds or bodies in any effectual
degree. Like other animals who have fasted long, we had all gorged
ourselves as soon as the means of so doing were furnished; and
hence the sensation of absolute rest degenerated gradually into
languor, and sleep laid his leaden fingers on our eyelids. I do not
believe that half-a-dozen sentences of ordinary length had been
uttered amongst us when, about eleven o'clock, our last cup of wine
was drained off; and our guests departing each to his own billet, we
betook ourselves to our pallets. I need not add that our slumber was
thoroughly unbroken.
CHAPTER XII.
I arose next morning refreshed and vigorous, and prepared to follow
my ordinary occupation of shooting. It was a clear frosty day, the sun
was shining brightly overhead, and a thousand little birds were
rejoicing in the warmth of his beams. My dogs were in high condition;
my gun was clean and in good order; and myself big with the
determination not to fire in too great a hurry, but to be sure of my aim
before I pulled the trigger. Thus attended, and thus animated, I set
forth after breakfast; and having previously ascertained the favourite
haunt of a hare which had more than once escaped me, I turned my
steps towards it. My faithful spaniel had just begun to give tongue,
and my fowling-piece was already in a position to be lifted at once to
my shoulder, when the report of a single cannon, coming from the
front, attracted my attention. I stopped short, but had not time to call
in my dog when another and another discharge took place, mixed
with an occasional rattle of musketry. This was warning enough.
Though the hare started from her seat, I permitted her to depart in
peace; and whistling loudly for my four-footed companions, I ran
back towards my quarters. As I proceeded, the firing became every
moment more and more heavy, till at length it had increased into an
uninterrupted roar.
On reaching the houses, I found that the alarm was already given.
The bugles were sounding to recall such as might be abroad, and
the men were accoutring with all haste. For ourselves, Grey and I
took care on the present occasion to make better provision against
detention than we had done the day before; but our baggage we
were obliged to leave, that it might be packed and made ready for
removal by our batmen. Aide-de-camp after aide-de-camp passed, in
the meanwhile, to and fro—one galloping from the front to urge an
immediate advance, another galloping from the rear to ascertain how
matters were going; whilst the various battalions, as each was
equipped and ready, hurried down to the main road to join its
particular brigade.
A quarter of an hour had scarcely elapsed from the moment that the
alarm was first given when we found ourselves marching once more
in the same direction, and nearly in the same order, as yesterday.
Our march had in it, however, even more of deep excitement than
that of the preceding day. We had not proceeded above a mile when
indications of what was going on in front began to present
themselves, in the form of baggage-mules and horses pouring in all
haste and confusion to the rear. A wounded man or two likewise
from time to time dragged himself in the same direction, and gave,
as the wounded invariably do, the most alarming account of the state
of affairs. "Push on, push on, for God's sake!" said one poor fellow
who had been shot in the head, and was lying, rather than sitting,
across a horse; "push on, or it will be all over. Forty thousand of the
enemy are coming on, and there not two thousand men up to
oppose them." Of course we quickened our pace with infinite
goodwill.
A group of perhaps twenty wounded privates and officers had
passed, when the next body which met us was a detachment of ten
sound men and a sergeant, who were conducting to the rear about a
hundred French prisoners. These were saluted with a cheer; but
even these urged us forward, with the intelligence that the fifth
division must soon be overpowered. And now the scene of action
began to open upon us. We had passed through Bidart, and were
descending the little eminence on which it stands, when the
combatants became distinguishable; and a very magnificent as well
as gratifying spectacle they presented. The merest handful of British
troops were opposing themselves, in the most determined manner,
to a mass of men so dense and so extended as to cover the whole of
the main road as far as the eye could reach. Our people were, it is
true, giving way. They had already maintained an unequal contest for
upwards of two hours; and their numbers, originally small, were fast
diminishing. But no sooner had the head of our column shown itself
than their confidence returned, and they renewed the struggle with
increased alacrity.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like