PHP remote closure executor

Related tags

Miscellaneous Jumper
Overview

Jumper

Build Status Code Coverage Scrutinizer Quality Score Dependency Status

Allow you to execute PHP Closure in other distant computer via SSH and without client/server setup.

Source computer dependency: PHP >= 5.3 (so might work on windows but untested)

Target computer dependencies: PHP >= 5.3, SSHd

<?php

require 'vendor/autoload.php';

$authentication = new \Jumper\Communicator\Authentication\Rsa('root', $_SERVER['HOME'] . '/.ssh/id_rsa');
$communicator = new \Jumper\Communicator\Ssh($authentication, array('host' => '127.0.0.1'));

$executor = new \Jumper\Executor($communicator, new Jumper\Stringifier\Native());

$array = array(2, 1, 4, 3);
$rsortedArray = $executor->run(
    function() use ($array) {
        rsort($array); 
        return $array;
    }
);

var_dump($rsortedArray);
// should print
/*
array(4) {
  [0]=>
  int(4)
  [1]=>
  int(3)
  [2]=>
  int(2)
  [3]=>
  int(1)
}
*/
You might also like...
PHP Meminfo is a PHP extension that gives you insights on the PHP memory content

MEMINFO PHP Meminfo is a PHP extension that gives you insights on the PHP memory content. Its main goal is to help you understand memory leaks: by loo

A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

A multithreaded application server for PHP, written in PHP.

appserver.io, a PHP application server This is the main repository for the appserver.io project. What is appserver.io appserver.io is a multithreaded

Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP

Lodash-PHP Lodash-PHP is a port of the Lodash JS library to PHP. It is a set of easy to use utility functions for everyday PHP projects. Lodash-PHP tr

A PHP 5.3+ and PHP 7.3 framework for OpenGraph Protocol

Opengraph Test with Atoum cd Opengraph/ curl -s https://getcomposer.org/installer | php php composer.phar install --dev ./vendor/atoum/atoum/bin/atoum

A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch screens with a resolution of 1024x600 connected to a Raspberry Pi.

EDStatusPanel A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch scr

🐘 A probe program for PHP environment (一款精美的 PHP 探針, 又名X探針、劉海探針)

Simplified Chinese | 简体中文 Traditional Chinese(Taiwan) | 正體中文(臺灣) Traditional Chinese(Hong Kong) | 正體中文(香港) Japanese | 日本語 😎 X Prober This is a probe

PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP language

php-text-analysis PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP l

PHP generics written in PHP

PHP generics written in PHP Require PHP = 7.4 Composer (PSR-4 Autoload) Table of contents How it works Quick start Example Features Tests How it work

