コード例 #1
0
ファイル: php_ot_test.php プロジェクト: mshkhan71/opentxs
// NOTE: This unlink is unnecessary as long as we are properly calling
// OTAPI_Wrap_AppCleanup() 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";
# 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.hpp for the complete low-level API.
OTAPI_Wrap_AppInit();
date_default_timezone_set('UTC');
$tm = OTAPI_Wrap_GetTime();
$date = date("d/m/Y H:i:s", $tm);
echo $tm . " = " . $date . "<br>";
OTAPI_Wrap_SetWallet('wallet.xml');
if (!OTAPI_Wrap_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;
    $s_theCallback = null;
コード例 #2
0
 static function WalletExists()
 {
     return OTAPI_Wrap_WalletExists();
 }