GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - remexec/remexec-api-php: RemExec API for PHP

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
COPYING.LESSER
COPYING.LESSER
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

RemExec API for PHP

Provide basic commands for RemExec. Required composer to generate autoload.php.

Connection

use RemExec\Api\RemExec;
$rx = new RemExec('localhost:3500', 5); // timeout = 5 sec.
//...work with $rx...
$rx->close();

Send file streams to server's sandbox

$rx->sendFileStream('file.txt', 'The very secret file');

Arguments:

  • (string) $name - file name to store on server;
  • (string) $content - file contents.

Returns:

  • (int) 0 - file successfully transferred;
  • (int) 5 - can't create file.

Execute remote task

$rx->execTask('taskName', ['arg1', 'arg2', 'arg3'], function($stream, $body){
	echo "> Stream(".$stream.", ".strlen($body).")\n";
	echo $body."\n\n";
});

Arguments:

  • (string) $task - name of task on remote server;
  • (array) $args - arguments to pass to task;
  • (callable) $callback - function called when received data from executing task. Takes 2 arguments:
    • (int) $stream - number of stream (1 - stdout, 2 - stderr);
    • (string) $body - stream contents.

Returns:

  • (bool) false - unexpected unknown server error;
  • (int) 0 - task executed successfully;
  • (int) 2 - task not found.

Fetch files from server's sandbox

$rx->fetchFileStream('file.txt');

Arguments:

  • (string) $name - file name on remote server;

Returns:

  • (null) - file not found;
  • (string) - file contents.

About

RemExec API for PHP

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.