Completed
Push — master ( 306060...2234f3 )
by Markus
03:46
created
lib/PageAbout.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 
9 9
 class PageAbout extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13
-        $this->title = localize ("about.title");
13
+        $this->title = localize("about.title");
14 14
     }
15 15
 }
Please login to merge, or discard this patch.
lib/PagePublisherDetail.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
8 8
 
9 9
 class PagePublisherDetail extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13
-        $publisher = Publisher::getPublisherById ($this->idGet);
13
+        $publisher = Publisher::getPublisherById($this->idGet);
14 14
         $this->title = $publisher->name;
15
-        list ($this->entryArray, $this->totalNumber) = Book::getBooksByPublisher ($this->idGet, $this->n);
16
-        $this->idPage = $publisher->getEntryId ();
15
+        list ($this->entryArray, $this->totalNumber) = Book::getBooksByPublisher($this->idGet, $this->n);
16
+        $this->idPage = $publisher->getEntryId();
17 17
     }
18 18
 }
Please login to merge, or discard this patch.
lib/PageAllTags.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 class PageAllSeries extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13 13
         $this->title = localize("series.title");
14 14
         $this->entryArray = Serie::getAllSeries();
Please login to merge, or discard this patch.
lib/PageAllRating.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 class PageAllSeries extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13 13
         $this->title = localize("series.title");
14 14
         $this->entryArray = Serie::getAllSeries();
Please login to merge, or discard this patch.
lib/PageAllLanguages.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 class PageAllSeries extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13 13
         $this->title = localize("series.title");
14 14
         $this->entryArray = Serie::getAllSeries();
Please login to merge, or discard this patch.
lib/PageAllPublishers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 class PageAllSeries extends Page
10 10
 {
11
-    public function InitializeContent ()
11
+    public function InitializeContent()
12 12
     {
13 13
         $this->title = localize("series.title");
14 14
         $this->entryArray = Serie::getAllSeries();
Please login to merge, or discard this patch.
fetch.php 3 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
         }
20 20
     }
21 21
 
22
-    $expires = 60*60*24*14;
22
+    $expires = 60 * 60 * 24 * 14;
23 23
     header('Pragma: public');
24 24
     header('Cache-Control: maxage=' . $expires);
25
-    header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
25
+    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');
26 26
     $bookId = getURLParam('id', NULL);
27 27
     $type   = getURLParam('type', 'jpg');
28 28
     $idData = getURLParam('data', NULL);
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     }
34 34
 
35 35
     if (!$book) {
36
-        notFound ();
36
+        notFound();
37 37
         return;
38 38
     }
39 39
 
@@ -55,15 +55,15 @@  discard block
 block discarded – undo
55 55
             header('Content-Type: image/jpeg');
56 56
             //by default, we don't cache
57 57
             $thumbnailCacheFullpath = null;
