<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ssh2.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.ssh2-shell-resize.php',
    1 => 'ssh2_shell_resize',
    2 => 'Change the dimensions of a channel\'s pseudo-terminal',
  ),
  'up' => 
  array (
    0 => 'ref.ssh2.php',
    1 => 'SSH2 函数',
  ),
  'prev' => 
  array (
    0 => 'function.ssh2-shell.php',
    1 => 'ssh2_shell',
  ),
  'next' => 
  array (
    0 => 'function.ssh2-tunnel.php',
    1 => 'ssh2_tunnel',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ssh2/functions/ssh2-shell-resize.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ssh2-shell-resize" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ssh2_shell_resize</h1>
  <p class="verinfo">(PECL ssh2 &gt;= 1.4)</p><p class="refpurpose"><span class="refname">ssh2_shell_resize</span> &mdash; <span class="dc-title">Change the dimensions of a channel&#039;s pseudo-terminal</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ssh2-shell-resize-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">function</span> <span class="methodname"><strong>ssh2_shell_resize</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$channel</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$width</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$height</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$width_px</code><span class="initializer"> = 0</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$height_px</code><span class="initializer"> = 0</span></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   Requests that the pseudo-terminal (PTY) attached to the given
   <code class="parameter">channel</code> be resized to the given dimensions.
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="simpara">
    The extension declares only the first three parameters, under the name
    <code class="literal">session</code> for <code class="parameter">channel</code>. As a
    result, <code class="parameter">width_px</code> and
    <code class="parameter">height_px</code> can only be passed positionally.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ssh2-shell-resize-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">channel</code></dt>
    <dd>
     <p class="simpara">
      An SSH channel stream, as returned by <span class="function"><a href="function.ssh2-exec.php" class="function">ssh2_exec()</a></span> or
      <span class="function"><a href="function.ssh2-shell.php" class="function">ssh2_shell()</a></span>.
     </p>
    </dd>
   
   
    <dt><code class="parameter">width</code></dt>
    <dd>
     <p class="simpara">
      The width of the terminal, in characters.
     </p>
    </dd>
   
   
    <dt><code class="parameter">height</code></dt>
    <dd>
     <p class="simpara">
      The height of the terminal, in characters.
     </p>
    </dd>
   
   
    <dt><code class="parameter">width_px</code></dt>
    <dd>
     <p class="simpara">
      The width of the terminal in pixels, or <code class="literal">0</code> to leave
      the pixel dimensions unspecified.
     </p>
    </dd>
   
   
    <dt><code class="parameter">height_px</code></dt>
    <dd>
     <p class="simpara">
      The height of the terminal in pixels, or <code class="literal">0</code> to leave
      the pixel dimensions unspecified.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ssh2-shell-resize-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="simpara">
   Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> when <code class="parameter">channel</code> is not an
   SSH channel stream.
  </p>
  <p class="simpara">
   The outcome of the resize request itself is not reported: <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> is
   returned even when the remote end does not honour it.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.ssh2-shell-resize-errors">
  <h3 class="title">错误／异常</h3>
  <p class="simpara">
   An <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> is emitted when
   <code class="parameter">channel</code> is not an SSH channel stream.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ssh2-shell-resize-examples">
  <h3 class="title">示例</h3>
  <div class="example" id="example-1">
   <p><strong>示例 #1 Resizing the pseudo-terminal of a shell</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
$connection </span><span style="color: #007700">= </span><span style="color: #0000BB">ssh2_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'shell.example.com'</span><span style="color: #007700">, </span><span style="color: #0000BB">22</span><span style="color: #007700">);
</span><span style="color: #0000BB">ssh2_auth_password</span><span style="color: #007700">(</span><span style="color: #0000BB">$connection</span><span style="color: #007700">, </span><span style="color: #DD0000">'username'</span><span style="color: #007700">, </span><span style="color: #DD0000">'password'</span><span style="color: #007700">);

</span><span style="color: #0000BB">$shell </span><span style="color: #007700">= </span><span style="color: #0000BB">ssh2_shell</span><span style="color: #007700">(</span><span style="color: #0000BB">$connection</span><span style="color: #007700">, </span><span style="color: #DD0000">'xterm'</span><span style="color: #007700">, </span><span style="color: #0000BB">null</span><span style="color: #007700">, </span><span style="color: #0000BB">80</span><span style="color: #007700">, </span><span style="color: #0000BB">24</span><span style="color: #007700">);

</span><span style="color: #FF8000">// Tell the remote end the terminal is now 132 columns by 43 rows
</span><span style="color: #0000BB">ssh2_shell_resize</span><span style="color: #007700">(</span><span style="color: #0000BB">$shell</span><span style="color: #007700">, </span><span style="color: #0000BB">132</span><span style="color: #007700">, </span><span style="color: #0000BB">43</span><span style="color: #007700">);
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ssh2-shell-resize-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.ssh2-shell.php" class="function" rel="rdfs-seeAlso">ssh2_shell()</a> - Request an interactive shell</span></li>
   <li><span class="function"><a href="function.ssh2-exec.php" class="function" rel="rdfs-seeAlso">ssh2_exec()</a> - Execute a command on a remote server</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>