diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2010-04-23 16:34:39 +0000 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2010-04-23 16:34:39 +0000 |
commit | c65eb7dc0ec96144ef1a218665852f0ed15bed9b (patch) | |
tree | f75b9a46b95d7603975291ecc7559f6eb811da64 /databases | |
parent | - PHP 5.2 slave port (diff) |
- PHP 5.2 slave port
PR: 145772
Submitted by: Alex Keda
Notes
Notes:
svn path=/head/; revision=253115
Diffstat (limited to 'databases')
-rw-r--r-- | databases/Makefile | 1 | ||||
-rw-r--r-- | databases/php52-pdo_sqlite/Makefile | 14 | ||||
-rw-r--r-- | databases/php52-pdo_sqlite/files/patch-sqlite_statement.c | 50 | ||||
-rw-r--r-- | databases/php52-pgsql/Makefile | 14 | ||||
-rw-r--r-- | databases/php52-pgsql/files/patch-pgsql.c | 30 |
5 files changed, 109 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; + |