diff --git a/src/console/controllers/CacheController.php b/src/console/controllers/CacheController.php index b39e676a..ee820540 100755 --- a/src/console/controllers/CacheController.php +++ b/src/console/controllers/CacheController.php @@ -562,8 +562,13 @@ private function _deploy(array $siteUris): void */ private function _output(string $message): void { - $processUser = posix_getpwuid(posix_geteuid()); - $user = $processUser['name'] ?? 'unknown'; + $user = 'unknown'; + + if (function_exists('posix_getpwuid')) { + $processUser = posix_getpwuid(posix_geteuid()); + $user = $processUser['name'] ?? $user; + } + Blitz::$plugin->log($message . ' [via console command by "{user}"]', ['user' => $user]); $this->stdout(Craft::t('blitz', $message) . PHP_EOL, BaseConsole::FG_GREEN); diff --git a/src/controllers/DiagnosticsController.php b/src/controllers/DiagnosticsController.php index ab8e0f04..81ad2a8d 100755 --- a/src/controllers/DiagnosticsController.php +++ b/src/controllers/DiagnosticsController.php @@ -47,7 +47,7 @@ public function actionExportPages(int $siteId): Response ->all(); $values = []; - foreach ($pages as &$page) { + foreach ($pages as $page) { $values[] = [ 'uri' => $page['uri'] ?: '/', 'elements' => $page['elementCount'] ?: 0, diff --git a/src/helpers/DiagnosticsHelper.php b/src/helpers/DiagnosticsHelper.php index 782ec7f0..c5da4e3e 100644 --- a/src/helpers/DiagnosticsHelper.php +++ b/src/helpers/DiagnosticsHelper.php @@ -231,7 +231,8 @@ public static function getElementQuerySql(string $elementQueryType, string $para // Return raw SQL with line breaks replaced with spaces. return str_replace(["\r\n", "\r", "\n"], ' ', $sql); - } catch (QueryAbortedException) { + } /** @noinspection PhpRedundantCatchClauseInspection */ + catch (QueryAbortedException) { return null; } } diff --git a/src/records/ElementQuerySourceRecord.php b/src/records/ElementQuerySourceRecord.php index bbd937b1..51395fcc 100644 --- a/src/records/ElementQuerySourceRecord.php +++ b/src/records/ElementQuerySourceRecord.php @@ -9,7 +9,6 @@ use craft\db\ActiveRecord; /** - * @property int $id * @property int $sourceId * @property int $queryId * @property-read ElementQueryRecord $elementQuery diff --git a/src/records/IncludeRecord.php b/src/records/IncludeRecord.php index 8f62752a..45f939f5 100644 --- a/src/records/IncludeRecord.php +++ b/src/records/IncludeRecord.php @@ -10,6 +10,7 @@ /** * @property int $id + * @property int $index [bigint(20)] * @property int $siteId * @property string $template * @property string $params diff --git a/src/services/ExpireCacheService.php b/src/services/ExpireCacheService.php index a778b50b..149a0d79 100755 --- a/src/services/ExpireCacheService.php +++ b/src/services/ExpireCacheService.php @@ -15,6 +15,8 @@ use putyourlightson\blitz\records\CacheRecord; /** + * @property-read int[] $expiredCacheIds + * * @since 4.8.0 */ class ExpireCacheService extends Component