Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions PhpStormStubsMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2662,6 +2662,7 @@ final class PhpStormStubsMap
'fputs' => 'standard/standard_5.php',
'frankenphp_finish_request' => 'frankenphp/frankenphp.php',
'frankenphp_handle_request' => 'frankenphp/frankenphp.php',
'frankenphp_log' => 'frankenphp/frankenphp.php',
'frankenphp_request_headers' => 'frankenphp/frankenphp.php',
'frankenphp_response_headers' => 'frankenphp/frankenphp.php',
'fread' => 'standard/standard_5.php',
Expand Down Expand Up @@ -3989,6 +3990,7 @@ final class PhpStormStubsMap
'memory_get_peak_usage' => 'standard/standard_4.php',
'memory_get_usage' => 'standard/standard_4.php',
'memory_reset_peak_usage' => 'standard/standard_4.php',
'mercure_publish' => 'frankenphp/frankenphp.php',
'metaphone' => 'standard/standard_8.php',
'method_exists' => 'Core/Core.php',
'mhash' => 'hash/hash.php',
Expand Down Expand Up @@ -7779,6 +7781,10 @@ final class PhpStormStubsMap
'FPE_INTDIV' => 'pcntl/pcntl.php',
'FPE_INTOVF' => 'pcntl/pcntl.php',
'FRAC_DIGITS' => 'standard/standard_defines.php',
'FRANKENPHP_LOG_LEVEL_DEBUG' => 'frankenphp/frankenphp.php',
'FRANKENPHP_LOG_LEVEL_ERROR' => 'frankenphp/frankenphp.php',
'FRANKENPHP_LOG_LEVEL_INFO' => 'frankenphp/frankenphp.php',
'FRANKENPHP_LOG_LEVEL_WARN' => 'frankenphp/frankenphp.php',
'FTA_BOLD' => 'winbinder/winbinder.php',
'FTA_ITALIC' => 'winbinder/winbinder.php',
'FTA_NORMAL' => 'winbinder/winbinder.php',
Expand Down
23 changes: 23 additions & 0 deletions frankenphp/frankenphp.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,26 @@ function frankenphp_request_headers(): array {}
* @return array|false An array of all FrankenPHP response headers on success or <b>FALSE</b> on failure.
*/
function frankenphp_response_headers(): array|false {}

/**
* Publishes a Mercure update to all currently connected subscribers.
*
* @link https://frankenphp.dev/docs/mercure/
* @link https://mercure.rocks
*
* @param string|string[] $topics
*/
function mercure_publish(string|array $topics, string $data = '', bool $private = false, ?string $id = null, ?string $type = null, ?int $retry = null): string {}

const FRANKENPHP_LOG_LEVEL_DEBUG = -4;
const FRANKENPHP_LOG_LEVEL_INFO = 0;
const FRANKENPHP_LOG_LEVEL_WARN = 4;
const FRANKENPHP_LOG_LEVEL_ERROR = 8;

/**
* Emits a structured log record with the current time and the given message, level and context.
*
* @param int $level The importance or severity of a log event. The higher the level, the more important or severe the event. For more details, see: https://pkg.go.dev/log/slog#Level
* array<string, any> $context Values of the array will be converted to the corresponding Go type (if supported by FrankenPHP) and added to the context of the structured logs using https://pkg.go.dev/log/slog#Attr
*/
function frankenphp_log(string $message, int $level = FRANKENPHP_LOG_LEVEL_INFO, array $context = []): void {}