Exemple #1
0
<?php

require_once 'utils.php';
require_once 'db.php';
require_once 'process.php';
require_once 'book_status.php';
if (!isset($_GET['key'])) {
    httpResponseCode("400 Bad Request", "Missing parameter \"key\"");
    die;
}
$key = removeExt($_GET['key']);
$bs = new BookStatus();
$cb = new ConvertBook();
try {
    $bs->checkOriginal($key);
    // get book info
    $db = getDBObject();
    $bookInfo = $db->getBookByKey($key);
    $id = $bookInfo["id"];
    $title = $bookInfo["title"];
    $author = $bookInfo["author"];
    if (!$author) {
        $author = "Автор неизвестен";
    }
    if (!$title) {
        $title = "Название неизвестно";
    }
    $formats = $db->getFormats();
} catch (Exception $e) {
    error_log("FB2PDF ERROR. Status: " . $e->getMessage());
    httpResponseCode("400 Bad Request", $e->getMessage());
Exemple #2
0
 private function getBaseFileName($fileName)
 {
     $pathParts = pathinfo($fileName);
     $name = removeExt($pathParts["basename"]);
     return $name;
 }