Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5ce84160a5
Fetching contributors…

Cannot retrieve contributors at this time

105 lines (47 sloc) 2.44 kb
Copyright (c) 2011, Aaron Miller
Licensed under the MIT license.
Core class for the BookGlutton publishing and social reading platform. Includes OPS virtualization, zip container manipulation, and more, in a single convenient class library. Zip container and file finder helper classes included.
Requires epubcheck, zip, tidy, java, PHP mods for zip, dom_document, simple_xml, xpath, possibly others...
API documentation
Coming soon - There are many helpful convenience methods, and helpful comments, in the code. Please browse the main class file for more info on how to use this library.
1.Clean up the code! Production-tested but messy.
2.Add some test scripts and test epub/OPS content
Usage Examples:
Please see the test.php script for the simplest possible example of usage. More involved test scripts will be added when I get time. Do look through the main class file at some of the methods available. There is much useful there.
1. Open an epub from a file:
$epub = new BookGluttonEpub();
2. Load an OPS structure into a virtualized Epub:
$epub = new BookGluttonEpub();
3. Open a remote epub by URL and echo its ISBN:
$epub = new BookGluttonEpub();
echo $epub->getIsbn();
4. Open an epub as a virtual zip epub and unzip its contents into an OPS structure:
$epub = new BookGluttonZipEpub();
$epub->ingestZipData($zipdata, $book->getPackagePath());
5. Load remote, modify and save local to OPS:
$epub = new BookGluttonEpub();
6. Create a new virtual OPS, then load an HTML conversion source, then save locally as OPS:
$epub = new BookGluttonEpub();
$epub->moveOps($ops_repo_root, $unique_package_directory_id);
Jump to Line
Something went wrong with that request. Please try again.