Ejemplo n.º 1
0
 static function SetWallet($strWalletFilename)
 {
     return OTAPI_Basic_SetWallet($strWalletFilename);
 }
Ejemplo n.º 2
0
// OTAPI_Basic_AppShutdown() at the bottom of this file (and we are...)
//
//  $a = unlink($path . '\\client_data\ot.pid');
$nb = getInput("\n\nBefore running this script, I had to copy\n /Users/au/.local/lib/libotapi-php.dylib to:\n /usr/local/lib/php/extensions/no-debug-non-zts-20090626 \n I figured out the folders based on PHP complaining when it could find otapi.so.\nYou might have to do something similar so your PHP can find the otapi.\nOh and also, I had to rename libotapi-php.dylib to otapi.so.\nI also had to copy otapi.php (from SWIG) into this folder.\n\nAlso, make sure the server is running (otserver)\n\nOkay, ready to test?\nPress enter TWICE to try out the OT API... ");
include "otapi.php";
OTAPI_Basic_AppStartup();
# These functions are perfect examples of the 'Low-level API',
# which is useful for simple functions that don't require messaging
# any OT servers. See OTAPI_Basic.h and OTAPI.h for the complete
# low-level API.
OTAPI_Basic_Init();
date_default_timezone_set('UTC');
$tm = OTAPI_Basic_GetTime();
$date = date("d/m/Y H:i:s", $tm);
echo $tm . " = " . $date . "<br>";
OTAPI_Basic_SetWallet('wallet.xml');
if (!OTAPI_Basic_WalletExists()) {
    die(' wallet not found<br>');
} else {
    echo ' wallet exists.<br>';
}
//myClass("test");
//$caller   = new OTCaller();
//$callback = new PHPCallback();
//$p1 = OTCaller_setCallback($callback);
//OT_API_Set_PasswordCallback($p1);
$s_theCaller = new OTCaller();
//$s_theCaller   = getInstanceOf( "OTCaller");
$s_theCallback = new PHPCallback();
if (null == $s_theCaller || null == $s_theCallback) {
    $s_theCaller = null;