@@ -36,14 +36,14 @@ discard block |
||
| 36 | 36 | // If there is a syntax error in the function created |
| 37 | 37 | // $dot will be equal to FALSE |
| 38 | 38 | if (!$dot) { |
| 39 | - return FALSE; |
|
| 39 | + return false; |
|
| 40 | 40 | } |
| 41 | 41 | // Execute the template |
| 42 | 42 | if (!empty ($data)) { |
| 43 | 43 | return $dot ($data); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - return NULL; |
|
| 46 | + return null; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | function getQueryString () { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $_SERVER['REDIRECT_STATUS'] = 404; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | -function getURLParam ($name, $default = NULL) { |
|
| 63 | +function getURLParam ($name, $default = null) { |
|
| 64 | 64 | if (!empty ($_GET) && isset($_GET[$name]) && $_GET[$name] != "") { |
| 65 | 65 | return $_GET[$name]; |
| 66 | 66 | } |
@@ -109,10 +109,10 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | switch ($error->level) { |
| 111 | 111 | case LIBXML_ERR_WARNING: |
| 112 | - $return .= "Warning $error->code: "; |
|
| 112 | + $return .= "warning $error->code: "; |
|
| 113 | 113 | break; |
| 114 | 114 | case LIBXML_ERR_ERROR: |
| 115 | - $return .= "Error $error->code: "; |
|
| 115 | + $return .= "error $error->code: "; |
|
| 116 | 116 | break; |
| 117 | 117 | case LIBXML_ERR_FATAL: |
| 118 | 118 | $return .= "Fatal Error $error->code: "; |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $langs = getAcceptLanguages(); |
| 245 | 245 | } |
| 246 | 246 | //echo var_dump($langs); |
| 247 | - $lang_file = NULL; |
|
| 247 | + $lang_file = null; |
|
| 248 | 248 | foreach ($langs as $language => $val) { |
| 249 | 249 | $temp_file = dirname(__FILE__). '/lang/Localization_' . $language . '.json'; |
| 250 | 250 | if (file_exists($temp_file)) { |
@@ -273,13 +273,13 @@ discard block |
||
| 273 | 273 | $phrase .= ".many"; |
| 274 | 274 | |
| 275 | 275 | /* Static keyword is used to ensure the file is loaded only once */ |
| 276 | - static $translations = NULL; |
|
| 276 | + static $translations = null; |
|
| 277 | 277 | if ($reset) { |
| 278 | - $translations = NULL; |
|
| 278 | + $translations = null; |
|
| 279 | 279 | } |
| 280 | 280 | /* If no instance of $translations has occured load the language file */ |
| 281 | 281 | if (is_null($translations)) { |
| 282 | - $lang_file_en = NULL; |
|
| 282 | + $lang_file_en = null; |
|
| 283 | 283 | list ($lang, $lang_file) = getLangAndTranslationFile(); |
| 284 | 284 | if ($lang != "en") { |
| 285 | 285 | $lang_file_en = dirname(__FILE__). '/lang/' . 'Localization_en.json'; |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | return !is_null (getURLParam ("search")); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - private function searchByScope ($scope, $limit = FALSE) { |
|
| 22 | + private function searchByScope ($scope, $limit = false) { |
|
| 23 | 23 | $n = $this->n; |
| 24 | - $numberPerPage = NULL; |
|
| 24 | + $numberPerPage = null; |
|
| 25 | 25 | $queryNormedAndUp = $this->query; |
| 26 | 26 | if (useNormAndUp ()) { |
| 27 | 27 | $queryNormedAndUp = normAndUp ($this->query); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | switch ($scope) { |
| 34 | 34 | case self::SCOPE_BOOK : |
| 35 | - $array = Book::getBooksByStartingLetter ('%' . $queryNormedAndUp, $n, NULL, $numberPerPage); |
|
| 35 | + $array = Book::getBooksByStartingLetter ('%' . $queryNormedAndUp, $n, null, $numberPerPage); |
|
| 36 | 36 | break; |
| 37 | 37 | case self::SCOPE_AUTHOR : |
| 38 | 38 | $array = Author::getAuthorsForSearch ('%' . $queryNormedAndUp); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $array = Serie::getAllSeriesByQuery ($queryNormedAndUp); |
| 42 | 42 | break; |
| 43 | 43 | case self::SCOPE_TAG : |
| 44 | - $array = Tag::getAllTagsByQuery ($queryNormedAndUp, $n, NULL, $numberPerPage); |
|
| 44 | + $array = Tag::getAllTagsByQuery ($queryNormedAndUp, $n, null, $numberPerPage); |
|
| 45 | 45 | break; |
| 46 | 46 | case self::SCOPE_PUBLISHER : |
| 47 | 47 | $array = Publisher::getAllPublishersByQuery ($queryNormedAndUp); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | if (in_array($key, getCurrentOption ('ignored_categories'))) { |
| 82 | 82 | continue; |
| 83 | 83 | } |
| 84 | - $array = $this->searchByScope ($key, TRUE); |
|
| 84 | + $array = $this->searchByScope ($key, true); |
|
| 85 | 85 | |
| 86 | 86 | $i = 0; |
| 87 | 87 | if (count ($array) == 2 && is_array ($array [0])) { |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public function InitializeContent () |
| 12 | 12 | { |
| 13 | - $customId = getURLParam ("custom", NULL); |
|
| 13 | + $customId = getURLParam ("custom", null); |
|
| 14 | 14 | $custom = CustomColumn::getCustomById ($customId, $this->idGet); |
| 15 | 15 | $this->idPage = $custom->getEntryId (); |
| 16 | 16 | $this->title = $custom->name; |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | class LinkNavigation extends Link |
| 10 | 10 | { |
| 11 | - public function __construct($phref, $prel = NULL, $ptitle = NULL) { |
|
| 11 | + public function __construct($phref, $prel = null, $ptitle = null) { |
|
| 12 | 12 | parent::__construct ($phref, Link::OPDS_NAVIGATION_TYPE, $prel, $ptitle); |
| 13 | 13 | if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB)); |
| 14 | 14 | if (!preg_match ("#^\?(.*)#", $this->href) && !empty ($this->href)) $this->href = "?" . $this->href; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | const COMPATIBILITY_XML_ALDIKO = "aldiko"; |
| 37 | 37 | |
| 38 | - private static $db = NULL; |
|
| 38 | + private static $db = null; |
|
| 39 | 39 | |
| 40 | 40 | public static function isMultipleDatabaseEnabled () { |
| 41 | 41 | global $config; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - public static function getDbName ($database = NULL) { |
|
| 74 | + public static function getDbName ($database = null) { |
|
| 75 | 75 | global $config; |
| 76 | 76 | if (self::isMultipleDatabaseEnabled ()) { |
| 77 | 77 | if (is_null ($database)) $database = GetUrlParam (DB, 0); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | return ""; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - public static function getDbDirectory ($database = NULL) { |
|
| 87 | + public static function getDbDirectory ($database = null) { |
|
| 88 | 88 | global $config; |
| 89 | 89 | if (self::isMultipleDatabaseEnabled ()) { |
| 90 | 90 | if (is_null ($database)) $database = GetUrlParam (DB, 0); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| 101 | - public static function getDbFileName ($database = NULL) { |
|
| 101 | + public static function getDbFileName ($database = null) { |
|
| 102 | 102 | return self::getDbDirectory ($database) .'metadata.db'; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | throw new Exception("Database <{$database}> not found."); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - public static function getDb ($database = NULL) { |
|
| 112 | + public static function getDb ($database = null) { |
|
| 113 | 113 | if (is_null (self::$db)) { |
| 114 | 114 | try { |
| 115 | 115 | if (is_readable (self::getDbFileName ($database))) { |
@@ -140,19 +140,19 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | public static function clearDb () { |
| 143 | - self::$db = NULL; |
|
| 143 | + self::$db = null; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - public static function executeQuerySingle ($query, $database = NULL) { |
|
| 146 | + public static function executeQuerySingle ($query, $database = null) { |
|
| 147 | 147 | return self::getDb ($database)->query($query)->fetchColumn(); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - public static function getCountGeneric($table, $id, $pageId, $numberOfString = NULL) { |
|
| 150 | + public static function getCountGeneric($table, $id, $pageId, $numberOfString = null) { |
|
| 151 | 151 | if (!$numberOfString) { |
| 152 | 152 | $numberOfString = $table . ".alphabetical"; |
| 153 | 153 | } |
| 154 | 154 | $count = self::executeQuerySingle ('select count(*) from ' . $table); |
| 155 | - if ($count == 0) return NULL; |
|
| 155 | + if ($count == 0) return null; |
|
| 156 | 156 | $entry = new Entry (localize($table . ".title"), $id, |
| 157 | 157 | str_format (localize($numberOfString, $count), $count), "text", |
| 158 | 158 | array ( new LinkNavigation ("?page=".$pageId)), "", $count); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | return $entryArray; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - public static function executeQuery($query, $columns, $filter, $params, $n, $database = NULL, $numberPerPage = NULL) { |
|
| 180 | + public static function executeQuery($query, $columns, $filter, $params, $n, $database = null, $numberPerPage = null) { |
|
| 181 | 181 | $totalResult = -1; |
| 182 | 182 | |
| 183 | 183 | if (useNormAndUp ()) { |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | public $linkArray; |
| 17 | 17 | public $localUpdated; |
| 18 | 18 | public $className; |
| 19 | - private static $updated = NULL; |
|
| 19 | + private static $updated = null; |
|
| 20 | 20 | |
| 21 | 21 | public static $icons = array( |
| 22 | 22 | Author::ALL_AUTHORS_ID => 'images/author.png', |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | public $facetGroup; |
| 22 | 22 | public $activeFacet; |
| 23 | 23 | |
| 24 | - public function __construct($phref, $ptype, $prel = NULL, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) { |
|
| 24 | + public function __construct($phref, $ptype, $prel = null, $ptitle = null, $pfacetGroup = null, $pactiveFacet = false) { |
|
| 25 | 25 | $this->href = $phref; |
| 26 | 26 | $this->type = $ptype; |
| 27 | 27 | $this->rel = $prel; |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public function InitializeContent () |
| 12 | 12 | { |
| 13 | - $customId = getURLParam ("custom", NULL); |
|
| 13 | + $customId = getURLParam ("custom", null); |
|
| 14 | 14 | $this->title = CustomColumn::getAllTitle ($customId); |
| 15 | 15 | $this->entryArray = CustomColumn::getAllCustoms($customId); |
| 16 | 16 | $this->idPage = CustomColumn::getAllCustomsId ($customId); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | class LinkFacet extends Link |
| 10 | 10 | { |
| 11 | - public function __construct($phref, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) { |
|
| 11 | + public function __construct($phref, $ptitle = null, $pfacetGroup = null, $pactiveFacet = false) { |
|
| 12 | 12 | parent::__construct ($phref, Link::OPDS_PAGING_TYPE, "http://opds-spec.org/facet", $ptitle, $pfacetGroup, $pactiveFacet); |
| 13 | 13 | if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB)); |
| 14 | 14 | $this->href = parent::getScriptName() . $this->href; |