Skip to content

Commit 3e82cc8

Browse files
author
Fredrick Peter
committed
Pagination update
1 parent d91cf1a commit 3e82cc8

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Prior to installing `php-orm-database` get the [Composer](https://getcomposer.or
119119
**Step 1** — update your `composer.json`:
120120
```composer.json
121121
"require": {
122-
"peterson/database": "^4.3.3"
122+
"peterson/database": "^4.3.4"
123123
}
124124
```
125125

src/Dummy/dummyUserIni.dum

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ max_execution_time = 120
77
max_input_vars = 1000
88
max_input_time = 120
99
memory_limit = 400M
10-
zlib.output_compression = On
10+
zlib.output_compression = Off
1111
default_charset = "utf-8"
1212
;extension=pdo_pgsql

src/Schema/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ public function get($limit = null)
13401340
/**
13411341
* Paginate the given query into a simple paginator.
13421342
*
1343-
* @param int|float|string $perPage
1343+
* @param int|string $perPage
13441344
* - Supporting numeric string values, which will be internally converted to `int`
13451345
*
13461346
* @param string $pageParam
@@ -1356,7 +1356,7 @@ public function paginate($perPage = 15, $pageParam = 'page')
13561356
$totalCount = $this->countBuilder('*', false);
13571357

13581358
// new paginator class
1359-
$paginator = new Paginator($pageParam,);
1359+
$paginator = new Paginator($pageParam);
13601360

13611361
$this->setMethod(__FUNCTION__);
13621362

src/Schema/Pagination/Paginator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ private function resetKeys(?array $options = [], $links = true)
322322
*
323323
* @return $this
324324
*/
325-
protected function getPagination($totalCount, int $perPage = 15, Builder $query = null)
325+
protected function getPagination($totalCount, int|string $perPage = 15, Builder $query = null)
326326
{
327327
try {
328328
// convert to int

src/Schema/Pagination/PaginatorAsset.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ public static function views(string $mode = null)
5757
*/
5858
public static function headerControlNoCache()
5959
{
60-
@header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
61-
@header("Pragma: no-cache");
62-
@header("Expires: Thu, 01 Jan 1970 00:00:00 GMT");
60+
if (!headers_sent()) {
61+
@header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
62+
@header("Pragma: no-cache");
63+
@header("Expires: Thu, 01 Jan 1970 00:00:00 GMT");
64+
}
6365
}
6466

6567
/**

0 commit comments

Comments
 (0)