1 | <?php |
||
11 | class Data extends Base { |
||
12 | public $id; |
||
13 | public $name; |
||
14 | public $format; |
||
15 | public $realFormat; |
||
16 | public $extension; |
||
17 | public $book; |
||
18 | |||
19 | public static $mimetypes = array( |
||
20 | 'azw' => 'application/x-mobipocket-ebook', |
||
21 | 'azw1' => 'application/x-topaz-ebook', |
||
22 | 'azw2' => 'application/x-kindle-application', |
||
23 | 'azw3' => 'application/x-mobi8-ebook', |
||
24 | 'cbz' => 'application/x-cbz', |
||
25 | 'cbr' => 'application/x-cbr', |
||
26 | 'djv' => 'image/vnd.djvu', |
||
27 | 'djvu' => 'image/vnd.djvu', |
||
28 | 'doc' => 'application/msword', |
||
29 | 'epub' => 'application/epub+zip', |
||
30 | 'fb2' => 'text/fb2+xml', |
||
31 | 'ibooks'=> 'application/x-ibooks+zip', |
||
32 | 'kepub' => 'application/epub+zip', |
||
33 | 'kobo' => 'application/x-koboreader-ebook', |
||
34 | 'mobi' => 'application/x-mobipocket-ebook', |
||
35 | 'lit' => 'application/x-ms-reader', |
||
36 | 'lrs' => 'text/x-sony-bbeb+xml', |
||
37 | 'lrf' => 'application/x-sony-bbeb', |
||
38 | 'lrx' => 'application/x-sony-bbeb', |
||
39 | 'ncx' => 'application/x-dtbncx+xml', |
||
40 | 'opf' => 'application/oebps-package+xml', |
||
41 | 'otf' => 'application/x-font-opentype', |
||
42 | 'pdb' => 'application/vnd.palm', |
||
43 | 'pdf' => 'application/pdf', |
||
44 | 'prc' => 'application/x-mobipocket-ebook', |
||
45 | 'rtf' => 'application/rtf', |
||
46 | 'svg' => 'image/svg+xml', |
||
47 | 'ttf' => 'application/x-font-truetype', |
||
48 | 'tpz' => 'application/x-topaz-ebook', |
||
49 | 'wmf' => 'image/wmf', |
||
50 | 'xhtml' => 'application/xhtml+xml', |
||
51 | 'xpgt' => 'application/adobe-page-template+xml', |
||
52 | 'zip' => 'application/zip' |
||
53 | ); |
||
54 | |||
55 | 60 | public function __construct($post, $book = null) { |
|
56 | 60 | $this->id = $post->id; |
|
57 | 60 | $this->name = $post->name; |
|
58 | 60 | $this->format = $post->format; |
|
59 | 60 | $this->realFormat = str_replace ("ORIGINAL_", "", $post->format); |
|
60 | 60 | $this->extension = strtolower ($this->realFormat); |
|
61 | 60 | $this->book = $book; |
|
62 | 60 | } |
|
63 | |||
64 | 50 | public function isKnownType () { |
|
67 | |||
68 | 50 | public function getMimeType () { |
|
85 | |||
86 | 1 | public function isEpubValidOnKobo () { |
|
89 | |||
90 | 47 | public function getFilename () { |
|
93 | |||
94 | 1 | public function getUpdatedFilename () { |
|
97 | |||
98 | 1 | public function getUpdatedFilenameEpub () { |
|
101 | |||
102 | 1 | public function getUpdatedFilenameKepub () { |
|
105 | |||
106 | 46 | public function getDataLink ($rel, $title = NULL) { |
|
107 | 46 | global $config; |
|
108 | |||
109 | 46 | if ($rel == Link::OPDS_ACQUISITION_TYPE && $config['cops_use_url_rewriting'] == "1") { |
|
110 | 2 | return $this->getHtmlLinkWithRewriting($title); |
|
111 | } |
||
112 | |||
113 | 45 | return self::getLink ($this->book, $this->extension, $this->getMimeType (), $rel, $this->getFilename (), $this->id, $title); |
|
114 | } |
||
115 | |||
116 | 4 | public function getHtmlLink () { |
|
119 | |||
120 | 2 | public function getLocalPath () { |
|
123 | |||
124 | 2 | public function getHtmlLinkWithRewriting ($title = NULL) { |
|
125 | 2 | global $config; |
|
141 | |||
142 | 59 | public static function getDataByBook ($book) { |
|
154 | |||
155 | 19 | public static function handleThumbnailLink ($urlParam, $height) { |
|
173 | |||
174 | 46 | public static function getLink ($book, $type, $mime, $rel, $filename, $idData, $title = NULL, $height = NULL) |
|
206 | } |
||
207 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.