summaryrefslogtreecommitdiff
path: root/ext/gettext
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gettext')
-rw-r--r--ext/gettext/Makefile.in7
-rw-r--r--ext/gettext/config.m441
-rw-r--r--ext/gettext/gettext.c180
-rw-r--r--ext/gettext/php_gettext.h57
-rw-r--r--ext/gettext/setup.stub6
5 files changed, 0 insertions, 291 deletions
diff --git a/ext/gettext/Makefile.in b/ext/gettext/Makefile.in
deleted file mode 100644
index 522c367c4d..0000000000
--- a/ext/gettext/Makefile.in
+++ /dev/null
@@ -1,7 +0,0 @@
-
-LTLIBRARY_NAME = libgettext.la
-LTLIBRARY_SOURCES = gettext.c
-LTLIBRARY_SHARED_NAME = gettext.la
-LTLIBRARY_SHARED_LIBADD = $(GETTEXT_SHARED_LIBADD)
-
-include $(top_srcdir)/build/dynlib.mk
diff --git a/ext/gettext/config.m4 b/ext/gettext/config.m4
deleted file mode 100644
index 4c8134bbc1..0000000000
--- a/ext/gettext/config.m4
+++ /dev/null
@@ -1,41 +0,0 @@
-dnl $Id$
-dnl config.m4 for extension gettext
-dnl don't forget to call PHP_EXTENSION(gettext)
-
-PHP_ARG_WITH(gettext,whether to include GNU gettext support,
-[ --with-gettext[=DIR] Include GNU gettext support. DIR is the gettext
- install directory, defaults to /usr/local])
-
-if test "$PHP_GETTEXT" != "no"; then
- for i in /usr /usr/local $PHP_GETTEXT; do
- if test -r $i/include/libintl.h; then
- GETTEXT_DIR=$i
- fi
- done
-
- if test -z "$GETTEXT_DIR"; then
- AC_MSG_ERROR(Cannot locate header file libintl.h)
- fi
-
- GETTEXT_LIBDIR=$GETTEXT_DIR/lib
- GETTEXT_INCDIR=$GETTEXT_DIR/include
-
- O_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR"
- AC_CHECK_LIB(intl, bindtextdomain, GETTEXT_LIBS="intl",[
- AC_CHECK_LIB(c, bindtextdomain, GETTEXT_LIBS= ,[
- AC_MSG_ERROR(Unable to find required gettext library)
- ])
- ])
- LDFLAGS="$O_LDFLAGS"
-
- AC_DEFINE(HAVE_LIBINTL,1,[ ])
- PHP_EXTENSION(gettext, $ext_shared)
- PHP_SUBST(GETTEXT_SHARED_LIBADD)
-
- if test -n "$GETTEXT_LIBS"; then
- AC_ADD_LIBRARY_WITH_PATH($GETTEXT_LIBS, $GETTEXT_LIBDIR, GETTEXT_SHARED_LIBADD)
- fi
-
- AC_ADD_INCLUDE($GETTEXT_INCDIR)
-fi
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c
deleted file mode 100644
index cf70362289..0000000000
--- a/ext/gettext/gettext.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP version 4.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 2.02 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available at through the world-wide-web at |
- | http://www.php.net/license/2_02.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: Alex Plotnick <alex@wgate.com> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id$ */
-
-#include <stdio.h>
-#include "php.h"
-#include "php_gettext.h"
-
-#if HAVE_LIBINTL
-
-#include <libintl.h>
-#include "ext/standard/info.h"
-
-function_entry php_gettext_functions[] = {
- PHP_FE(textdomain, NULL)
- PHP_FE(gettext, NULL)
- PHP_FALIAS(_, gettext, NULL)
- PHP_FE(dgettext, NULL)
- PHP_FE(dcgettext, NULL)
- PHP_FE(bindtextdomain, NULL)
- {NULL, NULL, NULL}
-};
-
-zend_module_entry php_gettext_module_entry = {
- "gettext", php_gettext_functions, NULL, NULL, NULL, NULL, PHP_MINFO(gettext), STANDARD_MODULE_PROPERTIES
-};
-
-#ifdef COMPILE_DL_GETTEXT
-ZEND_GET_MODULE(php_gettext)
-#endif
-
-PHP_MINFO_FUNCTION(gettext)
-{
- php_info_print_table_start();
- php_info_print_table_row(2, "GNU GetText Support", "enabled");
- php_info_print_table_end();
-}
-
-/* {{{ proto string textdomain(string domain)
- Set the textdomain to "domain". Returns the current domain. */
-PHP_FUNCTION(textdomain)
-{
- pval **domain;
- char *domain_name, *retval;
- char *val;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &domain) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(domain);
-
- val = (*domain)->value.str.val;
- if (strcmp(val, "") && strcmp(val, "0")) {
- domain_name = val;
- } else {
- domain_name = NULL;
- }
-
- retval = textdomain(domain_name);
-
- RETURN_STRING(retval, 1);
-}
-/* }}} */
-
-/* {{{ proto string gettext(string msgid)
- Return the translation of msgid for the current domain, or msgid unaltered if a translation does not exist. */
-PHP_FUNCTION(gettext)
-{
- pval **msgid;
- char *msgstr;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &msgid) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(msgid);
-
- msgstr = gettext((*msgid)->value.str.val);
-
- RETURN_STRING(msgstr, 1);
-}
-/* }}} */
-
-/* {{{ proto string dgettext(string domain_name, string msgid)
- Return the translation of msgid for domain_name, or msgid unaltered if a translation does not exist. */
-PHP_FUNCTION(dgettext)
-{
- pval **domain_name, **msgid;
- char *msgstr;
-
- if (ZEND_NUM_ARGS() != 2
- || zend_get_parameters_ex(2, &domain_name, &msgid) == FAILURE)
- {
- WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(domain_name);
- convert_to_string_ex(msgid);
-
- msgstr = dgettext((*domain_name)->value.str.val, (*msgid)->value.str.val);
-
- RETURN_STRING(msgstr, 1);
-}
-/* }}} */
-
-/* {{{ proto string dcgettext(string domain_name, string msgid, long category)
- Return the translation of msgid for domain_name and category, or msgid unaltered if a translation does not exist. */
-PHP_FUNCTION(dcgettext)
-{
- pval **domain_name, **msgid, **category;
- char *msgstr;
-
- if (ZEND_NUM_ARGS() != 3
- || zend_get_parameters_ex(3, &domain_name, &msgid, &category) == FAILURE)
- {
- WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(domain_name);
- convert_to_string_ex(msgid);
- convert_to_long_ex(category);
-
- msgstr = dcgettext((*domain_name)->value.str.val,
- (*msgid)->value.str.val,
- (*category)->value.lval);
-
- RETURN_STRING(msgstr, 1);
-}
-/* }}} */
-
-/* {{{ proto string bindtextdomain(string domain_name, string dir)
- Bind to the text domain domain_name, looking for translations in dir. Returns the current domain. */
-PHP_FUNCTION(bindtextdomain)
-{
- pval **domain_name, **dir;
- char *retval, *dir_name;
- char *val;
-
- if (ZEND_NUM_ARGS() != 2
- || zend_get_parameters_ex(2, &domain_name, &dir) == FAILURE)
- {
- WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(domain_name);
- convert_to_string_ex(dir);
-
- val = (*dir)->value.str.val;
- if (strcmp(val, "") && strcmp(val, "0")) {
- dir_name = val;
- } else {
- dir_name = NULL;
- }
-
- retval = bindtextdomain((*domain_name)->value.str.val, dir_name);
-
- RETURN_STRING(retval, 1);
-}
-/* }}} */
-
-#endif /* HAVE_LIBINTL */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h
deleted file mode 100644
index a6f156a0a8..0000000000
--- a/ext/gettext/php_gettext.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP HTML Embedded Scripting Language Version 3.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-1999 PHP Development Team (See Credits file) |
- +----------------------------------------------------------------------+
- | This program is free software; you can redistribute it and/or modify |
- | it under the terms of one of the following licenses: |
- | |
- | A) the GNU General Public License as published by the Free Software |
- | Foundation; either version 2 of the License, or (at your option) |
- | any later version. |
- | |
- | B) the PHP License as published by the PHP Development Team and |
- | included in the distribution in the file: LICENSE |
- | |
- | This program is distributed in the hope that it will be useful, |
- | but WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
- | GNU General Public License for more details. |
- | |
- | You should have received a copy of both licenses referred to here. |
- | If you did not, or have any questions about PHP licensing, please |
- | contact core@php.net. |
- +----------------------------------------------------------------------+
- | Author: Alex Plotnick <alex@wgate.com> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id$ */
-
-#ifndef _GETTEXT_H
-#define _GETTEXT_H
-
-#if HAVE_LIBINTL
-#ifndef INIT_FUNC_ARGS
-#include "modules.h"
-#endif
-
-extern zend_module_entry php_gettext_module_entry;
-#define gettext_module_ptr &php_gettext_module_entry
-
-PHP_MINFO_FUNCTION(gettext);
-
-PHP_FUNCTION(textdomain);
-PHP_FUNCTION(gettext);
-PHP_FUNCTION(dgettext);
-PHP_FUNCTION(dcgettext);
-PHP_FUNCTION(bindtextdomain);
-
-#else
-#define gettext_module_ptr NULL
-#endif /* HAVE_LIBINTL */
-
-#define phpext_gettext_ptr gettext_module_ptr
-
-#endif /* _GETTEXT_H */
diff --git a/ext/gettext/setup.stub b/ext/gettext/setup.stub
deleted file mode 100644
index cc9fdd43c8..0000000000
--- a/ext/gettext/setup.stub
+++ /dev/null
@@ -1,6 +0,0 @@
-# $Id$
-
-define_option with-gettext 'gettext support?' yesnodir \
- "yes /usr/local" \
-' Whether to include gettext support.'
-