Expert PHP and MySQL 1st Edition Andrew Curioso Instant Download
Expert PHP and MySQL 1st Edition Andrew Curioso Instant Download
pdf download
https://ebookname.com/product/expert-php-and-mysql-1st-edition-
andrew-curioso/
https://ebookname.com/product/php-and-mysql-create-modify-
reuse-1st-edition-timothy-boronczyk/
https://ebookname.com/product/learning-php-mysql-javascript-4th-
edition-robin-nixon/
https://ebookname.com/product/php-and-mysql-for-dummies-2nd-ed-
edition-janet-valade/
https://ebookname.com/product/amateur-and-proletarian-theatre-in-
post-revolutionary-russia-primary-sources-1st-edition-stefan-
aquilina/
Applied Linguistics Review 1st Edition Li Wei
https://ebookname.com/product/applied-linguistics-review-1st-
edition-li-wei/
https://ebookname.com/product/stress-analysis-of-fiber-
reinforced-composite-materials-michael-w-hyer/
https://ebookname.com/product/learning-unix-for-os-x-second-
edition-taylor/
https://ebookname.com/product/the-advanced-fixed-income-and-
derivatives-management-guide-1st-edition-saied-simozar/
https://ebookname.com/product/technology-supported-environments-
for-personalized-learning-methods-and-case-studies-premier-
reference-source-1st-edition-john-odonoghue/
Modeling Crop Production Systems Principles and
Application 1st Edition P Singh (Author)
https://ebookname.com/product/modeling-crop-production-systems-
principles-and-application-1st-edition-p-singh-author/
Curioso
Best practices and expert techniques et al. Join the discussion @ p2p.wrox.com Wrox Programmer to Programmer™
MySQL
offerings for Tripod Users, switching remaining apps using Oracle to MySQL as well as more reference resources on ®
®
other interesting projects. programming topics that matter
to you.
Wrox Expert books present the wisdom accumulated by an experienced
author team who is recognized as experts by the programming community.
These experts challenge professional developers to examine their current
practices in pursuit of better results.
wrox.com
form-to-email script to a web forum application, a blogging platform, or a content management system. This guide introduces
the PHP language and shows you how to write powerful web applications using PHP.
Professional PHP 5
ISBN: 978-0-7645-7282-1
This book has a pragmatic focus on how to use PHP in the larger scheme of enterprise-class software development. It covers
UML modeling and presents objects and object hierarchies that, when completed, comprise a robust toolkit that developers will
be able to reuse on future projects. This book is designed to arm you with the sort of constructs that are available out of the
box with platforms such as Java and .NET — from simple utility classes like Collection and Iterator, to more complex constructs
like Model/View/Controller architectures and state machines.
Interact Join the Community Professional PHP Design Patterns
Take an active role online by participating in our Sign up for our free monthly newsletter at ISBN: 978-0-470-49670-1
P2P forums @ p2p.wrox.com newsletter.wrox.com This book bridges the gap between the PHP and the older programming language by applying those tried and tested Design
Patterns to native PHP applications. It starts with an introduction to Design Patterns, describes their use and importance, and
details where you’ve seen them already. The book continues through a host of Design Patterns with code examples and explanations.
Finally, an in-depth case study shows you how to plan your next application using Design Patterns, how to program those patterns
Wrox Online Library Browse in PHP, and how to revise and refactor an existing block of code using Design Patterns from the book. The author approaches
the concepts in technical yet usable formats that are familiar to both programmers who are self-taught and those with more
Hundreds of our books are available online Ready for more Wrox? We have books and extensive formal education.
through Books24x7.com e-books available on .NET, SQL Server, Java,
XML, Visual Basic, C#/ C++, and much more!
Wrox Blox
Download short informational pieces and code
to keep you up to date and out of trouble!
Contact Us.
We always like to get feedback from our readers. Have a book idea?
Need community support? Let us know by e-mailing [email protected]
CONTENTS AT A GLANCE
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
CHAPTER 1 Techniques Every Expert Programmer Needs to Know . . . . . . . . . . . . . . . 1
CHAPTER 2 Advanced PHP Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
CHAPTER 3 MySQL Drivers and Storage Engines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
CHAPTER 4 Improving Performance through Caching . . . . . . . . . . . . . . . . . . . . . . . . . 131
CHAPTER 5 memcached and MySQL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
CHAPTER 6 Advanced MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
CHAPTER 7 Extending MySQL with User-Defined Functions . . . . . . . . . . . . . . . . . . 271
CHAPTER 8 Writing PHP Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
CHAPTER 9 Full-Text Searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
CHAPTER 10 Multi-tasking in PHP and MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
CHAPTER 11 Rewrite Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
CHAPTER 12 User Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
CHAPTER 13 Understanding the INFORMATION_SCHEMA . . . . . . . . . . . . . . . . . . . . 477
CHAPTER 14 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
CHAPTER 15 Command-Line and Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .517
CHAPTER 16 Optimization and Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
Andrew Curioso
Ronald Bradford
Patrick Galbraith
ISBN: 978-0-470-56312-0
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of
the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through
payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923,
(978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions
Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or
online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including
without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or pro-
motional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold
with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services.
If professional assistance is required, the services of a competent professional person should be sought. Neither the pub-
lisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to
in this work as a citation and/or a potential source of further information does not mean that the author or the publisher
endorses the information the organization or Web site may provide or recommendations it may make. Further, readers
should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was
written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available
in electronic books.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are
trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates, in the United States and other coun-
tries, and may not be used without written permission. MySQL is a registered trademark of MySQL AB. All other trade-
marks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor
mentioned in this book.
ÑAndrew Curioso
For MySQL Culture, past, present, and future. To
many in the MySQL community: you are more than
colleagues, you are great friends.
ÑRonald Bradford
This book is dedicated to my son, Kiran Patrick.
“Kiran” means “ray of light” in Sanskrit, and you are
a ray of light in my life!
ÑPatrick Galbraith
ANDREW CURIOSO has been coding in PHP and MySQL for a decade. His experience includes develop-
ing professional-grade PHP and MySQL based web applications for MIT Lincoln Laboratory (part of
the Massachusetts Institute of Technology) and being at the ground floor of the state-of-the-art web-
publishing platform Webon at Lycos (currently the page builder technology for Angelfire.com). Aside
from software engineering, Andrew takes interest in software usability, business, the semantic web, and
robotics. He currently works at MyVBO, a virtual business office that provides powerful tools to help
small to medium sized business manage their companies online. Over the years, he’s had the opportu-
nity to work on exciting projects and specializes in data portability, linked data, social media, and Rich
Internet Applications. His home on the web can be found at http://andrewcurioso.com/.
RONALD BRADFORD has more than two decades of professional IT industry experience in a broad
range of disciplines. His core expertise is in relational database management systems (RDBMS)
including MySQL, Oracle and Ingres. His technical software development skills include working
in Java (J2EE), PHP, Perl, Python, Web (HTML/CSS/XML/JSON), and Linux/Unix operating
systems. He is a professional speaker, educational curriculum developer, and writer who special-
izes in technical presentations, workshops, online content publishing, and knowledge transfer.
More information on his related MySQL writings, presentations and useful tools can be found at
http://ronaldbradford.com.
PATRICK GALBRAITH lives up in the sticks of southwestern New Hampshire near Mt. Monadnock
with his wife Ruth and son Kiran. Since 1993, he has been using and developing Open Source soft-
ware. He has worked on various Open Source projects including MySQL, federated storage engine,
memcached Functions for MySQL, Drizzle, Narada Search Engine Slashcode, and is the maintainer
of DBD::mysql. He has worked at a number of companies throughout his career, including MySQL
AB, Classmates.com, OSDN/Slashdot, and Lycos. He currently works at NorthScale, a leading
provider of scale-out infrastructure software for web applications. He is also part owner of a wire-
less broadband company, Radius North, which provides Internet service to underserved rural areas
of New Hampshire. His website, which comes by way of a 5.8GHz Alvarion access unit up in a pine
tree, is http://patg.net.
ALAN COLLISON is a software engineer with more than a dozen years of experience developing scal-
able PHP applications. His expertise ranges from the design and development of front end GUIs to
the implementation of core server side application business logic.
JAY COSKEY is a software developer and software development manager who lives in Seattle, and
has worked for companies including Cray Inc. and Amazon.com. He has used numerous languages
on Linux, Unix, and Windows platforms, in environments ranging from OS development, to web
and enterprise systems. When not involved in mathematics or software, he can sometimes be found
woodworking.
ERIC DAY has been writing high-performance servers and databases for most of his career and cur-
rently works on open source projects such as Drizzle and Gearman. He has also written a number of
extensions for higher level languages such as PHP. When not hacking on code, he can be found run-
ning, enjoying a good vegan meal, or blogging at http://oddments.org/.
KEN MACKE is a systems architect, developer, and owner of RockIP Networks — a provider of web
hosting and IT consulting services. Ken has over 15 years of experience creating cutting-edge software
with technologies such as PHP, C++, C#, and .NET. You can find Ken online at twitter.com/kmacke.
ELIZABETH NARAMORE has been a web developer since 1997, with a focus in PHP and E-commerce.
In addition to being a web developer, she is an author, editor, speaker, and educator, and active
member of communities such as the PHP Community, PHPWomen, and her local PHP Users Group.
TROND NORBYE is a Senior Software Engineer specializing in databases and distributed caching. He
currently works at NorthScale designing and implementing scale out data systems. Prior to joining
NorthScale, Trond was a key member of Sun Microsystems’ Web Scale Infrastructure group where
he worked on Drizzle, Gearman and Memcached. In his copious free time he is a core contributor
on the Memcached, Libmemcached and OpenGrok Open Source projects.
KARL WILBUR is an enterprise consultant, PHP developer and Linux guru with more than a decade
of LAMP experience and a passion for the bleeding-edge. When not out motorcycling the Midwest
he can be found lurking on the Internet at http://karlwilbur.net/.
IT WAS THANKS TO MY BROTHER RAY CURIOSO JR. that I was really able to get a head start. He
started an embroidery business in the 90s out of my parents’ garage. It has since moved to its own
place but there was that time in-between where, thanks to his company, I was one of the only people
that I knew with Internet access. It was slow and it took days to download software development
kits and it wasn’t as easy to fi nd programming help for a beginner as it is today. But I made do with
what I had. It was also because of him and his business — it needed an ecommerce site — that I put
down the C code and the ASP and got my start with PHP and MySQL.
I’d like to thank my parents too for being a constant source of support for me. It was my father who
taught me the value of hard work. And, of course, thank my wife who put up with me spending
long nights working for a start up and writing a book at the same time. We were married during the
writing and without her hard work planning the wedding, supporting me, and standing by my side
this book would not have been possible.
I’d like to thank my teammates at Lycos. It was truly a pleasure working with each of them. I’d
particularly like to thank my managers. Don Kosak for inspiring me, Neal Shanske for keeping me
on my toes. I’d like to thank Derek Bruneau since everything I learned about good software design
and usability I learned thanks to him. And I’d like to thank my fellow engineers Lisa Wallmark,
Chandra Yadav, and Kevin Harrington. I’d like to also thank my team at MyVBO, in particular
Robert (Bob) Wilkins and Matthew Sheppard for their understanding as I juggled work and writing.
Finally, I would also like to take a minute to thank the team that worked tirelessly to make this book
happen. Bob Elliott who made this book happen, Maureen Spears who edited this whole thing cover to
cover, and my co-authors Patrick and Ronald. Patrick in particular has been a good friend and deserves
credit for putting the team together. He is the one thread that connects us all. Which brings me to the
tech editors. They all did an amazing job and the book is much better because of each of them.
There are countless people who have helped me along the way. I am sure that I forgot someone. To
anyone who has ever encouraged me to follow my dreams or supported me in any way: thank you.
ÑAndrew Curioso
TODAY, I AM A WELL RESPECTED AUTHORITY in the MySQL field. This was not possible without a
lot of hard work and great mentorship. I would fi rst like to thank the late Frank Jarvis from DDIAE
(now USQ) who in 1988 introduced me to the works of C.J. Date, M. Stonebraker and E.F. Codd
during my university studies.
My fi rst relational database experience started with Ingres and led to immediate work with systems
design and software development in the database field. In the early 90’s, as a young, energetic and
knowledgeable database architect with several successful government projects, my work alongside
ÑRonald Bradford
ONE WEEKEND IN 1993, I had the chance to go on a getaway to San Diego. Instead, I opted to stay
home and download, onto 26 floppies, Slackware Linux, which I promptly installed onto my Packard
Bell 386. I could never get the built-in video card to work with X, so I ended up buying a separate video
card and had to edit my XConfig file to get it to work. How much more interesting this was to do than
editing a config.sys and an autoexec.bat! From then on, I was hooked. I worked at Siemens Ultrasound
Group in Issaquah, Washington, at the time. An engineer there named Debra, when asked what was a
good thing to learn, said something I’ll never forget: ‘‘Learn Perl.’’ Debra — you were right! I always
wanted to be a C ++ graphics programmer. That didn’t happen because of this thing called the World
Wide Web. I remember Ray Jones and Randy Bentson of Celestial Software showing me a program
called Mosaic, which allowed you to view text over the Internet. Images would be launched using XV.
Everywhere I worked, I had to write programs that ran on the Web, which required me to write CGI
in Perl. So much for my goal of being a C ++ programmer — but I consider this a great trade for a
great career. (I did eventually get to write C ++ for MySQL!) I would first like to thank my wife, Ruth,
for being patient and supportive of me for numerous lost weekends with this book and my previous
book Developing Web Applications with Perl, memcached, MySQL and Apache, as well as accepting
me working on yet another book so soon after the first! Next in line for thanks, our editor, Maureen
Spears, who is not only a great editor, but also a friend. Not only did she edit this current work, but she
was my editor for my previous book. Next, I would like to thank my co-authors, Andrew and Ronald.
It’s been a whole different experience co-authoring versus being a sole author, having learned a bit
about putting together something — as a team.
A special thanks goes to our tech editors as well as to Trond Norbye (memcached, libmemcached),
Eric Day (Gearman, Drizzle) and Andrew Aksyonoff (Sphinx) for stepping up as tech editors when
we were in a crunch and reviewing the material I wrote about their projects!
Thank you to Bob Elliott, who gave us the opportunity to work as a team to write this book!
Thanks to Monty Widenius for creating MySQL and for being a mentor as well as a good friend
who worked hard to include FederatedX into MariaDB while I was working on this book. Thanks
also to Brian Aker for being another great mentor and friend, as well as being a software-producing
machine with a scrolling page full of open source software projects that he’s created, including
Drizzle and libmemcached.
ÑPatrick Galbraith
INTRODUCTION XXIX
Object-Oriented PHP 2
Instantiation and Polymorphism 2
Interfaces 7
Magic Methods and Constants 8
Design Patterns 11
Using MySQL Joins 20
INNER JOIN 22
OUTER JOIN 24
Other JOIN Syntax 26
Complex Joins 27
MySQL Unions 28
GROUP BY in MySQL Queries 30
WITH ROLLUP 31
HAVING 32
Logical Operations and Flow Control in MySQL 33
Logic Operators 33
Flow Control 34
Maintaining Relational Integrity 35
Constraints 36
NOT NULL 36
UNSIGNED 36
ENUM and SET 37
UNIQUE KEY 37
FOREIGN KEY 38
Using Server SQL Modes 41
Storage Engine Integrity 45
What MySQL Does Not Tell You 45
What’s Missing? 46
Subqueries in MySQL 46
Subquery 46
Correlated Subquery 46
Derived Table 47
MySQL Drivers 88
About MySQL Storage Engines 89
Obtaining Storage Engine Information 89
Default Storage Engines 93
MyISAM 93
InnoDB 97
Memory 103
Blackhole 108
Archive 109
Merge 110
CSV 112
Federated 112
Other MySQL Supplied Engines 118
Falcon 118
Maria 120
Pluggable Engines 121
InnoDB Plugin 121
PBXT 122
XtraDB 123
xx
xxi
memslap 157
memerror 158
PECL/Memcached 158
Connecting, Instantiation 160
Setting Client Behavior 162
Putting and Retrieving Data 163
Append and Prepend 166
Delete 168
Increment and Decrement 168
Multi-get 169
Multi-set 170
Cache Locality Using byKey Methods and Multi get/set 171
getDelayed 173
CAS 174
Statistics 176
Server List 178
Error Handling 178
Practical Caching 180
memcached Proxy: moxi 185
Other “memcapable” Key-Value Stores 186
Tokyo Tyrant 187
Summary 188
xxii
Views 221
Access Permissions 223
Additional Information about Views 225
Stored Procedures and Functions 226
General Attributes 226
Stored Routine Logic 228
Using Stored Routines Privileges and Meta Data 230
Extending Stored Routines 231
Stored Routine Disadvantages 231
User Defined Functions 231
Triggers 232
No Triggers 233
Trigger Syntax 233
Insert Triggers 233
Update Triggers 234
Delete Triggers 235
Replace Triggers 236
Trigger Permissions 237
Transactions 237
Atomicity 238
Consistency 240
Isolation 242
Durability 247
Implied Commit 250
Replication 250
Replication Purposes 250
Replication Setup 251
Testing MySQL Replication 254
How Does MySQL Replication Work? 255
Testing MySQL Replication 259
Important Configuration Options 260
Important Replication Commands 261
Breaking Replication 261
Using Replication Selectively 262
The Issues with MySQL Replication 263
The Benefits of MySQL Replication 264
xxiii
“M. le Comte:
“I profit by this occasion to entertain you with freedom upon the
only really important matter at present, America and all that pertains
to it. I reasoned a long time, day before yesterday, with the man you
thought best to prevent coming to France. (Arthur Lee.) He
incessantly asks if we are going to do absolutely nothing for them.
And without wasting time in repeating to me how very important
their success is to France because he does us the honor of believing
that we agree with him on that point, he tells me simply, ‘We need
arms, powder, and above all engineers: only you can help us, and it
is to your interest to do so.’
“The Americans are as well placed as possible; army, fleet
provisions, courage, everything is excellent, but without powder and
engineers how can they conquer or even defend themselves? Are we
going to let them perish rather than loan them one or two millions?
Are we afraid of losing the money?
“Weakness and fear is all that one sees here....
“It is clear that the ministry is silent because it has nothing to
reply. Fear and anger on one side, weakness and embarrassment on
the other, this is the real condition. You would be still more
convinced of this truth if you will recall the nature of their treaties
with Germany and if you examine the rate of the new loan.... And
when this is well proved, is it really true, M. le Comte, that you will
do nothing for the Americans?
“Will you not have the goodness to show once more to the King
how much he can gain, without striking a blow, in this one
campaign? And will you not attempt to convince His Majesty that this
miserable pittance which they demand, and over which we have
been disputing for more than a year, will bring to us all the fruits of a
great victory without undergoing the dangers of a combat? That this
help can give to us while we sleep, all that the disgraceful treaty of
1763 made us lose? What greater view can occupy the council of the
king and what force your pleading will take on if you show the
reverse of the picture and count what the defeat of the Americans
will cost us. Three hundred millions—our men—our vessels, our
islands, etc. ... because their forces once united against us, their
audacity augmented by their great success, it is only certain that
they will force these same Frenchmen to support a fatal war which
two millions now would avert.
“In spite of the danger which I run in writing these daring
things from London, I feel myself twice as much French in London as
at Paris. The patriotism of this people stirs my own....”
As may be seen from this letter, Arthur Lee still inspired
complete confidence in the agent of the French government, so
much indeed that Beaumarchais gladly disclosed to him the plans
which he had formed for coming to the aid of the Americans.
So certain was he that France would ultimately yield to the
necessity of giving them secret support that he no doubt spoke with
indiscreet assurance on the subject. Exactly what passed between
the two men will never be known, but what is certain is, that during
the spring of 1776, Arthur Lee addressed to the secret committee of
Congress a letter in which he says:
“In consequence of active measures taken with the French
Embassy in London, M. de Vergennes has sent me a secret agent to
inform me that the French court cannot think of making war on
England but that she is ready to send five million worth of arms and
ammunition to Cap Français to be thence sent to the colonies.”
A careful analysis of this important missive will at once make
clear the profound misunderstanding which arose in the mind of the
secret committee of Congress regarding the true state of affairs in
France. So completely was every statement perverted that though
the whole bears a semblance of truth yet in reality nothing could be
further removed from it.
For instead of sending an agent to confer with Arthur Lee, M. de
Vergennes had steadily refused to enter into any relation whatever
with him. Instead of promising munitions of war for which
Beaumarchais had been pleading so long and so ardently, the
government continued to refuse to compromise itself by making any
statement regarding them.
And yet in judging Arthur Lee, whether he intentionally distorted
the truth or only indulged in what he considered a harmless
exaggeration, we must not forget that this letter with its assurances
of help, arriving at the moment which it did, had a profound
influence in shaping men’s minds for independence.
As regards Lee himself, the letter had the effect of greatly
augmenting his credit with Congress. Silas Deane was already on his
way to France, charged with an express commission to secure
munitions of war on credit, so it was determined to join Arthur Lee
to the commission as soon as it could be brought about.
But to return to the French court. The first intimation of
anything like an avowed approval of the plans of Beaumarchais is to
be found in a letter of M. de Vergennes under date of May 2, 1776.
He wrote:
“I have received the first of this month, Monsieur, the letter with
which you honored me, written the 26th of last month.”
Then follows a lengthy preamble in which the count, speaking
as an observer of men and one used to dealing with them,
continues:
“This preface is not destined to refute your foresight, which on
the contrary I praise and approve. But do not suppose that because
your plans are not immediately acted on, that they are rejected.
Although the method which I employ is sure, I am forced to curb the
desire which I feel to express to you all my thoughts, therefore, I
rely upon your sagacity to divine them. Think well and you will find
that I am nearer to you than you imagine.... A thousand thanks,
Monsieur, for the news items which you communicate to me, they
have been seen and relished.... I have delivered the letter which you
recommended to me; if an answer comes I will forward it to you. I
flatter you that you know my friendship and attachment for you.
“de Vergennes.”
This was not at all what Beaumarchais had been planning and
preparing. In the next chapter we shall see him with his usual
flexibility abandon his own ideas and adopt those of the ministry,
since they tended to the same end. In the meantime he was
addressing the following letters to Vergennes:
“Monsieur le Comte:
“There is nothing very important here but the news of the
evacuation of Boston, which arrived three days ago....
“The government assumes an air of approbation, of mystery, of
intelligence even. It wishes to have it considered as a ruse of the
ministry, but that does not take. It is too certain that the
impossibility to hold Boston from lack of provisions has driven the
English away....
“All this confirms what I announced in my last dispatch, that the
Americans are in good condition everywhere, engineers and powder
excepted. I thank you for your obliging goodness in regard to my
affair at Aix. I thank you also for the honorable encouragement
which the approbation of the king and your own gives to my
enterprise.... Say what you will, M. le Comte, a little exaltation in the
heart of an honest man, far from spoiling him for action vivifies
everything he touches, and enables him to do more than he would
have dared to promise from his natural capacity. I feel this
exaltation, it remains for my prudence to direct it in a way that turns
to the good of the affairs of the king. Conserve for me his esteem,
Monsieur le Comte.
“Ah, Monsieur le Comte, as a favor ... some powder and
engineers! It seems to me that I never wanted anything so much....”
(Given by Gaillardet.)
Three days later, London, May 11, 1776.... “All the quarrels for
the last eight days are in relation to the quomodo of the evacuation
of Boston. The opposition and the ministry are openly tearing out
each other’s eyes about it. The whole affair consists of the doctors
deciding how the sick man died. Let them dispute over that great
coffin. The couriers arrive at every moment.... To-morrow all the
news of the American papers will be printed in the English ones. The
whole affair begins to clear up. You were certainly very near me as
you said, when I imagined you very very far.”
(Gaillardet.)
CHAPTER XVIII
Look upon my house, gentlemen, from henceforward as the
chief of all useful operations to you in Europe, and my person as one
of the most zealous partisans of your cause, the soul of your success
and a man most deeply impressed with the respectful esteem with
which I have the honor to be....
“Roderigue Hortalès et Compagnie”
Beaumarchais to the Secret Committee of Congress, Aug. 15, 1776.
O Nwrote
the 24th of May, 1776, Beaumarchais returned to France. He
to the Count de Vergennes the same night:
“Monsieur le Comte,
“I arrive very tired, completely exhausted. My first care is to ask
you for your orders and the hour when you will be so good as to
give me audience. It is three o’clock in the morning. My negro will
be at your levée, he will be back for mine. I hope he will bring me
the news which I desire with the greatest impatience, which is to go
in person, and assure you of the very respectful devotion with
which, I am, M. le Comte, yor very humble and very obedient
servitor, Beaumarchais.”
(Doniol.)
SILAS DEANE
“Two months later, Spain advanced the like sum, besides which
Beaumarchais had associated with himself numerous private
individuals in France and elsewhere, so that his first sending to the
Americans surpassed in itself alone, three millions.” (Loménie, II, p.
110.)
Early in June the vast mercantile house of Roderigue Hortalès et
Cie. was established at Paris, while agents, clerks, and employees of
every sort were installed at the center of operations, as well as at
the various sources of supplies and in the seaports, Beaumarchais
remaining the head and center of action, in every place.
It so happened at this time, that a complete change was being
made in the equipment of the French army, so that the arsenals and
forts were charged with munitions of war, which the government
was willing to dispose of at a nominal price.
Before the arrival of Beaumarchais on the scene of action, the
Comte de Vergennes had countenanced and furthered the
operations begun by Franklin before he left London. Among the
agents employed by the latter were the Brothers Mantaudoin of
Nantes, who had undertaken the transportation of munitions of war
to the Americans. (Doniol, I, p. 373.)
Another agent and intimate friend of Franklin was a certain
Doctor Dubourg, a man more or less widely known as a scientist, but
possessing as well a decided taste for mercantile operations. He had
entered heartily into the cause of the Americans, and was very
zealous in forwarding munitions of war to the insurgents. He seems
at the beginning to have possessed to a considerable degree the
confidence of the French minister, who deigned to correspond with
him in person, and to consult him on several occasions. But as it
became necessary “to act on a grander scale, the intervention of the
friend of Franklin was no longer sufficient.” (Doniol, p. 374.) The
“faithful and discreet agent” spoken of in the Réflexions had long
been fixed in the mind of the Minister of War. The good doctor who
knew nothing of the relationship between the famous author of the
Barbier de Séville and the French Government or of his interest and
services in the cause of American Independence, all along had been
secretly aspiring to a complete control of the transactions. What
succeeded in convincing him that he was the man destined for the
place was that early in June, 1776, Silas Deane, the agent of the
Secret Committee of Congress, arrived in Paris charged with a letter
from Franklin to his “dear good friend Barbeu Dubourg,” with
express instructions to regard this latter as “the best guide to seek
after and to follow.” (Doniol, V. I, p. 485.)
Elated at this mark of esteem shown him by the colonies, the
good doctor undertook to fulfill then to the letter the instructions of
Congress and to prevent Silas Deane from coming in contact with
anyone but himself. Deane soon realized that though “inspired with
the best intentions in the world,” the doctor would be a “hindrance
rather than the essential personage pointed out by Franklin.”
(Doniol.) He therefore insisted so strongly upon meeting the French
minister that Dubourg was forced to yield. The meeting took place
the 17th day of July, 1776.
“It must be said of Silas Deane at this important meeting that
he fulfilled the intention of his mandate not only with intelligence,
but with a fecundity of reasoning which could only come from a
vigilant patriotism. All the impression which he could desire to
produce and which was hoped from his mission flowed from his
replies.” (Doniol, V. I, p.491.)
The Comte de Vergennes appeared to refuse to give the aid
asked, but he led Silas Deane to understand that a confidential
agent would take the matter in charge. This confidential agent was
no other than Beaumarchais.
Four days before this interview, the Doctor Dubourg had learned
to his great disappointment where the confidence of the minister
had been placed. Knowing nothing of the real situation, he thought
to dissuade the latter from his choice by attacking the private
character of the man who had usurped his place. The effect of his
letter upon the Comte de Vergennes can be judged from the fact
that the latter immediately communicated it to Beaumarchais
himself, who was charged with the reply.
The Doctor wrote:
“Monseigneur:
“I have seen M. de Beaumarchais this morning and conferred
with him without reserve. Everyone knows his wit, his talents, and
no one renders more justice to his honesty, discretion and zeal for all
that is good and grand; I believe him one of the most proper men in
the world for political negotiations, but perhaps at the same time,
the least proper for mercantile enterprises. He loves display, they say
that he keeps women; he passes in a word for a spendthrift and
there is not a merchant in France who has not this idea of him and
who would not hesitate to enter into the smallest commercial
dealings with him. Therefore, I was very much astonished when he
informed me that you had charged him not only to aid you with his
advice but had concentrated on him alone the ensemble and the
details of all the commercial operations....
“I represented to him that in taking the immense traffic and
excluding those who already had run so many dangers and endured
so many fatigues ... it would be doing them a real wrong.... But I
return to my first and principal reflection and implore you,
Monseigneur, to weigh it well. Perhaps there are a hundred, perhaps
a thousand persons in France with talents very inferior to those of M.
de Beaumarchais, who would fill better your views, inspire more
confidence, etc., etc....”
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.
ebookname.com