mirror of
https://github.com/php-win-ext/pecl-expect.git
synced 2026-03-24 05:02:05 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45c984eb53 | ||
|
|
a0786b31c2 | ||
|
|
b6e7f4d085 | ||
|
|
ab6a35e71b | ||
|
|
269bc73f95 | ||
|
|
4deb2dcbaf |
21
config.m4
21
config.m4
@@ -3,32 +3,23 @@ dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(expect,for expect support,
|
||||
[ --with-expect[=DIR] Include expect support (requires libexpect).])
|
||||
[ --with-expect[=DIR] Include expect support (requires libexpect >= 5.43.0).])
|
||||
|
||||
if test "$PHP_EXPECT" != "no"; then
|
||||
for i in $PHP_EXPECT /usr/local /usr ; do
|
||||
if test -f $i/include/expect.h; then
|
||||
LIBEXPECT_DIR=$i
|
||||
LIBEXPECT_INCDIR=$i/include
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$LIBEXPECT_DIR"; then
|
||||
AC_MSG_ERROR(Cannot find libexpect)
|
||||
AC_MSG_ERROR(expect extension requires libexpect version >= 5.43.0)
|
||||
fi
|
||||
|
||||
LIBEXPECT_LIBDIR=$LIBEXPECT_DIR/lib
|
||||
PHP_ADD_LIBRARY_WITH_PATH(expect, $LIBEXPECT_DIR/lib, EXPECT_SHARED_LIBADD)
|
||||
PHP_ADD_INCLUDE($LIBEXPECT_DIR/include)
|
||||
|
||||
PHP_CHECK_LIBRARY(expect, exp_popen,
|
||||
[ AC_DEFINE(HAVE_LIBEXPECT, 1, "") ],
|
||||
[ AC_MSG_ERROR(expect module requires libexpect.) ],
|
||||
[ -L$LIBEXPECT_LIBDIR ]
|
||||
)
|
||||
|
||||
PHP_ADD_LIBRARY_WITH_PATH(expect, $LIBEXPECT_LIBDIR, EXPECT_SHARED_LIBADD)
|
||||
PHP_ADD_INCLUDE($LIBEXPECT_INCDIR)
|
||||
|
||||
PHP_SUBST(EXPECT_SHARED_LIBADD)
|
||||
PHP_NEW_EXTENSION(expect, expect.c expect_fopen_wrapper.c, $ext_shared)
|
||||
|
||||
PHP_SUBST(EXPECT_SHARED_LIBADD)
|
||||
fi
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
ARG_WITH('expect' , 'expect support', 'no');
|
||||
|
||||
if (PHP_EXPECT != "no") {
|
||||
if (CHECK_HEADER_ADD_INCLUDE("expect.h", "CFLAGS_EXPECT", PHP_EXPECT) &&
|
||||
CHECK_LIB("expect.lib", "expect", PHP_EXPECT)) {
|
||||
if (CHECK_HEADER_ADD_INCLUDE("expect.h", "CFLAGS_EXPECT", PHP_EXPECT) && CHECK_LIB("expect.lib", "expect", PHP_EXPECT)) {
|
||||
EXTENSION("expect", "expect.c", PHP_EXPECT_SHARED, null, "php_expect.dll");
|
||||
} else {
|
||||
WARNING("expect not enabled; libraries and headers not found");
|
||||
|
||||
15
expect.c
15
expect.c
@@ -49,12 +49,13 @@ zend_module_entry expect_module_entry = {
|
||||
ZEND_GET_MODULE(expect)
|
||||
#endif
|
||||
|
||||
|
||||
/* {{{ PHP_INI_MH
|
||||
* */
|
||||
static PHP_INI_MH(OnSetExpectTimeout)
|
||||
{
|
||||
return OnUpdateLong (entry, new_value, new_value_length, &exp_timeout, mh_arg2, mh_arg3, stage TSRMLS_CC);
|
||||
if (new_value) {
|
||||
exp_timeout = atoi(new_value);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -63,7 +64,13 @@ static PHP_INI_MH(OnSetExpectTimeout)
|
||||
* */
|
||||
static PHP_INI_MH(OnSetExpectLogUser)
|
||||
{
|
||||
return OnUpdateBool (entry, new_value, new_value_length, &exp_loguser, mh_arg2, mh_arg3, stage TSRMLS_CC);
|
||||
if (new_value) {
|
||||
if (strncasecmp("on", new_value, sizeof("on"))) {
|
||||
exp_loguser = atoi(new_value);
|
||||
} else {
|
||||
exp_loguser = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -198,7 +205,7 @@ PHP_FUNCTION(expect_expectl)
|
||||
|
||||
if (Z_TYPE_PP(z_case) != IS_ARRAY) {
|
||||
efree (ecases);
|
||||
php_error_docref (NULL TSRMLS_CC, E_ERROR, "expression case must be an array");
|
||||
php_error_docref (NULL TSRMLS_CC, E_ERROR, "expect case must be an array");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
</maintainers>
|
||||
|
||||
<release>
|
||||
<version>0.1</version>
|
||||
<date>2005-10-01</date>
|
||||
<version>0.2</version>
|
||||
<date>2005-11-12</date>
|
||||
<state>beta</state>
|
||||
<notes>Initial release. Try it out!</notes>
|
||||
<notes>Fixed #5941</notes>
|
||||
</release>
|
||||
|
||||
<filelist>
|
||||
|
||||
Reference in New Issue
Block a user