| PHP Ръководство | ||
|---|---|---|
| Предишна страница | Следваща страница | |
This extension allows to interact with processes through PTY. You may consider using the expect:// wrapper with the filesystem functions which provide a simpler and more intuitive interface.
This module uses the functions of the expect library. You need libexpect version >= 5.43.0.
Това PECL разширение не е част от пакета на PHP. Информация относно инсталирането на това PECL разширение може да се намери в главата от ръководството Инсталиране на PECL разширения. Допълнителна информация, като нови издания, изтегляния, изходни файлове, информация за поддръжката и CHANGELOG може да се намери тук: http://pecl.php.net/package/expect.
В PHP 4 това PECL разширение
може да бъде намерено в папка ext/ от дистрибутива на
изходните файлове на PHP или на PECL връзката по-горе.
In order to use these functions you must compile PHP with expect support
by using the --with-expect[=DIR]
configure option.
Windows users will enable php_expect.dll inside of php.ini in order to use these functions. В PHP 4 този DLL файл се намира в папка extensions/ на PHP дистрибутива. DLL файла на това разширение може да бъде изтеглен или от страницата за изтегляне на PHP или от http://pecl4win.php.net/
Поведението на тези функции зависи от настройките в php.ini.
In order to configure expect extension, there are configuration options in the configuration file php.ini.
За по-детайлна информация и дефинициите на константите PHP_INI_*, вижте .Тук има кратко описание на конфигурационните директиви.
expect.timeout
integerThe timeout period for waiting for the data, when using the expect_expectl() function.
A value of "-1" disables a timeout from occurring.
Забележка: A value of "0" causes the expect_expectl() function to return immediately.
expect.loguser
booleanWhether expect should send any output from the spawned process to stdout. Since interactive programs typically echo their input, this usually suffices to show both sides of the conversation.
expect.logfile
stringName of the file, where the output from the spawned process will be written. If this file doesn't exist, it will be created.
Забележка: If this configuration is not empty, the output is written regardless of the value of expect.loguser.
expect_popen() returns an open PTY stream used by expect_expectl().
Константите по-долу са дефинирани в това разширение и ще бъдат налични единствено, когато това разширение е компилирано в PHP или динамично пуснато по време на изпълнение.
Indicates that the pattern is a glob-style string pattern.
Indicates that the pattern is an exact string.
Indicates that the pattern is a regexp-style string pattern.
Value, returned by expect_expectl(), when EOF is reached.
Value, returned by expect_expectl() upon timeout of seconds, specified in value of expect.timeout
Value, returned by expect_expectl() if no pattern have been matched.
This example connects to the remote host via SSH, and prints the remote uptime.
| Предишна страница | Начало | Следваща страница |
| read_exif_data | Начало на раздела | expect_expectl |