当前位置: 首页>>代码示例>>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;未经允许,请勿转载。