本文整理匯總了PHP中CApi::LibrariesPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP CApi::LibrariesPath方法的具體用法?PHP CApi::LibrariesPath怎麽用?PHP CApi::LibrariesPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CApi
的用法示例。
在下文中一共展示了CApi::LibrariesPath方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DAVLibrariesAutoload
function DAVLibrariesAutoload($className)
{
if (0 === strpos($className, 'afterlogic') && false !== strpos($className, '\\')) {
include CApi::LibrariesPath() . 'afterlogic/' . str_replace('\\', '/', substr($className, 11)) . '.php';
} else {
if (0 === strpos($className, 'Sabre') && false !== strpos($className, '\\')) {
include CApi::LibrariesPath() . 'Sabre/' . str_replace('\\', '/', substr($className, 6)) . '.php';
}
}
}
示例2: class_exists
<?php
/*
* Copyright 2004-2015, AfterLogic Corp.
* Licensed under AGPLv3 license or AfterLogic license
* if commercial version of the product was purchased.
* See the LICENSE file for a full license statement.
*/
class_exists('CApi') or die;
CApi::Inc('common.plugins.two-factor-auth');
include_once CApi::LibrariesPath() . 'PHPGangsta/GoogleAuthenticator.php';
class TwoFactorAuthenticationPlugin extends AApiTwoFactorAuthPlugin
{
protected $logs = false;
protected $discrepancy = 2;
public static $setAccountIsLoggedIn = false;
/**
* @param string $sText
*/
private function _writeLogs($sText)
{
if ($this->logs === true) {
$this->Log($sText);
}
}
/**
* @param CApiPluginManager $oPluginManager
*/
public function __construct(CApiPluginManager $oPluginManager)
{
parent::__construct('1.0', $oPluginManager);
示例3: array
<?php
include_once __DIR__ . '/libraries/afterlogic/api.php';
include_once CApi::LibrariesPath() . '/ProjectSeven/Notifications.php';
$sContents = file_get_contents('php://input');
$aInputData = array();
if (strlen($sContents) > 0) {
parse_str($sContents, $aInputData);
} else {
$aInputData = isset($_REQUEST) && is_array($_REQUEST) ? $_REQUEST : array();
}
//$sMethod = isset($aInputData['method']) ? $aInputData['method'] : '';
$sMethod = strlen($_SERVER['PATH_INFO']) > 0 ? $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['PATH_INFO'] : '';
$sToken = isset($aInputData['token']) ? $aInputData['token'] : '';
$aSecret = CApi::DecodeKeyValues($sToken);
$bMethod = in_array($sMethod, array('GET /token', 'POST /account', 'PUT /account/update', 'DELETE /account', 'PUT /account/enable', 'PUT /account/disable', 'PUT /account/password', 'GET /account/list', 'GET /account/exists', 'GET /account', 'POST /domain', 'PUT /domain/update', 'DELETE /domain', 'GET /domain/list', 'GET /domain/exists', 'GET /domain'));
$aResult = array('method' => $sMethod);
if (!CApi::GetConf('labs.rest', true)) {
$aResult['message'] = 'rest api disabled';
$aResult['errorCode'] = \ProjectSeven\Notifications::RestApiDisabled;
$aResult['result'] = false;
} else {
if (class_exists('CApi') && CApi::IsValid() && $bMethod) {
/* @var $oApiDomainsManager CApiDomainsManager */
$oApiDomainsManager = CApi::Manager('domains');
/* @var $oApiTenantsManager CApiTenantsManager */
$oApiTenantsManager = CApi::Manager('tenants');
/* @var $oApiUsersManager CApiUsersManager */
$oApiUsersManager = CApi::Manager('users');
/* @var $oApiIntegratorManager CApiIntegratorManager */
$oApiIntegratorManager = CApi::Manager('integrator');