Comments
  • Using same executor object for several execution issue

    Using same executor object for several execution issue

    <?php
    
    require_once __DIR__ . '/../vendor/autoload.php';
    
    $executor = new \Jumper\Executor(
        array(
            'host' => '172.23.36.75',
            'authentication' => array(
                'class' => 'Ssh\Authentication\PublicKeyFile',
                'args'  => array(
                    'root',
                    '~/.ssh/id_rsa.pub',
                    '~/.ssh/id_rsa'
                )
            )
        )
    );
    
    $array = array(1, 2, 3, 4);
    $executor->run(function() use ($array) {rsort($array); return $array;});
    $executor->run(function() use ($array) {rsort($array); return $array;});
    

    Throw an error

    Warning: ssh2_auth_pubkey_file(): Authentication failed for root using public key: Invalid public key, too short in ./jumper/vendor/herzult/php-ssh/src/Ssh/Authentication/PublicKeyFile.php on line 46
    
    Call Stack:
        0.0009     651184   1. {main}() ./jumper/demo/test.php:0
        0.2916    5544416   2. Jumper\Executor->run() ./jumper/demo/test.php:21
        0.3008    5554784   3. Ssh\Exec->run() ./jumper/src/Jumper/Executor.php:106
        0.3008    5555184   4. Ssh\AbstractResourceHolder->getResource() ./jumper/vendor/herzult/php-ssh/src/Ssh/Exec.php:22
        0.3008    5555184   5. Ssh\Exec->createResource() ./jumper/vendor/herzult/php-ssh/src/Ssh/AbstractResourceHolder.php:25
        0.3008    5555184   6. Ssh\Subsystem->getSessionResource() ./jumper/vendor/herzult/php-ssh/src/Ssh/Exec.php:17
        0.3008    5555184   7. Ssh\AbstractResourceHolder->getResource() ./jumper/vendor/herzult/php-ssh/src/Ssh/Subsystem.php:39
        0.3009    5555184   8. Ssh\Session->createResource() ./jumper/vendor/herzult/php-ssh/src/Ssh/AbstractResourceHolder.php:25
        0.4208    5611280   9. Ssh\Session->authenticate() ./jumper/vendor/herzult/php-ssh/src/Ssh/Session.php:140
        0.4208    5611280  10. Ssh\Authentication\PublicKeyFile->authenticate() ./jumper/vendor/herzult/php-ssh/src/Ssh/Session.php:164
        0.4208    5611360  11. ssh2_auth_pubkey_file() ./jumper/vendor/herzult/php-ssh/src/Ssh/Authentication/PublicKeyFile.php:46
    
    
    Fatal error: Uncaught exception 'RuntimeException' with message 'The authentication over the current SSH connection failed.' in ./jumper/vendor/herzult/php-ssh/src/Ssh/Session.php on line 167
    
    RuntimeException: The authentication over the current SSH connection failed. in ./jumper/vendor/herzult/php-ssh/src/Ssh/Session.php on line 167
    
    Call Stack:
        0.0009     651184   1. {main}() ./jumper/demo/test.php:0
        0.2916    5544416   2. Jumper\Executor->run() ./jumper/demo/test.php:21
    
    bug 
    opened by kakawait 0
Releases(1.0.1)
Owner
Thibaud Lepretre
Thibaud Lepretre
Serialize closures. Not maintained. Consider using opis/closure.

PHP SuperClosure A PHP Library for serializing closures and anonymous functions. No Longer Maintained This software is no longer maintained. Consider

Jeremy Lindblom 1.7k Dec 30, 2022
Remote Git Library for PHP

This library provides methods to handle git repositories remotely without having to clone the whole repo. It uses the Symfony process component to run the git client.

Martin Auswöger 4 Dec 14, 2022
Rafel is Remote Access Tool Used to Control Victims Using WebPanel With More Advance Features..

Rafel is Remote Access Tool Used to Control Victims Using WebPanel With More Advance Features..

swagkarna 690 Dec 28, 2022
Execute Artisan commands on remote servers

Execute Artisan commands on remote servers This package provides a command to execute Artisan command on a remote server. Here's an example that will

Spatie 238 Dec 29, 2022
Remote or monitor your PocketMine:MP server via browser.

PMRemote Remote or monitor your server via browser. Features Monitor (TPS, Server load, Players count) TODO: Remote (Access server console like RCON,

null 11 Dec 7, 2022
A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.

Motan Overview Motan is a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services. Related

Weibo R&D Open Source Projects 5.8k Dec 20, 2022
Applies a patch from a local or remote file to any package that is part of a given composer project.

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level in package config or separate JSON file. Declaration-free mode (using embedded info within patch files) is available as well.

Vaimo 245 Dec 15, 2022
Fsociety RAT, The Open Source C++ Remote Administration Tool (RAT)

Fsociety-RAT It was really fun to make this project! This project have a lot of great features and a very good website control for the bots. The final

Elliot Alderson 11 Nov 30, 2022
The Current US Version of PHP-Nuke Evolution Xtreme v3.0.1b-beta often known as Nuke-Evolution Xtreme. This is a hardened version of PHP-Nuke and is secure and safe. We are currently porting Xtreme over to PHP 8.0.3

2021 Nightly Builds Repository PHP-Nuke Evolution Xtreme Developers TheGhost - Ernest Allen Buffington (Lead Developer) SeaBeast08 - Sebastian Scott B

Ernest Buffington 7 Aug 28, 2022
A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

null 272 Dec 22, 2022