1
0
mirror of https://github.com/php/php-src.git synced 2026-04-09 17:13:31 +02:00

Make php_startpage and php_getlastmod available from shared extensions

This commit is contained in:
Frank M. Kromann
2001-12-03 05:11:29 +00:00
parent b4d9b70c6e
commit c07cf5c2a5
2 changed files with 12 additions and 4 deletions

View File

@@ -43,7 +43,7 @@
/* {{{ php_statpage
*/
static void php_statpage(TSRMLS_D)
PHPAPI void php_statpage(TSRMLS_D)
{
struct stat *pstat;
@@ -137,15 +137,21 @@ PHP_FUNCTION(getmyinode)
}
/* }}} */
PHPAPI long php_getlastmod(TSRMLS_D)
{
php_statpage(TSRMLS_C);
return BG(page_mtime);
}
/* {{{ proto int getlastmod(void)
Get time of last page modification */
PHP_FUNCTION(getlastmod)
{
php_statpage(TSRMLS_C);
if (BG(page_mtime) < 0) {
long lm = php_getlastmod(TSRMLS_C);
if (lm < 0) {
RETURN_FALSE;
} else {
RETURN_LONG(BG(page_mtime));
RETURN_LONG(lm);
}
}
/* }}} */

View File

@@ -27,6 +27,8 @@ PHP_FUNCTION(getmypid);
PHP_FUNCTION(getmyinode);
PHP_FUNCTION(getlastmod);
PHPAPI void php_statpage(TSRMLS_D);
PHPAPI long php_getlastmod(TSRMLS_D);
extern long php_getuid(void);
extern long php_getgid(void);