Back to index

php5  5.3.10
Functions
pageinfo.c File Reference
#include "php.h"
#include "pageinfo.h"
#include "SAPI.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "ext/standard/basic_functions.h"

Go to the source code of this file.

Functions

PHPAPI void php_statpage (TSRMLS_D)
long php_getuid (void)
long php_getgid (void)
 PHP_FUNCTION (getmyuid)
 PHP_FUNCTION (getmygid)
 PHP_FUNCTION (getmypid)
 PHP_FUNCTION (getmyinode)
PHPAPI long php_getlastmod (TSRMLS_D)
 PHP_FUNCTION (getlastmod)

Function Documentation

PHP_FUNCTION ( getmyuid  )

Definition at line 101 of file pageinfo.c.

{
       long uid;
       
       uid = php_getuid();
       if (uid < 0) {
              RETURN_FALSE;
       } else {
              RETURN_LONG(uid);
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( getmygid  )

Definition at line 116 of file pageinfo.c.

{
       long gid;
       
       gid = php_getgid();
       if (gid < 0) {
              RETURN_FALSE;
       } else {
              RETURN_LONG(gid);
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( getmypid  )

Definition at line 131 of file pageinfo.c.

{
       int pid;
       
       pid = getpid();
       if (pid < 0) {
              RETURN_FALSE;
       } else {
              RETURN_LONG((long) pid);
       }
}
PHP_FUNCTION ( getmyinode  )

Definition at line 146 of file pageinfo.c.

{
       php_statpage(TSRMLS_C);
       if (BG(page_inode) < 0) {
              RETURN_FALSE;
       } else {
              RETURN_LONG(BG(page_inode));
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( getlastmod  )

Definition at line 165 of file pageinfo.c.

{
       long lm = php_getlastmod(TSRMLS_C);
       if (lm < 0) {
              RETURN_FALSE;
       } else {
              RETURN_LONG(lm);
       }
}

Here is the call graph for this function:

long php_getgid ( void  )

Definition at line 91 of file pageinfo.c.

{
       TSRMLS_FETCH();

       php_statpage(TSRMLS_C);
       return (BG(page_gid));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 157 of file pageinfo.c.

{
       php_statpage(TSRMLS_C);
       return BG(page_mtime);
}

Here is the call graph for this function:

Here is the caller graph for this function:

long php_getuid ( void  )

Definition at line 82 of file pageinfo.c.

{
       TSRMLS_FETCH();

       php_statpage(TSRMLS_C);
       return (BG(page_uid));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 60 of file pageinfo.c.

{
       struct stat *pstat;

       pstat = sapi_get_stat(TSRMLS_C);

       if (BG(page_uid)==-1 || BG(page_gid)==-1) {
              if(pstat) {
                     BG(page_uid)   = pstat->st_uid;
                     BG(page_gid)   = pstat->st_gid;
                     BG(page_inode) = pstat->st_ino;
                     BG(page_mtime) = pstat->st_mtime;
              } else { /* handler for situations where there is no source file, ex. php -r */
                     BG(page_uid) = getuid();
                     BG(page_gid) = getgid();
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function: