Overview

Namespaces

  • Jyxo
    • Beholder
      • TestCase
    • Gettext
      • Parser
    • Input
      • Chain
      • Filter
      • Validator
    • Mail
      • Email
        • Attachment
      • Parser
      • Sender
    • Rpc
      • Json
      • Xml
    • Shell
    • Spl
    • Svn
    • Time
    • Webdav
  • PHP

Classes

  • Client

Exceptions

  • Exception
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated

Class Client

Class for executing external commands.

Namespace: Jyxo\Shell
Category: Jyxo
Package: Jyxo\Shell
Copyright: Copyright (c) 2005-2011 Jyxo, s.r.o.
License: https://github.com/jyxo/php/blob/master/license.txt
Author: Ondřej Procházka
Author: Matěj Humpál
Located at Shell/Client.php
Methods summary
public
# __construct( string $cwd = '', array $env = array() )

Constructor.

Constructor.

Parameters

$cwd
string
Working directory
$env
array
Array of environment properties
public Jyxo\Shell\Client
# loadProcessList( )

Returns a list of processes.

Returns a list of processes.

Works only on Linux.

Returns

Jyxo\Shell\Client
public boolean
# processExists( string $name )

Checks if there is a process of the given name.

Checks if there is a process of the given name.

Works only on Linux.

Parameters

$name
string
Process name

Returns

boolean
public Jyxo\Shell\Client
# killProcess( string $name )

Kills all processes of the given name.

Kills all processes of the given name.

Works only on Linux.

Parameters

$name
string
Process name

Returns

Jyxo\Shell\Client
public Jyxo\Shell\Client
# setCwd( string $cwd = '' )

Sets working directory.

Sets working directory.

Defaults to null.

Parameters

$cwd
string
Working directory

Returns

Jyxo\Shell\Client
public Jyxo\Shell\Client
# setEnv( array $env )

Adds one or more environment properties.

Adds one or more environment properties.

Parameters

$env
array
Array of properties

Returns

Jyxo\Shell\Client
public Jyxo\Shell\Client
# clearEnv( )

Removes environment properties.

Removes environment properties.

Returns

Jyxo\Shell\Client
public Jyxo\Shell\Client
# exec( string $cmd, integer & $status = null )

Executes an external command.

Executes an external command.

Captures stdout and stderr. Throws an exception on status code != 0.

Parameters

$cmd
string
Command to execute
$status
integer
Status code

Returns

Jyxo\Shell\Client

Throws

Jyxo\Shell\Exception
On execution error
public string
# getOut( )

Returns stdout contents.

Returns stdout contents.

Returns

string
public string
# getError( )

Returns stderr contents.

Returns stderr contents.

Returns

string
Properties summary
protected array $processList
#

List of running processes.

List of running processes.

protected string $cwd
#

Actual working directory.

Actual working directory.

protected array $env array()
#

Environment properties.

Environment properties.

protected string $out
#

Stdout output.

Stdout output.

protected string $error
#

Stderr output.

Stderr output.

Jyxo PHP Library API documentation generated by ApiGen 2.3.0