From 5583ef2a0193a1b76b0a5f319640a69b4cb4202a Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Sat, 22 Dec 2007 00:04:13 +0000 Subject: [PATCH] MFB: Upgrade to the new-reference-structure - Moved the intro text to book.xml - Changed the intro ID to intro. from .intro - Changed constants.xml to be an appendix - Moved the examples into examples.xml NOTE: The chapter ID is expect.examples, the first example is expect.examples-usage - Moved the requirements and resources sections to setup.xml - Moved the configure and ini entities to setup.xml - Moved the constants entity to book.xml git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@248711 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/expect/book.xml | 48 ++++++++++ reference/expect/constants.xml | 6 +- reference/expect/examples.xml | 139 +++++++++++++++++++++++++++++ reference/expect/reference.xml | 157 +-------------------------------- reference/expect/setup.xml | 58 ++++++++++++ 5 files changed, 252 insertions(+), 156 deletions(-) create mode 100644 reference/expect/book.xml create mode 100644 reference/expect/examples.xml create mode 100644 reference/expect/setup.xml diff --git a/reference/expect/book.xml b/reference/expect/book.xml new file mode 100644 index 0000000000..49800ddd69 --- /dev/null +++ b/reference/expect/book.xml @@ -0,0 +1,48 @@ + + + + + + + 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. + + + + + &reference.expect.setup; + &reference.expect.constants; + &reference.expect.examples; + &reference.expect.reference; + + + + + diff --git a/reference/expect/constants.xml b/reference/expect/constants.xml index 312266604a..801626dc96 100644 --- a/reference/expect/constants.xml +++ b/reference/expect/constants.xml @@ -1,6 +1,6 @@ - -
+ + &reftitle.constants; &extension.constants; @@ -74,7 +74,7 @@ -
+ + + + &reftitle.examples; +
+ Expect Usage Examples + + Expect Usage Example + + This example connects to the remote host via SSH, and prints the remote + uptime. + + + "password:", 1 => PASSWORD) +); + +switch (expect_expectl ($stream, $cases)) { + case PASSWORD: + fwrite ($stream, "password\n"); + break; + + default: + die ("Error was occurred while connecting to the remote host!\n"); +} + +while ($line = fgets($stream)) { + print $line; +} +fclose ($stream); +?> +]]> + + + + + The following example connects to the remote host, determines whether + installed OS is for 32 or 64 bit, then runs update for specific package. + + + Another Expect Usage Example + + +]]> + + +
+
+ + + diff --git a/reference/expect/reference.xml b/reference/expect/reference.xml index 714c673ef0..b69afa087b 100644 --- a/reference/expect/reference.xml +++ b/reference/expect/reference.xml @@ -1,162 +1,12 @@ - - - + - 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; - - expect_popen returns an open PTY stream used by - expect_expectl. - -
- - &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 ($stream, $cases)) { - case PASSWORD: - fwrite ($stream, "password\n"); - break; - - default: - die ("Error was occurred while connecting to the remote host!\n"); -} - -while ($line = fgets ($stream)) { - print $line; -} -fclose ($stream); -?> -]]> - - - - - The following example connects to the remote host, determines whether - installed OS is for 32 or 64 bit, then runs update for specific package. - - - Another Expect Usage Example - - -]]> - - -
-
- + Expect &Functions; &reference.expect.entities.functions;
+ + diff --git a/reference/expect/setup.xml b/reference/expect/setup.xml new file mode 100644 index 0000000000..11ff62ac8f --- /dev/null +++ b/reference/expect/setup.xml @@ -0,0 +1,58 @@ + + + + + &reftitle.setup; + + +
+ &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; + + expect_popen returns an open PTY stream used by + expect_expectl. + +
+ + +
+ + +