aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordinoex <dinoex@FreeBSD.org>2010-04-24 00:34:39 +0800
committerdinoex <dinoex@FreeBSD.org>2010-04-24 00:34:39 +0800
commitfa189b7e6ff4fd919b329f00480a8489fef0320c (patch)
tree303d19cb2eef97df2ceab2c44be522c182a9cbf9
parent54c185e6a09e86b9d3284471ed83cee4d8c20ee3 (diff)
downloadfreebsd-ports-gnome-fa189b7e6ff4fd919b329f00480a8489fef0320c.tar.gz
freebsd-ports-gnome-fa189b7e6ff4fd919b329f00480a8489fef0320c.tar.zst
freebsd-ports-gnome-fa189b7e6ff4fd919b329f00480a8489fef0320c.zip
- PHP 5.2 slave port
PR: 145772 Submitted by: Alex Keda
-rw-r--r--databases/Makefile1
-rw-r--r--databases/php52-pdo_sqlite/Makefile14
-rw-r--r--databases/php52-pdo_sqlite/files/patch-sqlite_statement.c50
-rw-r--r--databases/php52-pgsql/Makefile14
-rw-r--r--databases/php52-pgsql/files/patch-pgsql.c30
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/php52-posix/Makefile14
-rw-r--r--sysutils/php52-posix/files/patch-posix.c38
8 files changed, 162 insertions, 0 deletions
diff --git a/databases/Makefile b/databases/Makefile
index 94e2b841151b..a5acd0171351 100644
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -532,6 +532,7 @@
SUBDIR += php52-pdo_odbc
SUBDIR += php52-pdo_pgsql
SUBDIR += php52-pdo_sqlite
+ SUBDIR += php52-pgsql
SUBDIR += phpminiadmin
SUBDIR += phpmyadmin
SUBDIR += phpmyadmin211
diff --git a/databases/php52-pdo_sqlite/Makefile b/databases/php52-pdo_sqlite/Makefile
new file mode 100644
index 000000000000..cf5e6ffa7756
--- /dev/null
+++ b/databases/php52-pdo_sqlite/Makefile
@@ -0,0 +1,14 @@
+# New ports collection makefile for: php52-pdo_sqlite
+# Date created: 17 Apr 2010
+# Whom: Alex Keda <admin@lissyara.su>
+#
+# $FreeBSD$
+#
+
+CATEGORIES= databases
+
+MASTERDIR= ${.CURDIR}/../../lang/php52
+
+PKGNAMESUFFIX= -pdo_sqlite
+
+.include "${MASTERDIR}/Makefile"
diff --git a/databases/php52-pdo_sqlite/files/patch-sqlite_statement.c b/databases/php52-pdo_sqlite/files/patch-sqlite_statement.c
new file mode 100644
index 000000000000..8785b86ecff0
--- /dev/null
+++ b/databases/php52-pdo_sqlite/files/patch-sqlite_statement.c
@@ -0,0 +1,50 @@
+--- sqlite_statement.c.orig 2007-12-31 08:20:10.000000000 +0100
++++ sqlite_statement.c 2008-12-07 11:50:35.000000000 +0100
+@@ -104,6 +104,21 @@
+ pdo_sqlite_error_stmt(stmt);
+ return 0;
+
++ case PDO_PARAM_INT:
++ case PDO_PARAM_BOOL:
++ if (Z_TYPE_P(param->parameter) == IS_NULL) {
++ if (sqlite3_bind_null(S->stmt, param->paramno + 1) == SQLITE_OK) {
++ return 1;
++ }
++ } else {
++ convert_to_long(param->parameter);
++ if (SQLITE_OK == sqlite3_bind_int(S->stmt, param->paramno + 1, Z_LVAL_P(param->parameter))) {
++ return 1;
++ }
++ }
++ pdo_sqlite_error_stmt(stmt);
++ return 0;
++
+ case PDO_PARAM_LOB:
+ if (Z_TYPE_P(param->parameter) == IS_RESOURCE) {
+ php_stream *stm;
+@@ -117,8 +132,24 @@
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ return 0;
+ }
++ } else if (Z_TYPE_P(param->parameter) == IS_NULL) {
++ if (sqlite3_bind_null(S->stmt, param->paramno + 1) == SQLITE_OK) {
++ return 1;
++ }
++ pdo_sqlite_error_stmt(stmt);
++ return 0;
++ } else {
++ convert_to_string(param->parameter);
++ }
++
++ if (SQLITE_OK == sqlite3_bind_blob(S->stmt, param->paramno + 1,
++ Z_STRVAL_P(param->parameter),
++ Z_STRLEN_P(param->parameter),
++ SQLITE_STATIC)) {
++ return 1;
+ }
+- /* fall through */
++ pdo_sqlite_error_stmt(stmt);
++ return 0;
+
+ case PDO_PARAM_STR:
+ default:
diff --git a/databases/php52-pgsql/Makefile b/databases/php52-pgsql/Makefile
new file mode 100644
index 000000000000..245aad8e6dae
--- /dev/null
+++ b/databases/php52-pgsql/Makefile
@@ -0,0 +1,14 @@
+# New ports collection makefile for: php52-pgsql
+# Date created: 17 Apr 2010
+# Whom: Alex Keda <admin@lissyara.su>
+#
+# $FreeBSD$
+#
+
+CATEGORIES= databases
+
+MASTERDIR= ${.CURDIR}/../../lang/php52
+
+PKGNAMESUFFIX= -pgsql
+
+.include "${MASTERDIR}/Makefile"
diff --git a/databases/php52-pgsql/files/patch-pgsql.c b/databases/php52-pgsql/files/patch-pgsql.c
new file mode 100644
index 000000000000..6ca128cb2095
--- /dev/null
+++ b/databases/php52-pgsql/files/patch-pgsql.c
@@ -0,0 +1,30 @@
+--- pgsql.c.orig 2007-10-04 01:31:58.000000000 +0200
++++ pgsql.c 2008-01-29 11:10:15.000000000 +0100
+@@ -62,6 +62,7 @@
+ #define PGSQL_MAX_LENGTH_OF_LONG 30
+ #define PGSQL_MAX_LENGTH_OF_DOUBLE 60
+
++#if UINT_MAX > LONG_MAX
+ #define PGSQL_RETURN_OID(oid) do { \
+ if (oid > LONG_MAX) { \
+ smart_str s = {0}; \
+@@ -71,7 +72,9 @@
+ } \
+ RETURN_LONG((long)oid); \
+ } while(0)
+-
++#else
++#define PGSQL_RETURN_OID(oid) RETURN_LONG((long)oid)
++#endif
+
+ #if HAVE_PQSETNONBLOCKING
+ #define PQ_SETNONBLOCKING(pg_link, flag) PQsetnonblocking(pg_link, flag)
+@@ -272,7 +275,7 @@
+ static int le_link, le_plink, le_result, le_lofp, le_string;
+
+ /* {{{ _php_pgsql_trim_message */
+-static char * _php_pgsql_trim_message(const char *message, int *len)
++static char * _php_pgsql_trim_message(const char *message, size_t *len)
+ {
+ register int i = strlen(message)-1;
+
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 355812574563..0311efe148c5 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -622,6 +622,7 @@
SUBDIR += philesight
SUBDIR += php4-posix
SUBDIR += php5-posix
+ SUBDIR += php52-posix
SUBDIR += pidof
SUBDIR += pipemeter
SUBDIR += plconfig
diff --git a/sysutils/php52-posix/Makefile b/sysutils/php52-posix/Makefile
new file mode 100644
index 000000000000..107f4d5d3b0c
--- /dev/null
+++ b/sysutils/php52-posix/Makefile
@@ -0,0 +1,14 @@
+# New ports collection makefile for: php52-posix
+# Date created: 17 Apr 2010
+# Whom: Alex Keda <admin@lissyara.su>
+#
+# $FreeBSD$
+#
+
+CATEGORIES= sysutils
+
+MASTERDIR= ${.CURDIR}/../../lang/php52
+
+PKGNAMESUFFIX= -posix
+
+.include "${MASTERDIR}/Makefile"
diff --git a/sysutils/php52-posix/files/patch-posix.c b/sysutils/php52-posix/files/patch-posix.c
new file mode 100644
index 000000000000..d2365b249569
--- /dev/null
+++ b/sysutils/php52-posix/files/patch-posix.c
@@ -0,0 +1,38 @@
+--- posix.c.orig Fri Feb 23 00:40:39 2007
++++ posix.c Sun May 13 17:52:27 2007
+@@ -838,7 +838,7 @@
+ #if defined(ZTS) && defined(HAVE_GETGRNAM_R) && defined(_SC_GETGR_R_SIZE_MAX)
+ buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+ if (buflen < 1) {
+- RETURN_FALSE;
++ buflen = 1024;
+ }
+ buf = emalloc(buflen);
+ g = &gbuf;
+@@ -888,7 +888,7 @@
+
+ grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+ if (grbuflen < 1) {
+- RETURN_FALSE;
++ grbuflen = 1024;
+ }
+
+ grbuf = emalloc(grbuflen);
+@@ -955,7 +955,7 @@
+ #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)
+ buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+ if (buflen < 1) {
+- RETURN_FALSE;
++ buflen = 1024;
+ }
+ buf = emalloc(buflen);
+ pw = &pwbuf;
+@@ -1004,7 +1004,7 @@
+ #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)
+ pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+ if (pwbuflen < 1) {
+- RETURN_FALSE;
++ pwbuflen = 1024;
+ }
+ pwbuf = emalloc(pwbuflen);
+