getFilename() == '.' && preg_match('|/src$|ius', $file->getPath())){ throw new Exceptions\SeeOtherEbookException(preg_replace(['|' . WEB_ROOT . '|ius', '|/src$|ius'], '', $file->getPath())); } } } // Do we have the ebook cached? try{ $ebook = apcu_fetch('ebook-' . $wwwFilesystemPath); } catch(Safe\Exceptions\ApcuException){ $ebook = new Ebook($wwwFilesystemPath); } // Divide our sources into transcriptions and scans foreach($ebook->Sources as $source){ switch($source->Type){ case SOURCE_PROJECT_GUTENBERG: case SOURCE_PROJECT_GUTENBERG_AUSTRALIA: case SOURCE_PROJECT_GUTENBERG_CANADA: case SOURCE_WIKISOURCE: case SOURCE_FADED_PAGE: $transcriptionSources[] = $source; break; case SOURCE_INTERNET_ARCHIVE: case SOURCE_HATHI_TRUST: case SOURCE_GOOGLE_BOOKS: $scanSources[] = $source; break; case SOURCE_OTHER: $otherSources[] = $source; break; } } // Generate the bottom carousel. // Pick a random tag from this ebook, and get ebooks in the same tag $ebooks = []; if(sizeof($ebook->Tags) > 0){ $carouselTag = $ebook->Tags[rand(0, sizeof($ebook->Tags) - 1)]; $ebooks = Library::GetEbooksByTag(strtolower($carouselTag->Name)); } else{ $ebooks = Library::GetEbooks(); } shuffle($ebooks); $targetCarouselSize = 5; // Use <= here because we want to exclude the ebook we're looking at from the carousel. // One of the matching ebooks will always be the current ebook. if(sizeof($ebooks) <= $targetCarouselSize){ $targetCarouselSize = sizeof($ebooks) - 1; } if($targetCarouselSize > 0){ $i = 0; while(sizeof($carousel) < $targetCarouselSize){ if(isset($ebooks[$i]) && $ebooks[$i]->Url !== $ebook->Url){ $carousel[] = $ebooks[$i]; } $i++; } } } catch(Exceptions\SeeOtherEbookException $ex){ http_response_code(301); header('Location: ' . $ex->Url); exit(); } catch(Exceptions\InvalidEbookException){ Template::Emit404(); } ?> strip_tags($ebook->TitleWithCreditsHtml) . ' - Free ebook download', 'ogType' => 'book', 'coverUrl' => $ebook->DistCoverUrl, 'highlight' => 'ebooks', 'description' => 'Free epub ebook download of the Standard Ebooks edition of ' . $ebook->Title . ': ' . $ebook->Description]) ?>
WikipediaUrl){ ?>

Title) ?>

Authors as $author){ ?> Name != 'Anonymous'){ ?>

Name) ?> NacoafUrl){ ?> WikipediaUrl){ ?>

HeroImage2xAvifUrl !== null){ ?>

Description

LongDescription === null){ ?>

There’s no description for this ebook yet.

LongDescription ?>
HasDownloads){ ?>
GenerateContributorsRdfa() ?>

Read free

This ebook is thought to be free of copyright restrictions in the United States. It may still be under copyright in other countries. If you’re not located in the United States, you must check your local laws to verify that this ebook is free of copyright restrictions in the country you’re located in before accessing, downloading, or using it.

Download for ereaders

    EpubUrl !== null){ ?>
  • Compatible epub All devices and apps except Kindles and Kobos.

  • Azw3Url !== null){ ?>
  • azw3 Kindle devices and apps.KindleCoverUrl !== null){ ?> Also download the Kindle cover thumbnail to see the cover in your Kindle’s library. You may be interested in our Kindle FAQ. Also see our Kindle FAQ.

  • KepubUrl !== null){ ?>
  • kepub Kobo devices and apps. You may also be interested in our Kobo FAQ.

  • AdvancedEpubUrl !== null){ ?>
  • Advanced epub An advanced format that uses the latest technology not yet fully supported by most ereaders.

TextUrl !== null || $ebook->TextSinglePageUrl !== null){ ?>

Read online

    TextUrl !== null){ ?>
  • Start from the table of contents

  • TextSinglePageUrl !== null){ ?>
  • TextSinglePageSizeNumber >= 3 && $ebook->TextSinglePageSizeUnit == 'M'){ ?> class="has-size"> Read on one pageTextSinglePageSizeNumber >= 3 && $ebook->TextSinglePageSizeUnit == 'M'){ ?>TextSinglePageSizeNumber ?>MB

A brief history of this ebook

    GitCommits as $commit){ ?>
  1. Message) ?>

GitHubUrl !== null){ ?>
GitHubUrl !== null || $ebook->WikipediaUrl !== null){ ?>

More details

0 || sizeof($scanSources) > 0 || sizeof($otherSources) > 0){ ?>

Sources

0){ ?>

Transcriptions

0){ ?>

Page scans

0){ ?>

Other sources

Improve this ebook

Anyone can contribute to make a Standard Ebook better for everyone!

To report typos, typography errors, or other corrections, see how to report errors.

GitHubUrl !== null){ ?>

If you’re comfortable with technology and want to contribute directly, check out this ebook’s GitHub repository and our contributors section.

You can also donate to Standard Ebooks to help fund continuing improvement of this and other ebooks.

0){ ?>