当前位置: 首页>>代码示例>>PHP>>正文


PHP Api::getId方法代码示例

本文整理汇总了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);
 }
开发者ID:kyroskoh,项目名称:apigrove,代码行数:56,代码来源:JsonPropertyPrinter.php

示例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();
开发者ID:AdrienCourtois,项目名称:Domoleaf,代码行数:8,代码来源:conf_users.php

示例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;
开发者ID:AdrienCourtois,项目名称:Domoleaf,代码行数:10,代码来源:profile_user_installation.php

示例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;
开发者ID:bonion,项目名称:Domoleaf,代码行数:31,代码来源:form_custom_upload_room.php

示例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;
 }
开发者ID:kyroskoh,项目名称:apigrove,代码行数:24,代码来源:ApiManager.class.php


注:本文中的Api::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。