From 5bef6a7874f5bcf7eae69acbfd6aecc6f2a5e2ce Mon Sep 17 00:00:00 2001 From: Michael Spector Date: Sun, 2 Oct 2005 07:31:52 +0000 Subject: [PATCH] add note about using expect wrapper git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@197330 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/expect/reference.xml | 105 +++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 reference/expect/reference.xml diff --git a/reference/expect/reference.xml b/reference/expect/reference.xml new file mode 100644 index 0000000000..0d6b202417 --- /dev/null +++ b/reference/expect/reference.xml @@ -0,0 +1,105 @@ + + + + + + + Expect Functions + Expect + + +
+ &reftitle.intro; + + 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. + +
+ +
+ &reftitle.required; + + This module uses the functions of the expect library. + You need libexpect version >= 5.43.0. + +
+ + &reference.expect.configure; + + &reference.expect.ini; + +
+ &reftitle.resources; + &no.resource; +
+ + &reference.expect.constants; + +
+ &reftitle.examples; + + This example connects to the remote host via SSH, and prints the remote + uptime. + + + Expect Usage Example + + "password:", 1 => "PASSWORD") +); + +switch (expect_expectl ($fp, $cases)) +{ + case "PASSWORD": + fwrite ($fp, "password\n"); + break; + + default: + die ("Error was occurred while connecting to the remote host!\n"); +} + +while ($line = fgets ($fp)) { + print $line; +} +fclose ($fp); + +?> +]]> + + +
+
+ +&reference.expect.functions; + +
+