示例#1
0
    echo $e->getMessage() . "\n";
    $lastResponse = $library->getLastResponse();
    var_dump($lastResponse);
    echo "Last Response Body: " . $lastResponse->getRawBody() . " \n";
    die("Leaving\n");
}
$library->items->addChildKeys();
$items = array();
foreach ($itemKeys as $key) {
    $item = $library->items->getItem($key);
    if ($item !== false && empty($item->links['up'])) {
        $items[] = $item;
    }
}
$zreport = new ZReport();
$zreport->setLibrary($library);
$zreport->baseUrl = $baseUrl;
$zreport->paginationType = 'query';
//set pagination type so we always use this page
$zreport->headerTemplateFile = $headerTemplateFilePath;
$zreport->postTemplateFile = $postTemplateFilePath;
$zreport->footerTemplateFile = $footerTemplateFilePath;
$p = isset($_GET['p']) ? (int) $_GET['p'] - 1 : 0;
$pages = $zreport->writePages($items);
echo $pages[$p];
//save library
if ($libraryCacheType == 'file') {
    file_put_contents($librarySaveFilePath, serialize($library));
} elseif ($libraryCacheType == 'apc') {
    apc_store('zreportlibrarycache', $library, $ttl);
}