From 22f40a027b0299feffdfd86a539e5a95fdd34cf5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 01:39:27 +0000 Subject: [PATCH 1/3] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 4 ++-- .github/workflows/deploy_docs_4x.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 024a03cfc..36935b179 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: POSTGRES_PASSWORD: postgres steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Service if: matrix.db-type == 'mysql' @@ -102,7 +102,7 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/deploy_docs_4x.yml b/.github/workflows/deploy_docs_4x.yml index b745cc92c..4439b25f4 100644 --- a/.github/workflows/deploy_docs_4x.yml +++ b/.github/workflows/deploy_docs_4x.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cloning repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 From 04cd954595dddaac9a85d69ef399a6f6fef86cc4 Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Mon, 23 Oct 2023 11:08:06 +0200 Subject: [PATCH 2/3] add info about DebugKit.ignoreAuthorization to readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8939aab28..62cb5b386 100644 --- a/README.md +++ b/README.md @@ -38,13 +38,15 @@ $this->addPlugin('DebugKit'); If you don't see a CakePHP icon on the bottom right of your page DebugKit is not be working correctly. Some common problems are: - + 1. Your PHP environment doesn't have SQLite installed. Check your application logs to confirm if this happening. You can either configure DebugKit to use a different database, or install the PDO SQLite 3 extension. 2. Your hostname needs to be added to the `DebugKit.safeTld`. If your local domain isn't a known development environment name, DebugKit will disable itself to protect a potentially non-development environment. +3. If you are using the [Authorization Plugin](https://github.com/cakephp/authorization) + you need to set `DebugKit.ignoreAuthorization` to `true` in your config. ## Reporting Issues @@ -61,5 +63,5 @@ requests](https://help.github.com/articles/using-pull-requests) or open ## Documentation -Documentation for DebugKit can be found in the +Documentation for DebugKit can be found in the [CakePHP documentation](https://book.cakephp.org/debugkit/4/en/index.html). From 5d0b20b5f6b0dcfbdbdd1ea92ffbaa3a36fc0370 Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Mon, 23 Oct 2023 11:28:04 +0200 Subject: [PATCH 3/3] require CakePHP 4.5 --- composer.json | 2 +- src/DebugSql.php | 2 +- src/Model/Table/RequestsTable.php | 6 ++---- tests/TestCase/DebugSqlTest.php | 2 +- tests/TestCase/Panel/VariablesPanelTest.php | 7 ++----- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 0641251a7..57dfa62f2 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": ">=7.4", - "cakephp/cakephp": "^4.4.0", + "cakephp/cakephp": "^4.5.0", "cakephp/chronos": "^2.0", "composer/composer": "^1.3 | ^2.0", "doctrine/sql-formatter": "^1.1.3" diff --git a/src/DebugSql.php b/src/DebugSql.php index e965aada3..083feeae4 100644 --- a/src/DebugSql.php +++ b/src/DebugSql.php @@ -80,7 +80,7 @@ public static function sql(Query $query, $showValues = true, $showHtml = null, $ } /** @var array $trace */ - $trace = Debugger::trace(['start' => 1, 'depth' => $stackDepth + 2, 'format' => 'array']); + $trace = Debugger::trace(['start' => 0, 'depth' => $stackDepth + 2, 'format' => 'array']); $file = isset($trace[$stackDepth]) ? $trace[$stackDepth]['file'] : 'n/a'; $line = isset($trace[$stackDepth]) ? $trace[$stackDepth]['line'] : 0; $lineInfo = ''; diff --git a/src/Model/Table/RequestsTable.php b/src/Model/Table/RequestsTable.php index c0318cf35..5675d6105 100644 --- a/src/Model/Table/RequestsTable.php +++ b/src/Model/Table/RequestsTable.php @@ -118,14 +118,12 @@ public function gc() return; } - $query = $this->Panels->query() - ->delete() + $query = $this->Panels->deleteQuery() ->where(['request_id NOT IN' => $noPurge]); $statement = $query->execute(); $statement->closeCursor(); - $query = $this->query() - ->delete() + $query = $this->deleteQuery() ->where(['id NOT IN' => $noPurge]); $statement = $query->execute(); diff --git a/tests/TestCase/DebugSqlTest.php b/tests/TestCase/DebugSqlTest.php index bd3d7c881..c4965213a 100644 --- a/tests/TestCase/DebugSqlTest.php +++ b/tests/TestCase/DebugSqlTest.php @@ -135,6 +135,6 @@ public function testSqlPlain() */ private function newQuery() { - return $this->getTableLocator()->get('panels')->query(); + return $this->getTableLocator()->get('panels')->selectQuery(); } } diff --git a/tests/TestCase/Panel/VariablesPanelTest.php b/tests/TestCase/Panel/VariablesPanelTest.php index 77bb2a73d..f791064c0 100644 --- a/tests/TestCase/Panel/VariablesPanelTest.php +++ b/tests/TestCase/Panel/VariablesPanelTest.php @@ -62,10 +62,8 @@ public function testShutdown() $requests = $this->getTableLocator()->get('Requests'); $query = $requests->find('all'); $result = $requests->find()->all(); - $unbufferedQuery = $requests->find('all')->enableBufferedResults(false); - $unbufferedQuery->toArray(); //toArray call would normally happen somewhere in View, usually implicitly - $update = $requests->query()->update(); - $debugInfoException = $requests->query()->contain('NonExistentAssociation'); + $update = $requests->updateQuery(); + $debugInfoException = $requests->selectQuery()->contain('NonExistentAssociation'); $unserializable = new \stdClass(); $unserializable->pdo = $requests->getConnection()->getDriver()->getConnection(); @@ -89,7 +87,6 @@ public function testShutdown() 'debugInfoException' => $debugInfoException, 'updateQuery' => $update, 'query' => $query, - 'unbufferedQuery' => $unbufferedQuery, 'result set' => $result, 'string' => 'yes', 'array' => ['some' => 'key'],