當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Utilities::bookPath方法代碼示例

本文整理匯總了PHP中Utilities::bookPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utilities::bookPath方法的具體用法?PHP Utilities::bookPath怎麽用?PHP Utilities::bookPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Utilities的用法示例。


在下文中一共展示了Utilities::bookPath方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testBookPath

 function testBookPath()
 {
     $this->assertEqual('tests/fixtures/lib2/Gotthold Ephraim Lessing/Lob der Faulheit (1)/Lob der Faulheit - Gotthold Ephraim Lessing.epub', Utilities::bookPath('tests/fixtures/lib2', 'Gotthold Ephraim Lessing/Lob der Faulheit (1)', 'Lob der Faulheit - Gotthold Ephraim Lessing.epub'));
 }
開發者ID:rvolz,項目名稱:BicBucStriim,代碼行數:4,代碼來源:test_utilities.php

示例2: partialAcquisitionEntry

 /**
  * Write a catalog entry for a book title with acquisition links
  * @param  array    $entry      the book and its details 
  * @param  boolean  $protected  true = use an indirect acquisition link, 
  *                              else a direct one 
  */
 function partialAcquisitionEntry($entry, $protected)
 {
     $titleLink = $this->bbs_root . '/opds/titles/' . $entry['book']->id;
     $this->xmlw->startElement('entry');
     $this->xmlw->writeElement('id', 'urn:bicbucstriim:' . $titleLink);
     $this->xmlw->writeElement('title', $entry['book']->title);
     $this->xmlw->writeElement('dc:issued', date("Y", strtotime($entry['book']->pubdate)));
     $this->xmlw->writeElement('updated', $this->updated);
     $this->xmlw->startElement('author');
     $this->xmlw->writeElement('name', $entry['book']->author_sort);
     $this->xmlw->endElement();
     $this->xmlw->startElement('content');
     $this->xmlw->writeAttribute('type', 'text/html');
     $this->xmlw->text($entry['comment']);
     $this->xmlw->endElement();
     $this->xmlw->startElement("dc:language");
     $this->xmlw->text($entry['language']);
     $this->xmlw->endElement();
     if (isset($entry['book']->thumbnail) && $entry['book']->thumbnail) {
         $tlink = $this->bbs_root . '/data/titles/thumb_' . $entry['book']->id . '.png';
     } else {
         $tlink = $titleLink . '/thumbnail/';
     }
     $this->thumbnailLink($tlink);
     $this->imageLink($titleLink . '/cover/');
     #$this->detailsLink($titleLink.'/thumbnail/');
     foreach ($entry['formats'] as $format) {
         $fname = $format->name;
         $ext = strtolower($format->format);
         $bp = Utilities::bookPath($this->calibre_dir, $entry['book']->path, $fname . '.' . $ext);
         $mt = Utilities::titleMimeType($bp);
         if ($protected) {
             $this->indirectDownloadLink($titleLink . '/showaccess/', $mt);
         } else {
             $this->directDownloadLink($titleLink . '/file/' . urlencode($fname) . '.' . $ext, $mt);
         }
     }
     foreach ($entry['tags'] as $category) {
         $this->xmlw->startElement('category');
         $this->xmlw->writeAttribute('term', $category->name);
         $this->xmlw->writeAttribute('label', $category->name);
         $this->xmlw->endElement();
     }
     $this->xmlw->endElement();
 }
開發者ID:chrispoupart,項目名稱:BicBucStriim,代碼行數:51,代碼來源:opds_generator.php

示例3: titleFile

 /**
  * Returns the path to the file of a book or NULL.
  * @param  int $id book id
  * @param  string $file file name
  * @return string       full path to image file or NULL
  */
 function titleFile($id, $file)
 {
     $book = $this->title($id);
     if (is_null($book)) {
         return NULL;
     } else {
         return Utilities::bookPath($this->calibre_dir, $book->path, $file);
     }
 }
開發者ID:chrispoupart,項目名稱:BicBucStriim,代碼行數:15,代碼來源:calibre.php


注:本文中的Utilities::bookPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。