Skip to content

This package can be used to manage the execution of external programs from PHP

Notifications You must be signed in to change notification settings

AntonShevchuk/program

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Program

This package can be used to manage the execution of external programs from PHP.

It can build a command line string to execute an external program synchronously or in background, pass switches to define program options, and define the program input or output files.

It also supports using driver classes that can build complex command line switches to simplify the definition of program options in a simplified way.

Initialization

For initialization Program package insert next code:

include_once 'Program.php';

Create Program entity

For create entity of program you should be use method factory:

// set full path to program binary
$mplayer  =& Program::factory('mplayer',  array('binary' => '/usr/bin/mplayer'));

Params Manipulation

You can add any params to execute string:

// add param string
$mplayer -> addParam('video_in.avi');
$mplayer -> addParamsString('video_in.avi');

// add param prefix and value
$mplayer -> addParam('-sstep', 4);

// add params array
$mplayer -> addParams(array('video_in.avi', '-sstep' => 4));

Get params

$mplayer->getParams();

Clear params

$mplayer->clearParams();

Input/Output file

For many application you can set input and output file:

  • setInputFile
  • getInputFile
  • setOutputFile
  • getOutputFile

Execute program

For run program use method exec or execInBackground (for unix systems only)

About

This package can be used to manage the execution of external programs from PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages