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 | |
|---|---|---|---|
|
|
403fa58b6f | ||
|
|
832872beac | ||
|
|
3fb8cf045d | ||
|
|
60eb6b9f16 | ||
|
|
cc2e72e3d2 | ||
|
|
d19b005e00 |
12
expect.c
12
expect.c
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 and 7 |
|
||||
| PHP Version 5, 7 and 8 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2004 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -318,7 +318,7 @@ PHP_FUNCTION(expect_expectl)
|
||||
|
||||
if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3) { WRONG_PARAM_COUNT; }
|
||||
|
||||
if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, "ra|z", &z_stream, &z_cases, &z_match) == FAILURE) {
|
||||
if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, "ra|z/", &z_stream, &z_cases, &z_match) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -452,11 +452,15 @@ PHP_FUNCTION(expect_expectl)
|
||||
if (z_match && exp_match && exp_match_len > 0) {
|
||||
char *tmp = (char *)emalloc (sizeof(char) * (exp_match_len + 1));
|
||||
strlcpy (tmp, exp_match, exp_match_len + 1);
|
||||
zval_dtor (z_match);
|
||||
array_init(z_match);
|
||||
#if PHP_MAJOR_VERSION >= 7
|
||||
z_match = zend_try_array_init(z_match);
|
||||
if (!z_match) {
|
||||
return;
|
||||
}
|
||||
add_index_string(z_match, 0, tmp);
|
||||
#else
|
||||
zval_dtor (z_match);
|
||||
array_init(z_match);
|
||||
add_index_string(z_match, 0, tmp, 1);
|
||||
#endif
|
||||
/* Get case that was matched */
|
||||
|
||||
11
package.xml
11
package.xml
@@ -9,9 +9,9 @@ http://pear.php.net/dtd/package-2.0.xsd">
|
||||
<description>This extension allows to interact with processes through PTY, using expect library.
|
||||
</description>
|
||||
<lead>
|
||||
<name>Simon Bazley</name>
|
||||
<user>sibaz</user>
|
||||
<email>sibaz@sibaz.com</email>
|
||||
<name>Michael Spector</name>
|
||||
<user>michael</user>
|
||||
<email>michael@php.net</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>2020-01-13</date>
|
||||
@@ -26,8 +26,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
|
||||
</stability>
|
||||
<license uri="http://www.php.net/license">PHP License</license>
|
||||
<notes>
|
||||
Added code to support API for PHP 7.x
|
||||
Updated build scripts, to support 64bit centos
|
||||
Added LICENSE. Fixed RPM build for 64bit.
|
||||
</notes>
|
||||
<contents>
|
||||
<dir name="/">
|
||||
@@ -52,7 +51,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
|
||||
<required>
|
||||
<php>
|
||||
<min>4.0.0</min>
|
||||
<max>7.99.99</max>
|
||||
<max>8.99.99</max>
|
||||
</php>
|
||||
<pearinstaller>
|
||||
<min>1.4.0b1</min>
|
||||
|
||||
14
php_expect.h
14
php_expect.h
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 and 7 |
|
||||
| PHP Version 5, 7 and 8 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2004 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -68,6 +68,18 @@ ZEND_END_MODULE_GLOBALS(expect)
|
||||
#include "TSRM.h"
|
||||
#endif /* ZTS */
|
||||
|
||||
|
||||
#if ZEND_MODULE_API_NO >= 20190128
|
||||
#ifndef TSRMLS_CC
|
||||
#define TSRMLS_CC
|
||||
#endif
|
||||
#ifndef TSRMLS_DC
|
||||
#define TSRMLS_DC
|
||||
#endif
|
||||
#ifndef TSRMLS_FETCH
|
||||
#define TSRMLS_FETCH()
|
||||
#endif
|
||||
#endif
|
||||
#endif /* PHP_EXPECT_H */
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user