本文整理汇总了PHP中WindidApi::getDm方法的典型用法代码示例。如果您正苦于以下问题:PHP WindidApi::getDm方法的具体用法?PHP WindidApi::getDm怎么用?PHP WindidApi::getDm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindidApi
的用法示例。
在下文中一共展示了WindidApi::getDm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDm
public function getDm()
{
if (!is_object($this->dm)) {
$dm = WindidApi::getDm('credit');
$this->dm = new $dm($this->uid);
}
return $this->dm;
}
示例2: dorunAction
public function dorunAction()
{
$this->getRequest()->isPost() || $this->showError('operate.fail');
list($windid, $serverUrl, $clientId, $clientKey, $connect) = $this->getInput(array('windid', 'serverUrl', 'clientId', 'clientKey', 'connect'), 'post');
if ($windid == 'local') {
$serverUrl = Wekit::C('site', 'info.url') . '/windid';
$clientId = 1;
!$clientKey && ($clientKey = md5(WindUtility::generateRandStr(10)));
$connect = 'db';
}
$config = new PwConfigSet('windid');
$config->set('windid', $windid)->set('serverUrl', $serverUrl)->set('clientId', $clientId)->set('clientKey', $clientKey)->set('connect', $connect);
if ($windid == 'client') {
list($dbhost, $dbport, $dbuser, $dbpwd, $dbname, $dbprefix, $dbcharset) = $this->getInput(array('dbhost', 'dbport', 'dbuser', 'dbpwd', 'dbname', 'dbprefix', 'dbcharset'), 'post');
$config->set('db.host', $dbhost)->set('db.port', $dbport)->set('db.user', $dbuser)->set('db.pwd', $dbpwd)->set('db.name', $dbname)->set('db.prefix', $dbprefix)->set('db.charset', $dbcharset);
}
$config->flush();
if ($clientId) {
Wekit::C()->reload('windid');
$service = WindidApi::api('app');
WindidApi::getDm('app');
if (!$service->getApp($clientId)) {
$charset = Wekit::V('charset');
$charset = str_replace('-', '', strtolower($charset));
if (!in_array($charset, array('gbk', 'utf8', 'big5'))) {
$charset = 'utf8';
}
$dm = new WindidAppDm();
$dm->setId($clientId)->setApiFile('windid.php')->setIsNotify(1)->setIsSyn(1)->setAppName(Wekit::C('site', 'info.name'))->setSecretkey($clientKey)->setAppUrl(Wekit::C('site', 'info.url'))->setAppIp(Wind::getComponent('request')->getClientIp())->setCharset($charset);
$service->addApp($dm);
} elseif ($clientKey) {
$dm = new WindidAppDm($clientId);
$dm->setSecretkey($clientKey)->setAppUrl(Wekit::C('site', 'info.url'))->setCharset($charset);
$service->editApp($dm);
}
}
$_avatarUrl = WindidApi::api('avatar')->getAvatarUrl();
if ($_avatarUrl != WindidError::SERVER_ERROR) {
Wekit::C()->setConfig('site', 'avatarUrl', $_avatarUrl);
}
$this->showMessage('ADMIN:success');
}