mikespub / epub-loader
epub-loader is a utility resource for ebooks
Installs: 111
Dependents: 1
Suggesters: 2
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=8.2
- ext-dom: *
- ext-json: *
- ext-mbstring: *
- ext-xml: *
- ext-zip: *
- ext-zlib: *
- mikespub/php-epub-meta: ^2.3||^3.0
- survos/wikidata: ^4.0||^5.0
- twig/twig: ^3.12
Requires (Dev)
- phpunit/phpunit: ^11.3
Suggests
- mikespub/seblucas-cops: COPS - Calibre OPDS (and HTML) PHP Server
README
Prerequisites for this fork
- PHP 8.x with DOM, GD, Intl, Json, PDO SQLite, SQLite3, XML, XMLWriter and ZLib support (PHP 8.1 or later recommended)
- Release 3.x.x will only work with PHP >= 8.2 - typical for most source code & docker image installs in 2024 and later
- Release 2.x.x will only work with PHP >= 8.1 - typical for most source code & docker image installs in 2023 and later
- Release 1.x.x still works with PHP 7.4 if necessary - earlier PHP 7.x (or 5.x) versions are not supported with this fork
Dependencies
- This package depends on mikespub/php-epub-meta (seblucas/php-epub-meta) to get metadata from EPub files
- It is a complementary app for mikespub/seblucas-cops = COPS - Calibre OPDS (and HTML) PHP Server
They have the same PHP version dependencies for 1.x and 2.x releases
Description
epub-loader is a utility package for ebooks. It can be used as a stand-alone project or included in your own PHP application
- CalibreDbLoader class allows create Calibre databases and add ebooks
- BookExport class allows to export ebooks metadata in csv files
- WikiDataMatch class allows to match ebooks and authors with Wikidata
- GoogleBooksMatch class allows to match ebooks and authors with Google Books
- OpenLibraryMatch class allows to match ebooks and authors with Open Library
- The app directory contains samples and allows to run actions
Installation (stand-alone)
composer create-project mikespub/epub-loader
- If a first-time install, copy app/config.php.example to app/config.php
- Edit config.php to match your config
- Open the app directory url: ./app/index.php
Installation (included)
composer require mikespub/epub-loader
- Run
composer install -o
to install all package dependencies and optimize autoloader if needed - You can use
Marsender\EPubLoader\RequestHandler
to handle the request like in ./app/index.php
use Marsender\EPubLoader\RequestHandler; // get the global config for epub-loader from somewhere // get the current action and dbNum if any // you can define extra actions for your app - see example.php $handler = new RequestHandler($gConfig, ExtraActions::class); $result = $handler->request($action, $dbNum); // handle the result yourself or let epub-loader generate the output $result['endpoint'] = 'loader.php'; $result['app_name'] = 'My Application'; echo $handler->output($result, $templateDir, $template);
Adding extra actions
- You can add extra actions on databases and/or epub files as shown in ./app/example.php
public function more() { // do some more... return [ 'result' => 'This is more...', 'extra' => 'easy', ]; }