plinker / redbean
Installs: 1 024
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.4
- gabordemooij/redbean: >=4.2
- plinker/core: >=0.1
README
PlinkerRPC PHP client/server makes it really easy to link and execute PHP component classes on remote systems, while maintaining the feel of a local method call.
RedBeanPHP component which will enable you to directly manage databases on remote sites.
Composer
{
"require": {
"plinker/redbean": ">=v0.1"
}
}
Making a remote call.
<?php
require 'vendor/autoload.php';
try {
/**
* Plinker Config
*/
$config = [
// plinker connection | using tasks as to write in the correct .sqlite file
'plinker' => [
'endpoint' => 'http://127.0.0.1/examples/redbean/server.php',
'public_key' => 'makeSomethingUp',
'private_key' => 'againMakeSomethingUp'
],
// database connection
'database' => [
'dsn' => 'sqlite:./.plinker/database.db',
'host' => '',
'name' => '',
'username' => '',
'password' => '',
'freeze' => false,
'debug' => false,
]
];
// init plinker endpoint client
$rdb = new \Plinker\Core\Client(
// where is the plinker server
$config['plinker']['endpoint'],
// component namespace to interface to
'Redbean\Redbean',
// keys
$config['plinker']['public_key'],
$config['plinker']['private_key'],
// construct values which you pass to the component
$config['database']
);
//..
} catch (\Exception $e) {
exit(get_class($e).': '.$e->getMessage());
}
then the server part...
<?php
require 'vendor/autoload.php';
/**
* POST Server Part
*/
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$server = new Plinker\Core\Server(
$_POST,
'username',
'password'
);
exit($server->execute());
}
See the organisations page for additional components.