本文整理汇总了PHP中config::accountId方法的典型用法代码示例。如果您正苦于以下问题:PHP config::accountId方法的具体用法?PHP config::accountId怎么用?PHP config::accountId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config
的用法示例。
在下文中一共展示了config::accountId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rollback
private static function rollback()
{
@unlink(GsonCrypt::getkey(null));
@unlink(GsonCrypt::getkey(null, true));
@unlink(GsonCrypt::getcert());
@unlink(config::$accountIdFile);
@unlink(config::$walCfgFile);
@(config::$accountId = null);
}
示例2: register
private static function register()
{
if (self::isRegistered()) {
return true;
}
$ba = Tools::address(gio::input("Enter the bank's address"));
if (!$ba) {
return false;
}
config::$bankAddress = $ba['address'];
config::$bankPort = intval($ba['port']);
$net = new Gnet();
$r = $net->send(Gmsg::create(Gmsg::prepare("", "register", config::$bankId)));
$net = null;
if (!$r) {
return false;
}
$m = Gmsg::extract($r);
if (!$m['status']) {
return false;
}
if (gio::saverawfile($m['cert'], GsonCrypt::getcert($m['name'])) && gio::savetofile($m['cert'], GsonCrypt::getkey($m['name']))) {
if (gio::savetofile($m['name'], config::$bankIdFile) && gio::savetofile(serialize(array(config::$bankAddress, config::$bankPort)), config::$walCfgFile)) {
config::$bankId = $m['name'];
config::$accountId = $m['account'];
return true;
} else {
self::deregister();
return false;
}
}
return false;
}
示例3: keygen
public static function keygen(&$userid, $info = false)
{
$userid = !$userid ? config::$accountId : $userid;
if (!$userid) {
return false;
}
$dn = is_array($info) ? $info : array("countryName" => strtoupper(gio::input("Country code", "string")), "stateOrProvinceName" => strtoupper(gio::input("State code", "string")), "localityName" => gio::input("City", "string"), "organizationName" => gio::input("Your Name/Your Company Name in Full", "string"), "organizationalUnitName" => 'Digicoin', "commonName" => config::$bankId, "emailAddress" => gio::input("Contact Email Address", "string"));
$privkeypass = config::$privateKeyPassword;
if (!self::cryptoInstalled()) {
gio::log("... Could not generate cryptographic keys for {$userid} ...", E_USER_ERROR);
return false;
}
gio::log("Generating cryptographic keys for {$userid}...", VERBOSE);
try {
$privkey = @openssl_pkey_new(self::$keyOpts);
$privateKey = "";
$csr = @openssl_csr_new($dn, $privkey, self::$keyOpts);
if ($csr) {
openssl_csr_export_to_file($csr, self::getcert($userid));
openssl_pkey_export($privkey, $privatekey, $privkeypass, self::$keyOpts);
gio::savetofile($privatekey, self::getkey($userid, true), config::$privateKeyFileMode);
gio::savetofile($userid, config::$accountIdFile);
config::$accountId = $userid;
} else {
return false;
}
} catch (Exception $e) {
gio::log("Error while generating cryptographic keys for {$userid}: " . $e->message, E_USER_ERROR);
return false;
}
gio::log("... Done generating cryptographic keys for {$userid}", VERBOSE);
return true;
}