本文整理汇总了PHP中CApi::bIsValid方法的典型用法代码示例。如果您正苦于以下问题:PHP CApi::bIsValid方法的具体用法?PHP CApi::bIsValid怎么用?PHP CApi::bIsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CApi
的用法示例。
在下文中一共展示了CApi::bIsValid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param CApiPluginManager $oPluginManager
*/
public function __construct(CApiPluginManager $oPluginManager)
{
\CApi::$bIsValid = true;
parent::__construct('1.0', $oPluginManager);
$this->AddHook('api-pre-app-data', 'PluginApiAppData');
$this->AddHook('account-update-password', 'AccountUpdatePassword');
$this->AddJsonHook('AjaxSocialAccountListGet', 'AjaxSocialAccountListGet');
$this->AddJsonHook('AjaxSocialAccountDelete', 'AjaxSocialAccountDelete');
}
示例2: Init
public static function Init($bGrantAdminPrivileges = false)
{
include_once self::LibrariesPath() . 'autoload.php';
if ($bGrantAdminPrivileges) {
\CApi::$aUserSession['UserId'] = -1;
\CApi::$aUserSession['AuthToken'] = '';
}
CApi::$aI18N = null;
CApi::$aClientI18N = array();
CApi::$aSecretWords = array();
CApi::$bUseDbLog = false;
if (!is_object(CApi::$oManager)) {
CApi::IncArray(array('functions', 'constants', 'enum', 'exception', 'utils', 'crypt', 'container', 'eav', 'manager', 'module', 'response', 'xml', 'utils.get', 'utils.post', 'utils.session', 'http', 'db.storage', 'user-session'));
$sSalt = '';
$sSaltFile = CApi::DataPath() . '/salt.php';
if (!@file_exists($sSaltFile)) {
$sSaltDesc = '<?php #' . md5(microtime(true) . rand(1000, 9999)) . md5(microtime(true) . rand(1000, 9999));
@file_put_contents($sSaltFile, $sSaltDesc);
} else {
$sSalt = '$2y$07$' . md5(file_get_contents($sSaltFile)) . '$';
}
CApi::$sSalt = $sSalt;
CApi::$aConfig = (include CApi::RootPath() . 'config.php');
$sSettingsFile = CApi::DataPath() . '/settings/config.php';
if (@file_exists($sSettingsFile)) {
$aAppConfig = (include $sSettingsFile);
if (is_array($aAppConfig)) {
CApi::$aConfig = array_merge(CApi::$aConfig, $aAppConfig);
}
}
$sHost = \MailSo\Base\Http::SingletonInstance()->GetHost();
if (0 < \strlen($sHost)) {
$sDomainSettingsFile = CApi::DataPath() . '/settings/' . $sHost . '.config.php';
if (@file_exists($sDomainSettingsFile)) {
$aDomainAppConfig = (include $sDomainSettingsFile);
if (is_array($aDomainAppConfig)) {
CApi::$aConfig = array_merge(CApi::$aConfig, $aDomainAppConfig);
}
}
}
CApi::$oManager = new CApiGlobalManager();
CApi::$bIsValid = CApi::validateApi();
CApi::GetModuleManager();
CApi::$oManager->PrepareStorageMap();
CApi::$aModuleDecorators = array();
}
}
示例3: Run
public static function Run()
{
include_once self::LibrariesPath() . 'MailSo/MailSo.php';
CApi::$aI18N = null;
CApi::$aClientI18N = array();
if (!is_object(CApi::$oManager)) {
CApi::Inc('common.functions');
CApi::Inc('common.constants');
CApi::Inc('common.enum');
CApi::Inc('common.exception');
CApi::Inc('common.utils');
CApi::Inc('common.crypt');
CApi::Inc('common.container');
CApi::Inc('common.manager');
CApi::Inc('common.xml');
CApi::Inc('common.plugin');
CApi::Inc('common.utils.get');
CApi::Inc('common.utils.post');
CApi::Inc('common.utils.session');
CApi::Inc('common.http');
CApi::Inc('common.twilio');
CApi::Inc('common.db.storage');
$sSalt = '';
$sSaltFile = CApi::DataPath() . '/salt.php';
if (!@file_exists($sSaltFile)) {
$sSaltDesc = '<?php #' . md5(microtime(true) . rand(1000, 9999)) . md5(microtime(true) . rand(1000, 9999));
@file_put_contents($sSaltFile, $sSaltDesc);
} else {
$sSalt = md5(file_get_contents($sSaltFile));
}
CApi::$sSalt = $sSalt;
CApi::$aConfig = (include CApi::RootPath() . 'common/config.php');
$sSettingsFile = CApi::DataPath() . '/settings/config.php';
if (@file_exists($sSettingsFile)) {
$aAppConfig = (include $sSettingsFile);
if (is_array($aAppConfig)) {
CApi::$aConfig = array_merge(CApi::$aConfig, $aAppConfig);
}
}
$oHtml = \MailSo\Base\Http::SingletonInstance();
$sHost = $oHtml->GetHost();
if (0 < \strlen($sHost)) {
$sDomainSettingsFile = CApi::DataPath() . '/settings/' . $sHost . '.config.php';
if (@file_exists($sDomainSettingsFile)) {
$aDomainAppConfig = (include $sDomainSettingsFile);
if (is_array($aDomainAppConfig)) {
CApi::$aConfig = array_merge(CApi::$aConfig, $aDomainAppConfig);
}
}
}
CApi::$oManager = new CApiGlobalManager();
CApi::$oPlugin = new CApiPluginManager(CApi::$oManager);
CApi::$bIsValid = CApi::validateApi();
CApi::$oManager->PrepareStorageMap();
require_once CApi::RootPath() . 'DAV/autoload.php';
}
}