Skip to content

Commit

Permalink
ignore args
Browse files Browse the repository at this point in the history
  • Loading branch information
kojidev committed Dec 17, 2024
1 parent 4dd21d0 commit 94ed29f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion builtin-functions/kphp-full/_functions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function ob_get_flush () ::: string | false;
function ob_get_length () ::: int | false;
function ob_get_level () ::: int;

function headers_sent () ::: bool;
function headers_sent (string &$filename = null, int &$line = null) ::: bool;
function header ($str ::: string, $replace ::: bool = true, $http_response_code ::: int = 0) ::: void;
function headers_list () ::: string[];
function send_http_103_early_hints($headers ::: string[]) ::: void;
Expand Down
14 changes: 13 additions & 1 deletion runtime/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,19 @@ array<string> f$headers_list() {
return result;
}

bool f$headers_sent() {
Optional<string> &get_dummy_headers_sent_filename() noexcept {
static Optional<string> filename;
return filename;
}

Optional<int64_t> &get_dummy_headers_sent_line() noexcept {
static Optional<int64_t> dummy_line;
return dummy_line;
}

bool f$headers_sent(Optional<string> &filename, Optional<int64_t> &line) {
(void)filename;
(void)line;
return headers_sent;
}

Expand Down
4 changes: 3 additions & 1 deletion runtime/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ int64_t f$ob_get_level();

void f$flush();

bool f$headers_sent();
Optional<string> &get_dummy_headers_sent_filename() noexcept;
Optional<int64_t> &get_dummy_headers_sent_line() noexcept;
bool f$headers_sent(Optional<string> &filename = get_dummy_headers_sent_filename(), Optional<int64_t> &line = get_dummy_headers_sent_line());

void f$header(const string &str, bool replace = true, int64_t http_response_code = 0);

Expand Down

0 comments on commit 94ed29f

Please sign in to comment.