58
-            if ( isset($config['cops_thumbnail_cache_directory']) && $config['cops_thumbnail_cache_directory'] !== '' ) {
58
+            if (isset($config['cops_thumbnail_cache_directory']) && $config['cops_thumbnail_cache_directory'] !== '') {
59 59
                 $thumbnailCacheFullpath = $config['cops_thumbnail_cache_directory'];
60 60
                 //if multiple databases, add a subfolder with the database ID
61
-                $thumbnailCacheFullpath .= !is_null(GetUrlParam (DB)) ? 'db-' . GetUrlParam (DB) . DIRECTORY_SEPARATOR : '';
61
+                $thumbnailCacheFullpath .= !is_null(GetUrlParam(DB))?'db-' . GetUrlParam(DB) . DIRECTORY_SEPARATOR:'';
62 62
                 //when there are lots of thumbnails, it's better to save files in subfolders, so if the book's uuid is
63 63
                 //"01234567-89ab-cdef-0123-456789abcdef", we will save the thumbnail in .../0/12/34567-89ab-cdef-0123-456789abcdef-...
64 64
                 $thumbnailCacheFullpath .= substr($book->uuid, 0, 1) . DIRECTORY_SEPARATOR . substr($book->uuid, 1, 2) . DIRECTORY_SEPARATOR;
65 65
                 //check if cache folder exists or create it
66
-                if ( file_exists($thumbnailCacheFullpath) || mkdir($thumbnailCacheFullpath, 0700, true) ) {
66
+                if (file_exists($thumbnailCacheFullpath) || mkdir($thumbnailCacheFullpath, 0700, true)) {
67 67
                     //we name the thumbnail from the book's uuid and it's dimensions (width and/or height)
68 68
                     $thumbnailCacheName = substr($book->uuid, 3) . '-' . getURLParam('width') . 'x' . getURLParam('height') . '.jpg';
69 69
                     $thumbnailCacheFullpath = $thumbnailCacheFullpath . $thumbnailCacheName;
@@ -73,20 +73,20 @@  discard block
 block discarded – undo
73 73
                 }
74 74
             }
75 75
 
76
-            if ( $thumbnailCacheFullpath !== null && file_exists($thumbnailCacheFullpath) ) {
76
+            if ($thumbnailCacheFullpath !== null && file_exists($thumbnailCacheFullpath)) {
77 77
                 //return the already cached thumbnail
78
-                readfile( $thumbnailCacheFullpath );
78
+                readfile($thumbnailCacheFullpath);
79 79
                 return;
80 80
             }
81 81
 
82
-            if ($book->getThumbnail (getURLParam('width'), getURLParam('height'), $thumbnailCacheFullpath)) {
82
+            if ($book->getThumbnail(getURLParam('width'), getURLParam('height'), $thumbnailCacheFullpath)) {
83 83
                 //if we don't cache the thumbnail, imagejpeg() in $book->getThumbnail() already return the image data
84
-                if ( $thumbnailCacheFullpath === null ) {
84
+                if ($thumbnailCacheFullpath === null) {
85 85
                     // The cover had to be resized
86 86
                     return;
87 87
                 } else {
88 88
                     //return the just cached thumbnail
89
-                    readfile( $thumbnailCacheFullpath );
89
+                    readfile($thumbnailCacheFullpath);
90 90
                     return;
91 91
                 }
92 92
             }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@
 block discarded – undo
49 49
         }
50 50
     }
51 51
 
52
-    switch ($type)
53
-    {
52
+    switch ($type) {
54 53
         case 'jpg':
55 54
             header('Content-Type: image/jpeg');
56 55
             //by default, we don't cache
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@
 block discarded – undo
23 23
     header('Pragma: public');
24 24
     header('Cache-Control: maxage=' . $expires);
25 25
     header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
26
-    $bookId = getURLParam('id', NULL);
26
+    $bookId = getURLParam('id', null);
27 27
     $type   = getURLParam('type', 'jpg');
28
-    $idData = getURLParam('data', NULL);
28
+    $idData = getURLParam('data', null);
29 29
     if (is_null($bookId)) {
30 30
         $book = Book::getBookByDataId($idData);
31 31
     } else {
Please login to merge, or discard this patch.
index.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,14 +37,14 @@
 block discarded – undo
37 37
     header('Content-Type:text/html;charset=utf-8');
38 38
 
39 39
     $data = array('title'                 => $config['cops_title_default'],
40
-                  'version'               => VERSION,
41
-                  'opds_url'              => $config['cops_full_url'] . 'feed.php',
42
-                  'customHeader'          => '',
43
-                  'template'              => getCurrentTemplate(),
44
-                  'server_side_rendering' => useServerSideRendering(),
45
-                  'current_css'           => getCurrentCss(),
46
-                  'favico'                => $config['cops_icon'],
47
-                  'getjson_url'           => 'getJSON.php?' . addURLParameter(getQueryString(), 'complete', 1));
40
+                    'version'               => VERSION,
41
+                    'opds_url'              => $config['cops_full_url'] . 'feed.php',
42
+                    'customHeader'          => '',
43
+                    'template'              => getCurrentTemplate(),
44
+                    'server_side_rendering' => useServerSideRendering(),
45
+                    'current_css'           => getCurrentCss(),
46
+                    'favico'                => $config['cops_icon'],
47
+                    'getjson_url'           => 'getJSON.php?' . addURLParameter(getQueryString(), 'complete', 1));
48 48
     if (preg_match('/Kindle/', $_SERVER['HTTP_USER_AGENT'])) {
49 49
         $data['customHeader'] = '<style media="screen" type="text/css"> html { font-size: 75%; -webkit-text-size-adjust: 75%; -ms-text-size-adjust: 75%; }</style>';
50 50
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     }
51 51
     $headcontent = file_get_contents('templates/' . getCurrentTemplate() . '/file.html');
52 52
     $template = new doT();
53
-    $dot = $template->template($headcontent, NULL);
53
+    $dot = $template->template($headcontent, null);
54 54
     echo($dot($data));
55 55
 ?><body>
56 56
 <?php
Please login to merge, or discard this patch.
epubreader.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 
16 16
 $idData = getURLParam('data', NULL);
17 17
 $add = 'data=' . $idData . '&';
18
-if (!is_null (GetUrlParam (DB))) {
19
-    $add .= DB . '=' . GetUrlParam (DB) . '&';
18
+if (!is_null(GetUrlParam(DB))) {
19
+    $add .= DB . '=' . GetUrlParam(DB) . '&';
20 20
 }
21 21
 $myBook = Book::getBookByDataId($idData);
22 22
 
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
         Monocle.DEBUG = true;
38 38
         var bookData = {
39 39
           getComponents: function() {
40
-            <?php echo 'return [' . implode(', ', array_map(function($comp) { return "'" . $comp . "'"; }, $book->components ())) . '];'; ?>
40
+            <?php echo 'return [' . implode(', ', array_map(function($comp) { return "'" . $comp . "'"; }, $book->components())) . '];'; ?>
41 41
           },
42 42
           getContents: function() {
43
-            <?php echo 'return [' . implode(', ', array_map(function($content) { return "{title: '" . addslashes($content['title']) . "', src: '". $content['src'] . "'}"; }, $book->contents())) . '];'; ?>
43
+            <?php echo 'return [' . implode(', ', array_map(function($content) { return "{title: '" . addslashes($content['title']) . "', src: '" . $content['src'] . "'}"; }, $book->contents())) . '];'; ?>
44 44
           },
45 45
           getComponent: function (componentId) {
46 46
             return { url: "epubfs.php?<?php echo $add ?>comp="  + componentId };
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
     return;
52 52
 }
53 53
 
54
-$idData = getURLParam('data', NULL);
54
+$idData = getURLParam('data', null);
55 55
 $add = 'data=' . $idData . '&';
56 56
 if (!is_null(GetUrlParam(DB))) {
57 57
     $add .= DB . '=' . GetUrlParam(DB) . '&';
Please login to merge, or discard this patch.