Usage:
include("MOBIClass/MOBI.php");
$mobi = new MOBI();
Then use one of the following ways to prepare information (it should be in the form of valid html)
$mobi->setInternetSource($url); //Load URL, the result will be cleaned using a Readability port
$mobi->setFileSource($file); //Load a local file without any extra changes
$mobi->setData($data); //Load data
If you want, you can set some optional settings (see Settings.php for all recognized settings)
$options = array(
"title"=>"Insert title here",
"author"=>"Author"
);
$mobi->setOptions($options);
Then there are two ways to output it:
$mobi->save($file); //Save the file locally
$mobi->download($name); //Let the client download the file, make sure the page
that calls it doesn't output anything, otherwise it might
conflict with the download. $name contains the file name,
usually something like "title.mobi" (where the title should
be cleaned so as not to contain illegal characters).
setContentProvider()
публичный Метод
Set a content provider as source
public setContentProvider ( ContentProvider $content ) |
$content |
ContentProvider |
Content Provider to use |