Compare commits

...
1 Commits
3 changed files with 0 additions and 444 deletions

No files matched your search

-103
View File
@@ -1,103 +0,0 @@
#ifndef _INCLUDED_IMAP_H
#define _INCLUDED_IMAP_H
#if COMPILE_DL
#undef HAVE_IMAP
#define HAVE_IMAP 1
#endif
#if HAVE_IMAP
#ifndef PHP_WIN32
#include "build-defs.h"
#endif
/* Functions accessable to PHP */
extern zend_module_entry imap_module_entry;
#define imap_module_ptr &imap_module_entry
extern PHP_MINIT_FUNCTION(imap);
extern PHP_RINIT_FUNCTION(imap);
extern PHP_RSHUTDOWN_FUNCTION(imap);
PHP_MINFO_FUNCTION(imap);
PHP_FUNCTION(imap_open);
PHP_FUNCTION(imap_popen);
PHP_FUNCTION(imap_reopen);
PHP_FUNCTION(imap_num_msg);
PHP_FUNCTION(imap_num_recent);
PHP_FUNCTION(imap_headers);
PHP_FUNCTION(imap_headerinfo);
PHP_FUNCTION(imap_rfc822_parse_headers);
PHP_FUNCTION(imap_body);
PHP_FUNCTION(imap_fetchstructure);
PHP_FUNCTION(imap_fetchbody);
PHP_FUNCTION(imap_expunge);
PHP_FUNCTION(imap_delete);
PHP_FUNCTION(imap_undelete);
PHP_FUNCTION(imap_check);
PHP_FUNCTION(imap_close);
PHP_FUNCTION(imap_mail_copy);
PHP_FUNCTION(imap_mail_move);
PHP_FUNCTION(imap_createmailbox);
PHP_FUNCTION(imap_renamemailbox);
PHP_FUNCTION(imap_deletemailbox);
PHP_FUNCTION(imap_listmailbox);
PHP_FUNCTION(imap_scanmailbox);
PHP_FUNCTION(imap_subscribe);
PHP_FUNCTION(imap_unsubscribe);
PHP_FUNCTION(imap_append);
PHP_FUNCTION(imap_ping);
PHP_FUNCTION(imap_base64);
PHP_FUNCTION(imap_qprint);
PHP_FUNCTION(imap_8bit);
PHP_FUNCTION(imap_binary);
PHP_FUNCTION(imap_mailboxmsginfo);
PHP_FUNCTION(imap_rfc822_write_address);
PHP_FUNCTION(imap_rfc822_parse_adrlist);
PHP_FUNCTION(imap_setflag_full);
PHP_FUNCTION(imap_clearflag_full);
PHP_FUNCTION(imap_sort);
PHP_FUNCTION(imap_fetchheader);
PHP_FUNCTION(imap_fetchtext);
PHP_FUNCTION(imap_uid);
PHP_FUNCTION(imap_msgno);
PHP_FUNCTION(imap_list);
PHP_FUNCTION(imap_list_full);
PHP_FUNCTION(imap_listscan);
PHP_FUNCTION(imap_lsub);
PHP_FUNCTION(imap_lsub_full);
PHP_FUNCTION(imap_create);
PHP_FUNCTION(imap_rename);
PHP_FUNCTION(imap_status);
PHP_FUNCTION(imap_bodystruct);
PHP_FUNCTION(imap_fetch_overview);
PHP_FUNCTION(imap_mail_compose);
PHP_FUNCTION(imap_alerts);
PHP_FUNCTION(imap_errors);
PHP_FUNCTION(imap_last_error);
PHP_FUNCTION(imap_mail);
PHP_FUNCTION(imap_search);
PHP_FUNCTION(imap_utf8);
PHP_FUNCTION(imap_utf7_decode);
PHP_FUNCTION(imap_utf7_encode);
PHP_FUNCTION(imap_mime_header_decode);
#else
#define imap_module_ptr NULL
#endif /* HAVE_IMAP */
#endif
#define phpext_imap_ptr imap_module_ptr
-56
View File
@@ -1,56 +0,0 @@
dnl
dnl $Id$
dnl
dnl By default we'll compile and link against the bundled PCRE library
dnl if DIR is supplied, we'll use that for linking
PHP_ARG_WITH(pcre-regex,for PCRE support,
[ --without-pcre-regex Do not include Perl Compatible Regular Expressions
support. Use --with-pcre-regex=DIR to specify DIR
where PCRE's include and library files are located,
if not using bundled library.],yes)
if test "$PHP_PCRE_REGEX" != "no"; then
if test "$PHP_PCRE_REGEX" = "yes"; then
PHP_NEW_EXTENSION(pcre, pcrelib/maketables.c pcrelib/get.c pcrelib/study.c pcrelib/pcre.c php_pcre.c, $ext_shared,,-DSUPPORT_UTF8 -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -I@ext_srcdir@/pcrelib)
PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
else
for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre; do
test -f $i/pcre.h && PCRE_INCDIR=$i
done
if test -z "$PCRE_INCDIR"; then
AC_MSG_ERROR([Could not find pcre.h in $PHP_PCRE_REGEX])
fi
for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/lib; do
test -f $j/libpcre.a -o -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
done
if test -z "$PCRE_LIBDIR" ; then
AC_MSG_ERROR([Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) in $PHP_PCRE_REGEX])
fi
changequote({,})
pcre_major=`grep PCRE_MAJOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
pcre_minor=`grep PCRE_MINOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
changequote([,])
pcre_minor_length=`echo "$pcre_minor" | wc -c | sed -e 's/[^0-9]//g'`
if test "$pcre_minor_length" -eq 2 ; then
pcre_minor="$pcre_minor"0
fi
pcre_version=$pcre_major$pcre_minor
if test "$pcre_version" -lt 208; then
AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 2.08])
fi
PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD)
AC_DEFINE(HAVE_PCRE, 1, [ ])
PHP_ADD_INCLUDE($PCRE_INCDIR)
PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DSUPPORT_UTF8 -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10)
fi
PHP_SUBST(PCRE_SHARED_LIBADD)
fi
-285
View File
@@ -1,285 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2004 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Sander Steffann (sander@steffann.nl) |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/stat.h>
#ifndef MAXSYMLINKS
#define MAXSYMLINKS 32
#endif
#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR)
#endif
char *php_realpath(char *path, char resolved_path[]);
#ifdef PHP_WIN32
#define IS_SLASH(p) ((p) == '/' || (p) == '\\')
#else
#define IS_SLASH(p) ((p) == '/')
#endif
char *php_realpath(char *path, char resolved_path []) {
char path_construction[MAXPATHLEN]; /* We build the result in here */
char *writepos; /* Position to write next char */
char path_copy[MAXPATHLEN]; /* A work-copy of the path */
char *workpos; /* working position in *path */
#if !defined(PHP_WIN32)
char buf[MAXPATHLEN]; /* Buffer for readlink */
int linklength; /* The result from readlink */
#endif
int linkcount = 0; /* Count symlinks to avoid loops */
struct stat filestat; /* result from stat */
#ifdef PHP_WIN32
char *temppos; /* position while counting '.' */
int dotcount; /* number of '.' */
int t; /* counter */
#endif
/* Set the work-position to the beginning of the given path */
strcpy(path_copy, path);
workpos = path_copy;
#ifdef PHP_WIN32
/* Find out where we start - Windows version */
if (IS_SLASH(*workpos)) {
/* We start at the root of the current drive */
/* Get the current directory */
if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
/* Unable to get cwd */
resolved_path[0] = 0;
return NULL;
}
/* We only need the first three chars (for example "C:\") */
path_construction[3] = 0;
workpos++;
} else if (workpos[1] == ':') {
/* A drive-letter is specified, copy it */
strncpy(path_construction, path, 2);
strcat(path_construction, "\\");
workpos++;
workpos++;
} else {
/* Use the current directory */
if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
/* Unable to get cwd */
resolved_path[0] = 0;
return NULL;
}
strcat(path_construction, "\\");
}
#else
/* Find out where we start - Unix version */
if (*workpos == '/') {
/* We start at the root */
strcpy(path_construction, "/");
workpos++;
} else {
/* Use the current directory */
if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
/* Unable to get cwd */
resolved_path[0] = 0;
return NULL;
}
strcat(path_construction, "/");
}
#endif
/* Set the next-char-position */
writepos = &path_construction[strlen(path_construction)];
/* Go to the end, then stop */
while(*workpos != 0) {
/* Strip (back)slashes */
while(IS_SLASH(*workpos)) workpos++;
#ifdef PHP_WIN32
/* reset dotcount */
dotcount = 0;
/* Look for .. */
if ((workpos[0] == '.') && (workpos[1] != 0)) {
/* Windows accepts \...\ as \..\..\, \....\ as \..\..\..\, etc */
/* At least Win98 does */
temppos = workpos;
while(*temppos++ == '.') {
dotcount++;
if (!IS_SLASH(*temppos) && (*temppos != 0) && (*temppos != '.')) {
/* This is not a /../ component, but a filename that starts with '.' */
dotcount = 0;
}
}
/* Go back dotcount-1 times */
for (t=0 ; t<(dotcount-1) ; t++) {
workpos++; /* move to next '.' */
/* Can we still go back? */
if ((writepos-3) <= path_construction) return NULL;
/* Go back */
writepos--; /* move to '\' */
writepos--;
while(!IS_SLASH(*writepos)) writepos--; /* skip until previous '\\' */
}
workpos++;
}
/* No special case */
if (dotcount == 0) {
/* Append */
while(!IS_SLASH(*workpos) && (*workpos != 0)) {
*writepos++ = *workpos++;
}
}
/* Just one '.', go to next element */
if (dotcount == 1) {
while(!IS_SLASH(*workpos) && (*workpos != 0)) {
*workpos++;
}
/* Avoid double \ in the result */
writepos--;
}
/* If it was a directory, append a slash */
if (IS_SLASH(*workpos)) {
*writepos++ = *workpos++;
}
*writepos = 0;
#else /* defined(PHP_WIN32) */
/* Look for .. */
if ((workpos[0] == '.') && (workpos[1] != 0)) {
if ((workpos[1] == '.') && ((workpos[2] == '/') || (workpos[2] == 0))) {
/* One directory back */
/* Set pointers to right position */
workpos++; /* move to second '.' */
workpos++; /* move to '/' */
/* Only apply .. if not in root */
if ((writepos-1) > path_construction) {
writepos--; /* move to '/' */
while(*--writepos != '/') ; /* skip until previous '/' */
}
} else {
if (workpos[1] == '/') {
/* Found a /./ skip it */
workpos++; /* move to '/' */
/* Avoid double / in the result */
writepos--;
} else {
/* No special case, the name just started with a . */
/* Append */
while((*workpos != '/') && (*workpos != 0)) {
*writepos++ = *workpos++;
}
}
}
} else {
/* No special case */
/* Append */
while((*workpos != '/') && (*workpos != 0)) {
*writepos++ = *workpos++;
}
}
#if HAVE_SYMLINK
/* We are going to use path_construction, so close it */
*writepos = 0;
/* Check the current location to see if it is a symlink */
if((linklength = readlink(path_construction, buf, MAXPATHLEN)) != -1) {
/* Check linkcount */
if (linkcount > MAXSYMLINKS) return NULL;
/* Count this symlink */
linkcount++;
/* Set end of buf */
buf[linklength] = 0;
/* Check for overflow */
if ((strlen(workpos) + strlen(buf) + 1) >= MAXPATHLEN) return NULL;
/* Remove the symlink-component wrom path_construction */
writepos--; /* move to '/' */
while(*--writepos != '/') ; /* skip until previous '/' */
*++writepos = 0; /* end of string after '/' */
/* If the symlink starts with a '/', empty path_construction */
if (*buf == '/') {
*path_construction = 0;
writepos = path_construction;
}
/* Insert symlink into path_copy */
strcat(buf, workpos);
strcpy(path_copy, buf);
workpos = path_copy;
}
#endif /* HAVE_SYMLINK */
/* If it was a directory, append a slash */
if (*workpos == '/') {
*writepos++ = *workpos++;
}
*writepos = 0;
#endif /* defined(PHP_WIN32) */
}
/* Check if the resolved path is a directory */
if (V_STAT(path_construction, &filestat) != 0) {
if (errno != ENOENT) return NULL;
} else {
if (S_ISDIR(filestat.st_mode)) {
/* It's a directory, append a / if needed */
if (*(writepos-1) != '/') {
/* Check for overflow */
if ((strlen(workpos) + 2) >= MAXPATHLEN) {
return NULL;
}
*writepos++ = '/';
*writepos = 0;
}
}
}
strcpy(resolved_path, path_construction);
return resolved_path;
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/