本文整理汇总了PHP中Api::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Api::getId方法的具体用法?PHP Api::getId怎么用?PHP Api::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Api
的用法示例。
在下文中一共展示了Api::getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRelatedFromApi
public static function getRelatedFromApi(Api $api)
{
$ret = array();
$pm = new PolicyManager();
$am = new AuthManager();
$allPolicies = $pm->getAllPolicies(true);
$relatedPolicies = array();
$policyPropsArr = array();
$allAuths = $am->getAllAuths(true);
$relatedAuthIds = array();
$relatedAuths = array();
$authPropsArr = array();
foreach ($allPolicies as $policy) {
/**
* @var Policy $policy
*/
$apiIds = $policy->getApiIds();
foreach ($apiIds as $apiId) {
if ($apiId === $api->getId()) {
$relatedPolicies[] = $policy;
}
}
}
foreach ($relatedPolicies as $policy) {
$props = $policy->getProperties();
if (!empty($props)) {
$policyPropsArr[$policy->getId()] = array_keys($props);
}
foreach ($policy->getAuthIds() as $authBucket) {
if ($authBucket && $authBucket->getAuthIds()) {
$relatedAuthIds = array_unique(array_merge($relatedAuthIds, $authBucket->getAuthIds()));
}
}
}
foreach ($allAuths as $auth) {
/**
* @var $auth Auth
*/
if (in_array($auth->getId(), $relatedAuthIds)) {
$relatedAuths[] = $auth;
}
}
foreach ($relatedAuths as $auth) {
$props = $auth->getProperties();
if (!empty($props)) {
$authPropsArr[$auth->getId()] = array_keys($props);
}
}
if (!empty($policyPropsArr)) {
$ret["policy"] = $policyPropsArr;
}
if (!empty($authPropsArr)) {
$ret["auth"] = $authPropsArr;
}
return json_encode($ret);
}
示例2: Api
<?php
echo '<title>' . _('Users configuration') . '</title>';
$request = new Api();
$request->add_request('profileList');
$result = $request->send_request();
$listuser = $result->profileList;
$currentuser = $request->getId();
示例3: Api
<?php
echo '<title>' . _('Profile') . '</title>';
$request = new Api();
$request->add_request('confUserInstallation', array(''));
$request->add_request('profileList');
$result = $request->send_request();
$userid = $request->getId();
$listuser = $result->profileList;
$accordioninfo = $result->confUserInstallation;
示例4: Api
<?php
include 'header.php';
$request = new Api();
$request->add_request('mcAllowed');
$request->add_request('confUserRoomEnable');
$result = $request->send_request();
if (empty($result->confUserRoomEnable) || sizeof($result->confUserRoomEnable) == 0) {
$listAllVisible = $result->mcAllowed;
$rooms = $listAllVisible->ListRoom;
} else {
$rooms = $result->confUserRoomEnable;
}
if (empty($_POST['userid'])) {
$iduser = $request->getId();
} else {
$iduser = $_POST['userid'];
}
$target_dir_abs = "/etc/domoleaf/www/templates/default/custom/room/";
$target_dir = "/templates/default/custom/room/";
$target_file = $target_dir_abs . basename($_FILES["fileToUpload"]["name"]);
$imageFileType = "jpg";
$uploadOk = 0;
if (!empty($_POST['id_elem']) && !empty($rooms->{$_POST['id_elem']}) && !empty($iduser)) {
$filename = $iduser . '_' . $_POST['id_elem'] . '_' . $_SERVER['REQUEST_TIME'] . '.' . $imageFileType;
$target_file = $target_dir_abs . $filename;
if (empty($_FILES["fileToUpload"]["tmp_name"]) || empty($target_file)) {
echo 0;
}
if (!move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo 0;
示例5: setApi
/**
*
* Insert/Update an Api on the database
* @param Api $api
* @throws Exception
*/
public function setApi(Api &$api, $insertMode = FALSE)
{
$method = "PUT";
$path = "/cxf/e3/prov/v1/apis/" . rawurlencode($api->getId());
if ($insertMode) {
$method = "POST";
$path = "/cxf/e3/prov/v1/apis/";
}
/**
* Send the XML payload the the Provisioning Backend
*/
$api->toXML();
LoggerInterface::log(($insertMode ? "Creating" : "Updating") . " API: {$api->toXML()}\nEndpoint: ({$method}) {$path}", LoggerInterface::INFO);
$reply = $this->restClient->makeCall($path, $method, $api->toXML());
$xml = simplexml_load_string($reply->getPayload());
$api->setId((string) $xml->id);
return $xml;
}