Building RESTful Web Services with PHP 7 Ahmad instant download
Building RESTful Web Services with PHP 7 Ahmad instant download
download
https://textbookfull.com/product/building-restful-web-services-
with-php-7-ahmad/
https://textbookfull.com/product/building-restful-web-services-
with-java-ee-8-create-modern-restful-web-services-with-the-java-
ee-8-api-mario-leander-reimer/
https://textbookfull.com/product/restful-java-web-services-a-
pragmatic-guide-to-designing-and-building-restful-apis-using-
java-3rd-edition-balachandar/
https://textbookfull.com/product/integrating-web-services-with-
oauth-and-php-a-php-architect-guide-1st-edition-matthew-frost/
https://textbookfull.com/product/php-web-services-apis-for-the-
modern-web-2nd-edition-lorna-jane-mitchell/
https://textbookfull.com/product/client-server-web-apps-with-
javascript-and-java-rich-scalable-and-restful-1st-edition-
saternos-casimir/
https://textbookfull.com/product/safety-of-web-applications-
risks-encryption-and-handling-vulnerabilities-with-php-eric-
quinton-auth/
https://textbookfull.com/product/php-8-quick-scripting-reference-
a-pocket-guide-to-php-web-scripting-third-edition-mikael-olsson/
https://textbookfull.com/product/building-web-and-mobile-arcgis-
server-applications-with-javascript-lewin/
Building RESTful Web Services with PHP 7
BIRMINGHAM - MUMBAI
Building RESTful Web Services
with PHP 7
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, nor Packt Publishing, and its dealers and distributors will be held
liable for any damages caused or alleged to be caused directly or indirectly
by this book.
ISBN 978-1-78712-774-6
www.packtpub.com
Credits
I would like to thank my family for making my life easy and full of
happiness.
www.PacktPub.com
For support files and downloads related to your book, please visit www.PacktP
ub.com.
Did you know that Packt offers eBook versions of every book published,
with PDF and ePub files available? You can upgrade to the eBook version
at www.PacktPub.com and as a print book customer, you are entitled to a
discount on the eBook copy. Get in touch with us at [email protected] for
more details.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full
access to all Packt books and video courses, as well as industry-leading
tools to help you plan your personal development and advance your career.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Customer Feedback
Thanks for purchasing this Packt book. At Packt, quality is at the heart of
our editorial process. To help us improve, please leave us an honest review
on this book's Amazon page at https://www.amazon.com/dp/B075CK8S7D.
If you'd like to join our team of regular reviewers, you can e-mail us at
[email protected]. We award our regular reviewers with free
eBooks and videos in exchange for their valuable feedback. Help us be
relentless in improving our products!
Table of Contents
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Downloading the example code
Errata
Piracy
Questions
1. RESTful Web Services, Introduction and Motivation
Web services
Why a web service?
REST architecture
Client server
Stateless
Cache-able
Uniform interface
Resource identification
Manipulation of resources through representations
Self-descriptive messages
Hypermedia as the engine of application state (HATEOAS)
Code on demand (optional)
Layered system
RESTful web services
Conventions of RESTful web services
HTTP verbs and URL structure
List operation
Create operation
READ operation
Update operation
Delete operation
Why RESTful web services?
REST versus SOAP
Nature of HTTP methods
Safe/unsafe HTTP methods
Idempotent and non-idempotent methods
HTTP response
Response type
Response codes
Case study - RESTful web service endpoints for a blog
Blog post
Requirements
Endpoints
Creating blog post
Reading blog post
Updating blog post
Delete blog post
Listing all blog posts
Blog post comments
Requirements
Endpoints
Creating the post's comment
Reading a comment
Updating a comment
Deleting a post comment
Listing all comments for a particular post
More resources
Summary
2. PHP7, To Code It Better
Scalar type declaration
Return type declaration
Null coalescing operator
Spaceship operator
Group use declarations
Generator-related features
What are generators?
Generator return expression
Generator delegation
Anonymous classes
Closure::call()
Errors and exceptions
PHP7.1
Nullable types
Symmetric array destructuring
Support for keys in list()
Multi-catch exception handling
More resources
Summary
3. Creating RESTful Endpoints
Creating a REST API for a blog in PHP
Creating a database schema
Blog user/author table schema
SQL for users table
Blog post table schema
Blog post comments schema
Creating a RESTful API's endpoint
Code structure
Common components
DB class
Router class
Code sync
Creating blog post endpoints
REST client
To do
Visible flaws
Validation
Solution
Authentication
Solution
Proper 404 pages
Summary
4. Reviewing Design Flaws and Security Threats
Finding problems in the current code
Structural and design flaws
Missing query builder layer
Incomplete router
Usage of OOP
Separate Configurations from Implementation
Should write tests
Input validation
Handling 404 and other errors
Meta information missing
DB fields abstraction
Security
Securing API endpoints
What is Auth middleware?
Common security threats in RESTful web services
Use of HTTPS
Securing an API key/token
Not passing an access token in the URL
Access token expiration
Limited scope access token
Public and private endpoints
Public API endpoints
Insecure direct object reference
Restricting allowable verbs
Input validation
Available reusable code
Summary
5. Load and Resolve with Composer, an Evolutionary
Introduction to Composer
Installation
Installation on Windows
Installation on Linux/Unix/OS X
Global Installation
Usage of Composer
Composer as a dependency manager
Installing packages
Installing using composer.json
The composer.json in detail
The require object
The require-dev object
The autoload and autoload-dev
The scripts
The composer.lock
Composer as an auto-loader
Example
Composer for creating a project
Example
Summary
6. Illuminating RESTful Web Services with Lumen
Introducing Lumen
Why micro-framework?
Why Lumen?
What Lumen provides
What Lumen has in common with Laravel
How Lumen is different from Laravel
What exactly Lumen provides
A Good Structure
Separate configurations
Router
Middle-wares
Service Container and Dependency Injection
HTTP responses
Validation
Eloquent ORM
Database migration and seeding
Unit testing
Installing Lumen
Configuration
Setting up the database
Writing migrations
Writing RESTful web service endpoints
Writing the first controller
Lumen routes
REST resource
Eloquent ORM (model layer)
Creating models
Eloquent relationships
Controller Implementation
What we are missing?
Validation and negative cases?
/api/posts with GET method
/api/posts with the POST method
/api/posts/1 with the GET method
/api/posts/1 with the PATCH/PUT method
/api/posts/1 with the DELETE method
User authentication
Other missing elements
Comment Resource Implementation
Summary
7. Improving RESTful Web Services
Dingo, simplifying RESTful API development
Installation and configuration
Simplifying routes
API versioning
Rate limiting
Internal requests
Responses
Authentication and middleware
JWT Auth setup
The Manual way
Simpler way through Lumen JWT authentication integration
package
Authentication
Log in
Invalidate token
Refresh token
Transformers
Understanding and setting transformers
Using transformers
Encryption
SSL certificate, different options
Summary
8. API Testing – Guards on the Gates
The need for automated tests
Types of testing
Unit testing
Acceptance testing
Functional testing
Integration testing
What type of testing will we do?
Testing frameworks
CodeCeption introduction
Setup and understanding the structure
tests/{suite-name}/
tests/{suite-name}.suite.yml
tests/_support/_generated/{suite-name}TesterActions.php
tests/_support/{suite-name}Tester.php
tests/_support/Helper/{suite-name}.php
Creating the API suite
Configuring the API suite
Writing test cases
API tests for post resource
Other test cases
Summary
More resources
9. Microservices
Introducing Microservices
How to divide an application into microservices?
Motivation towards microservices
Maintenance and debugging
Scalability
Technology diversity
Resilience
Replaceability
Parallelization
How it is different from SOA
Team structure
Challenges of micro-services
Infrastructure maintenance
Performance
Debugging and fault-finding
Logs should be centralized
Logs should be searchable
Track chain of requests
Dynamic log levels
Implementation
Deployments
Inter-services communication
Synchronous communication
Asynchronous communication
Shared library or common code
Summary
What's next
Preface
Web services has always been an important topic. With REST, things
became simpler and better. Nowadays, RESTful web services are widely
used. It was important a decade ago, but Single Page Applications (SPAs)
and mobile applications have increased its usage greatly. The aim of this
book is to educate PHP developers about the RESTful web services
architecture, the current tools available to efficiently create RESTful web
services such as a micro-framework named Lumen, automated API testing,
the API testing framework, security and microservices architecture.
In other words, although this book is intended for PHP developers, it will
benefit them beyond just PHP. So, this book is not a cookbook, but a
journey in which you start learning about RESTful webservices and PHP7
and then start building RESTful web services. You can then keep improving
your RESTful web services by learning about the problems in it and fixing
those. During such improvements, you will learn the different things in PHP
and benefit even beyond PHP.
What this book covers
Chapter 1, RESTful Web Services, Introduction and Motivation, introduces
you to web services, REST architecture, the RESTful web services, and its
comparison to other web services such as HTTP verbs and RESTful
endpoints. It also explains web services through the example of a blog and
then talk about the response format and response code.
Anyone who has some basic PHP knowledge and wants to build
RESTful web services.
Developers who know basic PHP and have developed a basic dynamic
website and want to build a RESTful web service.
Developers who have learned PHP and worked mostly in open source
CMS, such as WordPress, and want to move toward developing
custom applications where a web service needs to be built.
Developers who are stuck with legacy systems done in Code Igniter
and want to explore the modern ecosystem of PHP.
Developers who have used modern frameworks such as Yii or Laravel,
but are not sure about the critical pieces required to build the REST
API that not only serves the purpose but works well in the long run,
something that doesn't always need manual testing and is maintainable
and extendable.
Seasoned PHP developers who have created a very basic API that
returns data but want to make themselves familiar with how it should
be done according to REST standards, how it will work when
authentication comes into the picture, and how to write tests for it.
Conventions
In this book, you will find a number of text styles that distinguish between
different kinds of information. Here are some examples of these styles and
an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file
extensions, pathnames, dummy URLs, user input, and Twitter handles are
shown as follows: "The randGen() method takes two parameters defining the
range of the returned value."
New terms and important words are shown in bold. Words that you see on
the screen, for example, in menus or dialog boxes, appear in the text.
Once the file is downloaded, please make sure that you unzip or extract the
folder using the latest version of:
The code bundle for the book is also hosted on GitHub at https://github.co
m/PacktPublishing/Building-RESTful-Web-Services-with-PHP-7. We also have
other code bundles from our rich catalog of books and videos available at ht
tps://github.com/PacktPublishing/. Check them out!
Another Random Scribd Document
with Unrelated Content
good-bye, Mr. Lowe; in six weeks you’ll have me back again,” and if we
have quarrelled, it does not signify; but it would be very different if it was
for ever. Why, I should cry my eyes out.’
“One day, however, when Mrs. Lowe was inveighing against the
absurdity of the marriage service—of the bridegroom’s statement, ‘With all
my worldly goods I thee endow,’ even when he possessed nothing and it
was just the other way, and when she was saying, ‘Now when I married Mr.
Lowe, he had nothing whatever but his brains’—a deep voice from the end
of the room growled out, ‘Well, my love, I certainly did not endow you with
those.’
“‘Why contend against your natural advantages?’ said Mr. Lowe one day
to a deaf friend who was holding up an ear-trumpet to listen to a bore.
“In the afternoon I drove down with Lady Sherborne, Miss Dutton, and
Miss Elliot to see Lord Russell at Pembroke Lodge. It is a beautiful place;
not merely a bit of Richmond Park, but a bit of old forest enclosed, with
grand old oaks and fern. The Queen gives it to Lord Russell, who, at eighty-
four,[209] was seated in a Bath-chair in the garden, on a sort of bowling-
green, watching his grandsons play at tennis. Though he no longer
comprehends present events, he is said to be perfectly clear about a far-
away past, and will converse at any length about Napoleon, the escape from
Elba, &c. When I was presented to him, by way of something to say, I
spoke of having seen the historical mound in his garden, and asked what it
was that Henry VIII. watched for from thence as a death-signal, ‘was it a
rocket or a black flag?’
“‘It was a rocket.’
“‘Then that would imply that the execution was at night, for he would
hardly have seen a rocket by day.’
“‘No, it was not at night; it was very early in the morning. She was a
very much maligned woman was that Anne Boleyn.’
“We all sat by a fountain under the oak-trees, and then went into the
house to a sort of five-o’clock tea on a large scale.”
“Highcliffe, July 24.—In this most unearthly Paradise all looks like last
year going on still—the huge stems of chestnut, and the white lilies and
bulrushes in the great vase relieved against the old boiserie of the saloon;
the wide window-porch open to the fountain and orange-trees and sunlit
terraces and sea; Lady Waterford coming in her hat and long sweeping dress
through the narrow wind-blown arbutus avenue; old Mrs. Hamilton-
Hamilton in her pleasant sitting-room, with Miss Lindsay hovering about
and waiting on her like a maid-of-honour; the Ellices, so cordial and
pleasant, so beaming with kindness and goodness, their largeness of heart
quite preventing their being able to indulge in the sectarian part of their own
religious ideas.... I have felt, as I always do very shy at first, and then
entirely at home.”
HOLMHURST.
“July 25.—We have all, I think, basked as much in the mental sunshine
of this beautiful life as in the external sunshine which illumines the brilliant
flowers and glancing sea.
“We walked on the shore this afternoon. ‘See what festival the sea has
been making, and what beautiful coloured weeds she has been scattering,’
said Lady Waterford. We found two little boots projecting from the sand,
and as we dug them out and found them filled and stiff, we really expected a
drowned child to follow; but it was only sand that filled them, and the little
Payne child of Chewton Bunny had lost them when bathing. As we sat on
the shore while Lady Waterford looked for fossils, a staith came down from
the Bunny and flooded the little stream into a river, cutting off our return.
We, the male part, crossed much higher up: Lady Waterford plunged in and
walked: Lady Jane took off shoes and stockings and waded.
“Lady Waterford has talked much of marriages—how even indifferent
marriages tone down into a degree of comfort which is better for most
women than desolation.”
“July 26.—We walked in the evening to the Haven House. The old pine-
wood, with its roots writhing out of the sand, and its lovely views, over still
reaches of water to the great grey church, and the herons fishing, are more
picturesque than ever. Afterwards Lady Herbert of Lea arrived with her
beautiful daughter Gladys.[210] Lady Herbert is suffering still from the bite
of a scorpion when she was drawing in the ruins of Karnac.”
Louisa, Marchioness of Waterford.
From a Photograph by W. J. Reed. Bournamouth.
“July 31.—Lady Jane Ellice says that there are three shades of people
one likes—those whom one must see in heaven, for it would not be heaven
without them: those whom one hopes to see in heaven and to meet there:
and those whom one hopes will be in heaven but that one will not see them
there. Her singing this evening of ‘Zurich’s Blue Waters,’ ‘Three Blue
Bottles,’ &c., has been perfectly charming.
“Lady Waterford has been telling of Ruskin ‘like a little wizened rat.’
‘He likes to be adored, but then Somers and I did adore him, and he likes to
lash his disciples with rods of iron. I do not mind that: it is his jokes I
cannot bear; they make me so sorry and miserable for him.’”
“August 5.—I have left Highcliffe, and the gates of Paradise seem closed
for a year. There has been the usual perfect confidence about everything
through the whole party: the pleasant going backwards and forwards to
‘Hamilton Place,’ and the waiting upon old Mrs. Hamilton of her ‘equerry’
and her ‘maid-of-honour:’ the many friendly snubs and contradictions
which rail at all the smallnesses and ennoble all the higher aims of life.
After luncheon we all sat in the porch surrounded by the great lilies and
geraniums in flower and we had coffee there, looking upon the Isle of
Wight with the Needles looming through the mist: then we parted.
“It was a long drive in pouring rain from Southampton to Sydney Lodge,
where I found a warm welcome from dear old Lady Hardwicke.[211] It is a
moderate house, with large gardens, into which bits of old forest are
interwoven. This morning we drove to Eliot Yorke’s house at Netley Fort,
an old tower of the monks, in front of which the Mayflower set sail. The
situation is lovely, close to the sea, with a hilly garden in miniature and a
machicolated tower rising out of ivy walls like a scene in a play. But the
great charm is in Eliot himself, so handsome, with such a pleasant smile and
melodious voice. His Jewess wife, Agneta Montagu, and Hinchinbroke
were there. From the garden we went to the Abbey, where I drew while
Hinchinbroke amused himself by pretending to make love to an old lady
(‘Jemima Anne’) who was peering about in spectacles amongst the arches.
When we went back, boats were arriving from Cowes at the little wharf—
the Prince Imperial with the Duke and Duchess of St. Albans and a crowd
of others. The Prince has the most pleasant, frank, simple manners, and
makes himself agreeable to every one. He was much amused with the
quantities of Yorkes who seemed to crop up from every house round, and
said he ‘thought he must have landed by mistake on the coast of Yorkshire.’
His arm was in a sling, and he looked pale and fagged, for somehow, in
playing at leap-frog with his ‘camarades,’ he had tumbled into a camp-fire,
and, to save his face, had instinctively put out his hands, and burnt the
whole skin off one of them. It must have been terrible agony, but he never
complained.”
“Holmhurst, Sept. 1.—I had rather dreaded the tête-à-tête journey with
the Duchess to-day, and truly it was a long one, for we had an hour to wait
at Ampthill Station, and then missed the express at Bletchley. When we first
got into the carriage the Duchess said, ‘Well, now, I am going to be quiet
and rest my eyes,’ which I thought was a hint that I was to take my book;
but very soon she got bored and said, ‘I can’t see, and am obliged to go on
asking the names of the stations for want of being amused;’ so then I was
obliged to talk to her all the rest of the way.
“At Ampthill she told me how she was going to London to meet Admiral
Inglefield, who was going to help her to ‘pick a child out of the gutter.’
‘That child,’ she said, ‘will some day be Earl Powlett. Lord Powlett took a
wager that he would run away with the lady-love of one of his brother-
officers, and he did run away with her; but she made it a condition that he
should marry her before a Registrar, which he believed was illegal, but it
was not, and they were really married. Her only child, a boy, was brought
up in the gutter. His name is Hinton, and he is presentable,[216] which his
wife is not, for she is a figurante at the opera; but she gets more than the
other danseuses, because she has the courage to stand unsupported upon a
tight-rope, which the others have not. Powlett offered his son £400 if he
would go away from England and never come back again, but he refused,
so then he would only give him £100. He lives by acting at small theatres,
but sometimes he does not live, but starves. He had four children, but one is
dead. It is the eldest I mean to take away and place with a clergyman and
his wife, that he may learn something of being a gentleman. I shall
undertake him for three years, then I shall see what he is likely to be fit for.
If I live so long, I can settle it; if not, I must leave the means for it. Facts are
stranger than fiction.’
“At the stations, the Duchess was perfectly furious at the bonnets she
saw. ‘If any respectable persons had gone to sleep twenty years ago and
woke up now, they would think it was Bedlam let loose.’ She said how
Count Streletski, who had travelled everywhere, said there was no country
in which people were satisfied with nature: if tall, they wished to make
themselves short; if short, tall: if they were light, they wished to be dark,
and vice versâ. She talked of the peculiarities of vanity in different people
—how the first Lady Westmoreland made the coiffeur wait and touch her
up when she was in the carriage.
“The Duchess parted from me at Euston Station, with a cordial invitation
to Osterley.”
“Sarsden, Oct. 5.—Last night Mrs. Stewart talked much of Hanover and
her life there. Her daughter was lady-in-waiting to the Queen. She described
how all the royal family might have their property back at once, but the
King would make no concession—‘God has given me my crown; I will
only give it back to Him.’
“Mrs. Stewart was with the Queen and Princess for five months at
Herrenhausen after the King left for Langensalza, when ‘like a knight, he
desired to be placed in the front of his army, where all his soldiers could see
him, and where he was not satisfied till he felt the bullets all whizzing
around him.’ The people in Hanover said he had run away. When the Queen
heard that, she and Princess Marie went down to the place and walked
about there, and, when the people pressed round her, said, ‘The King is
gone with his army to fight for his people; but I am here to stay with you—
to stay with you till he comes back.’ But alas! she did not know!
“All that time in Herrenhausen they were alone: only Mrs. Stewart and
her daughter went out occasionally to bring in the news; the others never
went out. At last the confinement became most irksome to the Princesses.
They entreated Mrs. Stewart to persuade mama to let them go out. Mrs.
Stewart urged it to the Queen, who said, ‘But the Princesses have all that
they need here; they ought to be satisfied.’—‘Pardon me, your Majesty,’
said Mrs. Stewart; ‘the Princesses have not all they need; it is necessary for
young people to have some change.’ ‘So,’ said Mrs. Stewart, ‘at last the
Queen saw that it was well, and she consented. She said, “We will not take
one of our own carriages, that would attract too much attention, but we will
take Harty’s—that is, my daughter’s—carriage, and we will drive in that;”
for the Queen had given Harty a little low carriage and a pony. So they set
off—the Queen, Princess Marie, and only the coachman besides. And when
they had gone some way up the hills, the pony fretted under the new traces
and broke them, and, before they knew where they were, it was away over
the hedges and fields, and they were left in the lane with the broken
carriage. Two Prussian officers rode up—for the Prussians were already in
Hanover—and seeing two ladies, beautiful ladies too (for the Queen is still
very handsome), in that forlorn state, they dismounted, and, like gentlemen
as they were, they came up hat in hand, and offered their assistance. The
Queen said, “Oh, thank you; you see what has happened to us: our
coachman has gone after the pony, which has run away, and no doubt he
will soon come back, so we will just wait his return.” But the coachman did
not come back, and the gentlemen were so polite, they would not go away,
so at last the Queen and Princess had to set out to return home; and the
officers walked with them, never having an idea who they were, and never
left them till they reached the gates of Herrenhausen. So the Queen came in
and said, “You see what has happened, my dear; you see what a dreadful
thing has befallen us: we will none of us ever try going out again,” and we
never did.
“‘We used to go and walk at night in those great gardens of
Herrenhausen, in which the Electress Sophia died. The Queen talked then,
God bless her, of all her sorrows. We often did not come in till the morning,
for the Queen could not sleep. But, even in our great sorrow and misery,
Nature would assert herself, and when we came in, we ate up everything
there was. Generally I had something in my room, and the Queen had
generally something in hers, though that was only bread and strawberries,
and it was not enough for us, for we were so very hungry.
“‘One night the Queen made an aide-de-camp take the key, and we went
to the mausoleum in the grounds. I shall never forget that awful walk, Harty
carrying a single lanthorn before us, or the stillness when we reached the
mausoleum, or the white light shining upon it and the clanging of the door
as it opened. And we all went in, and we knelt and prayed by each of the
coffins in turn. The Queen and Princess Marie knelt in front, and my
daughter and I knelt behind; and we prayed—oh! so earnestly—out of the
deep anguish of our sorrow-stricken hearts. And then we went up to the
upper floor where the statues are. And there lay the beautiful Queen, the
Princess of Solms, in her still loveliness, and there lay the old King, the
Duke of Cumberland, with the moonlight shining on him, wrapped in his
military cloak. And when the Queen saw him, she, who had been so calm
before, sobbed violently and hid herself against me—for she knows that I
also have suffered—and said in a voice of pathos which I can never forget,
“Oh, he was so cruel to me, so very, very cruel to me.” And after that we
walked or lingered on the garden-seats till daylight broke.
“‘The Queen was always longing to go away to her own house at
Marienberg, and at last she went. She never came back; for, as soon as she
was gone, the Prussians, who had left her alone whilst she was there,
stepped in and took possession of everything.
“‘The Queen is a noble, loving woman, but she is more admirable as a
woman than a queen. I have known her queenly, however. When Count von
Walchenstein, the Prussian commandant, arrived, he desired an interview
with her Majesty. He behaved very properly, but as he was going away—it
was partly from gaucherie, I suppose—he said, “I shall take care that your
Majesty is not interfered with in any way.” Then our Queen rose, and in
queenly simplicity she said, “I never expected it.” He looked so abashed,
but she never flinched; only, when he was gone out of the room, she fainted
dead away upon the floor.
“‘The mistake of our Queen has been with regard to the Crown Prince.
She has had too great motherly anxiety, and has never sent out her son, as
the Empress Eugenie did, to learn his world by acting in it and by suffering
in it.”
“To-day Mrs. Stewart has been talking much of the pain of age, of the
distress of being now able to do so little for others, of being ‘just a creature
crawling between heaven and earth.’ She also spoke much of ‘the comfort
of experience,’ of scarcely anything being quite utterly irrevocable; that ‘in
most things, most crimes even, one can trail, trail oneself in the dust before
God and man.’
“In the morning Mrs. Stewart sat for her portrait to Madeleine, in her
picturesque square head-dress. She was pleased at being asked to sit. ‘Il faut
vieillir pour être heureuse,’ she said. She talked much whilst she was sitting
—much of Lady H.’s insolent and often unfeeling sayings. She spoke of a
doctor who had the same inclination, and said to her, ‘Ça ne me repugne pas
de dire les vérités cruelles.’ Talking of self-respect, she quoted the maxim of
Madame George Sand—
And added, ‘But who should one be well with if not with oneself, with
whom one has to live so very much.’
“This morning Lady Ducie’s pet housemaid gave warning, because, she
said, Lady Ducie was not so sympathetic to her as she was six weeks ago.
She said that as Lady Ducie was now not nearly so nice to her as she had
been, she should be obliged to marry a greengrocer who had proposed to
her.
“In the afternoon we drove to Daylesford—Warren Hastings’ so beloved
home. It is a very pretty place, picturesque modern cottages amid tufted
trees, and a very beautiful small modern church on a green. This church was
built by Mr. Grisewood, and supplants a so-called Saxon church, restored
after a thousand years of use by Warren Hastings. The inscription
commemorating his restoration still remains, and ends with the text—‘For a
thousand years in thy sight are but as yesterday.’ The tomb of Warren
Hastings, a yellow urn on a pedestal, stands in the churchyard just under the
east window. He left the place to his wife’s son by her first husband, Count
Imhoff. Lady Ducie remembers Countess Imhoff coming to visit her
mother, always with a great deal of state, and always dressed in white satin
and swansdown, like one of Romney’s pictures. Mr. Grisewood succeeded
the Imhoffs, and, when his son became a Roman Catholic, sold the place to
Mr. Bias. We drove to the house, which stands well—a comfortable yellow
stone house in pretty grounds, with a clear running stream. Its
reminiscences and the power of calling them up made Mrs. Stewart speak
with great admiration of those who ‘could find the least bit of bone and
create a mastodon.’
“In returning, Mrs. Stewart told the story of Miss Geneviève Ward, the
actress. In early life she was travelling with her mother, when they fell in
with a handsome young Russian, Count Constant Guerra. He proposed to
her, and as the mother urged it, thinking it a good match, she married him
then and there in her mother’s presence, without witnesses, he solemnly
promising to make her his wife publicly as soon as he could. When he
could, he refused to fulfil his promise; but the mother was an energetic
woman, and she appealed to the Czar, who forced Guerra to keep his word.
He said he would do what the Czar bade him, but that his wife should suffer
for it all her life. To his amazement, when the day for the marriage arrived,
the bride appeared with her mother, led to the altar in a long crape veil as to
a funeral. Her brothers stood by her with loaded pistols, and at the door of
the church was a carriage into which she stepped as soon as the ceremony
was over, and he never saw her again. She is Madame Constant Guerra, and
has acted as ‘Guerrabella.’
“When we came home, I told a story in Lady Ducie’s sitting-room. Then
Lord Denbigh told how—
“‘Sir John Acton (whose son was Lady Granville’s first husband) was a
great friend of Lord Nelson, who was at that time occupied in a vain and
hopeless search for the French fleet.[220] One day Sir John was in his wife’s
dressing-room while she was preparing for dinner. As her French maid was
dressing her, a letter was put into her hand, at which she gave such a start
that she ran a pin she was holding into Lady Acton. This caused Lady Acton
to inquire what ailed her. She said the letter was from her brother, a French
sailor, from whom she had not heard for a long time, and about whom she
had been anxious. Sir John Acton, with great presence of mind, offered to
read her the letter while she went on doing her mistress’s hair. As soon as he
had read it he went off to Lord Nelson. The letter gave all the information
so long sought in vain, and the battle of the Nile was the result of the prick
of a pin.’”
“Prestbury, Oct. 6.—It poured so hard this morning that I put off leaving
Sarsden till late. Mrs. Stewart again talked much of the Hanoverian Court,
of the Guelph love of doubtful stories; how she saved up any story she
heard for the blind King. One day she was telling him a story ‘about
Margaret Bremer’s father’ as they were driving. Suddenly the horses
started, and the carriage was evidently going to be upset. ‘Why don’t you
go on?’ said the King. ‘Because, sir, we are just going to upset.’—‘That is
the coachman’s affair,’ said the King; ‘do you go on with your story.’
“With the Greatheeds, in whose cottage I am staying, I went a long
excursion yesterday up the Cotswold Hills, which have a noble view of the
great rich plain of Gloucestershire. Winchcombe, on the other side, is a
charming old town of quaint irregular houses. We passed through it to
Hailes Abbey, a small low ruin now, of cloisters in a rich meadow, but once
most important as containing the great relic of the Precious Blood, which
was brought thither by Edmund, son of the founder, Richard, King of the
Romans. Thirteen bishops said mass at different altars at the consecration,
and three of the Plantagenets—the founder, his wife, and his son Edmund—
are buried in the church. It is now a peaceful solitude, with a few ancient
thatched cottages standing round the wooded pastures.
“In returning, we turned aside to Sudeley Castle, the old Seymour house,
where Katherine Parr is buried. It is a picturesque and grand old house,
partially restored, partly now a green courtyard surrounded by ruined walls
and arches. The Queen’s (modern) tomb has a touching sleeping figure[221]
guarded by two angels. As we were coming out of the chapel, Mrs.
Dent[222] pursued us—a picturesque figure in a Marie Antoinette hat—and
brought us in to tea. The Dents made their fortunes as glovers, and, in their
present magnificence, a parcel of their gloves, as from the shop, is always
left in a conspicuous place in the hall, to ‘keep them humble.’”
“Bretton, Yorkshire, Oct. 30.—I have been here for a very pleasant week
with a large party of what Lady Margaret (Beaumont) calls her ‘young men
and maidens.’ ... There has been nothing especial to narrate, though our
hostess has entertained the whole party with her never-failing charm of
conversation and wit.
“One day I went with Henry Strutt,[225] whom I like much, to Wakefield,
to draw the old chapel on the bridge. What an awful place Wakefield is—
always an inky sky and an inky landscape, and the river literally so inky
that the Mayor went out in a boat, dipped his pen, and wrote a letter with it
to the Commissioners of Nuisances.”
“Raby Castle, Nov. 1.—I came here on Monday, meeting the delicately
humorous Mr. Dicky Doyle at Darlington, yet with much fear that there
were few other guests; but I was relieved to find ‘Eleanor the Good,’
Duchess of Northumberland, seated at the five-o’clock tea-table, and have
had much pleasant talk with her. She spoke of her absorbing attachment to
Alnwick and the pain it was to leave it; that the things which make the
greatest blanks in life are not the greatest griefs, but the losses which most
affect daily life and habits.... Frederick Stanley and Lady Constance[226]
came in the evening, he very pleasant, and she almost more full of laughs
than any one I ever saw. Other guests are Colonel and Mrs. Duncombe,
young Gage, who will be Lord Gage,[227] and just before dinner a good-
looking youth came in, who turned out to be Peddie Bennet.[228]
“Yesterday Lord and Lady Pollington came, and old Lord Strathnairn,
looking thinner and more of an old dandy than ever.”
“Nov. 3.—Yesterday, while I was walking with the Pollingtons through
the beech-woods deep in rustling leaves, the castle bell announced the
advent of guests, and returning, we found the Warwicks and Brooke
arrived.”
“Kirklands, Nov. 14.—On Friday I was again at Jarrow, and was warmly
welcomed by the Edward Liddells. Next morning I went with Edward to the
wonderful old church of the seventh century, where Bede’s chair still stands
under the Saxon arches. All around vegetation is blasted; dead trees rear
their naked boughs into the black sky, and grimy rushes vainly endeavour to
grow in the poisonous marshes. The very horror of ugliness gives a weird
and ghastly interest to the place. Edward finds endless work, and enjoys the
struggle he lives in. As Montalembert says, ‘Ce n’est pas la victoire qui fait
le bonheur des nobles cœurs—c’est le combat.’ His is literally a Christian
warfare. If he has spare time, he employs it in looking about the streets for
drunken men. As he sees them come reeling along, he offers to help them,
and walks home with them clinging to his arm. On the way he draws them
out, and having thus found out where they live, returns next day, armed
with the silly things they have let fall, to make them ashamed with. While I
was making a little sketch of the church, a wedding party came in, the
bridegroom being tipsy. Edward accused him of it, and he confessed at
once, saying that he had been in such a fright at the ceremony, he had been
obliged to take some spirits to keep his courage up. Edward said he
wondered he could care for that sort of courage, that was only Dutch
courage, real English courage was the only right sort; and as he supposed he
wished to make his wife happy, that was the sort of courage he must look
for; but being drunk on the day he married was a bad omen for her
happiness. And yet, in the midst of his little scolding, Edward was so
charming to them all that the whole wedding party were captivated, and an
acquaintance, if not a friendship, was founded. It all showed a power of
work in the real way to win souls. And—
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.
textbookfull.com