diff --git a/README.md b/README.md index 4793b78..e6c0fd2 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ Prior to installing `php-orm-database` get the [Composer](https://getcomposer.or **Step 1** — update your `composer.json`: ```composer.json "require": { - "peterson/database": "^4.3.3" + "peterson/database": "^4.3.4" } ``` diff --git a/src/Dummy/dummyUserIni.dum b/src/Dummy/dummyUserIni.dum index 283cfb6..b4fc9b9 100644 --- a/src/Dummy/dummyUserIni.dum +++ b/src/Dummy/dummyUserIni.dum @@ -7,6 +7,6 @@ max_execution_time = 120 max_input_vars = 1000 max_input_time = 120 memory_limit = 400M -zlib.output_compression = On +zlib.output_compression = Off default_charset = "utf-8" ;extension=pdo_pgsql \ No newline at end of file diff --git a/src/Schema/Builder.php b/src/Schema/Builder.php index 5b6fd03..f0879ce 100644 --- a/src/Schema/Builder.php +++ b/src/Schema/Builder.php @@ -1340,7 +1340,7 @@ public function get($limit = null) /** * Paginate the given query into a simple paginator. * - * @param int|float|string $perPage + * @param int|string $perPage * - Supporting numeric string values, which will be internally converted to `int` * * @param string $pageParam @@ -1356,7 +1356,7 @@ public function paginate($perPage = 15, $pageParam = 'page') $totalCount = $this->countBuilder('*', false); // new paginator class - $paginator = new Paginator($pageParam,); + $paginator = new Paginator($pageParam); $this->setMethod(__FUNCTION__); diff --git a/src/Schema/Pagination/Paginator.php b/src/Schema/Pagination/Paginator.php index 269f27a..f0983e3 100644 --- a/src/Schema/Pagination/Paginator.php +++ b/src/Schema/Pagination/Paginator.php @@ -322,7 +322,7 @@ private function resetKeys(?array $options = [], $links = true) * * @return $this */ - protected function getPagination($totalCount, int $perPage = 15, Builder $query = null) + protected function getPagination($totalCount, int|string $perPage = 15, Builder $query = null) { try { // convert to int diff --git a/src/Schema/Pagination/PaginatorAsset.php b/src/Schema/Pagination/PaginatorAsset.php index 0b79000..5c34fd4 100644 --- a/src/Schema/Pagination/PaginatorAsset.php +++ b/src/Schema/Pagination/PaginatorAsset.php @@ -57,9 +57,11 @@ public static function views(string $mode = null) */ public static function headerControlNoCache() { - @header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); - @header("Pragma: no-cache"); - @header("Expires: Thu, 01 Jan 1970 00:00:00 GMT"); + if (!headers_sent()) { + @header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); + @header("Pragma: no-cache"); + @header("Expires: Thu, 01 Jan 1970 00:00:00 GMT"); + } } /**