Skip to content
Merged
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
2 changes: 2 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ PHP 8.5 INTERNALS UPGRADE NOTES
- ext/standard
. Added php_url_decode_ex() and php_raw_url_decode_ex() that unlike their
non-ex counterparts do not work in-place.
. The php_std_date() function has been removed. Use php_format_date() with
the "D, d M Y H:i:s \\G\\M\\T" format instead.

========================
4. OpCode changes
Expand Down
38 changes: 0 additions & 38 deletions ext/standard/datetime.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,12 @@
*/

#include "php.h"
#include "zend_operators.h"
#include "datetime.h"
#include "php_globals.h"

#include <time.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <stdio.h>

static const char * const mon_short_names[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};

static const char * const day_short_names[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};

/* {{{ PHPAPI char *php_std_date(time_t t)
Return date string in standard format for http headers */
PHPAPI char *php_std_date(time_t t)
{
struct tm *tm1, tmbuf;
char *str;

tm1 = php_gmtime_r(&t, &tmbuf);
str = emalloc(81);
str[0] = '\0';

if (!tm1) {
return str;
}

snprintf(str, 80, "%s, %02d %s %04d %02d:%02d:%02d GMT",
day_short_names[tm1->tm_wday],
tm1->tm_mday,
mon_short_names[tm1->tm_mon],
tm1->tm_year + 1900,
tm1->tm_hour, tm1->tm_min, tm1->tm_sec);

str[79] = 0;
return (str);
}
/* }}} */

#ifdef HAVE_STRPTIME
#ifndef HAVE_DECL_STRPTIME
Expand Down
23 changes: 0 additions & 23 deletions ext/standard/datetime.h

This file was deleted.

1 change: 0 additions & 1 deletion ext/standard/php_standard.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "php_filestat.h"
#include "php_browscap.h"
#include "pack.h"
#include "datetime.h"
#include "url.h"
#include "pageinfo.h"
#include "fsock.h"
Expand Down