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


PHP UrlHelper::buildUrl方法代码示例

本文整理汇总了PHP中UrlHelper::buildUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlHelper::buildUrl方法的具体用法?PHP UrlHelper::buildUrl怎么用?PHP UrlHelper::buildUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UrlHelper的用法示例。


在下文中一共展示了UrlHelper::buildUrl方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: removeEdge

 /**
  * Remove a edge from a graph, identified by the graph name and edge id<br><br>
  *
  * @throws Exception
  *
  * @param mixed  $graph     - graph name as a string or instance of Graph
  * @param mixed  $edgeId    - edge id as string or number
  * @param mixed  $revision  - optional revision of the edge to be deleted
  * @param mixed  $options  optional, array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method)
  * <p>
  * <li><b>policy</b> - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li>
  * <li><b>waitForSync</b> - can be used to force synchronisation of the document removal operation to disk even in case that the waitForSync flag had been disabled for the entire collection</li>
  * </p>
  * @param string $collection  - if one uses a graph with more than one vertex collection one must provide the collection                          
  *
  * @return bool - always true, will throw if there is an error
  * @since 1.2
  */
 public function removeEdge($graph, $edgeId, $revision = null, $options = array(), $collection = null)
 {
     if ($graph instanceof Graph) {
         $graph = $graph->getKey();
     }
     $parts = explode("/", $edgeId);
     if (count($parts) === 2) {
         $edgeId = $parts[1];
         $collection = $parts[0];
     }
     if (count($this->getEdgeCollections($graph)) !== 1 && $collection === null) {
         throw new ClientException('A collection must be provided.');
     } else {
         if (count($this->getEdgeCollections($graph)) === 1 && $collection === null) {
             $collection = $this->getEdgeCollections($graph);
             $collection = $collection[0];
         }
     }
     // This preserves compatibility for the old policy parameter.
     $params = array();
     $params = $this->validateAndIncludeOldSingleParameterInParams($options, $params, ConnectionOptions::OPTION_DELETE_POLICY);
     $params = $this->includeOptionsInParams($options, $params, array('waitForSync' => $this->getConnectionOption(ConnectionOptions::OPTION_WAIT_SYNC), 'keepNull' => true));
     if (!is_null($revision)) {
         $params[ConnectionOptions::OPTION_REVISION] = $revision;
     }
     $url = UrlHelper::buildUrl(Urls::URL_GRAPH, array($graph, Urls::URLPART_EDGE, $collection, $edgeId));
     $url = UrlHelper::appendParamsUrl($url, $params);
     $this->getConnection()->delete($url);
     return true;
 }
开发者ID:TomSearch,项目名称:arangodb-php-docs,代码行数:48,代码来源:GraphHandler.php

示例2: delete

 /**
  * Deletes an endpoint
  *
  * This will delete an existing endpoint.
  *
  * @param Connection $connection - the connection to be used
  * @param string     $endpoint   - the endpoint specification, e.g. tcp://127.0.0.1:8530
  *
  * @link                         http://www.arangodb.com/manuals/1.4/HttpEndpoint.html
  * @return array $responseArray - The response array.
  */
 public static function delete(Connection $connection, $endpoint)
 {
     $url = UrlHelper::buildUrl(Urls::URL_ENDPOINT, array($endpoint));
     $response = $connection->delete($url);
     $responseArray = $response->getJson();
     return $responseArray;
 }
开发者ID:TomSearch,项目名称:arangodb-php-docs,代码行数:18,代码来源:Endpoint.php

示例3: getInfo

 /**
  * Retrieves information about the current database
  *
  * This will get information about the currently used database from the server
  *
  * @param Connection $connection - the connection to be used
  *
  * @link http://www.arangodb.com/manuals/1.4/HttpDatabase.html
  *
  * @return array $responseArray - The response array.
  */
 public static function getInfo(Connection $connection)
 {
     $url = UrlHelper::buildUrl(Urls::URL_DATABASE, array('current'));
     $response = $connection->get($url);
     $responseArray = $response->getJson();
     return $responseArray;
 }
开发者ID:vinigomescunha,项目名称:ArangoDB-Ajax-PHP-Example,代码行数:18,代码来源:Database.php

示例4: getRegisteredUserFunctions

 /**
  * Get registered user functions
  *
  * The method can optionally be passed a $namespace parameter to narrow the results down to a specific namespace.
  *
  * @param null $namespace
  *
  * @throws Exception throw exception if the request failed
  *
  * @return mixed true if successful without a return value or the return value if one was set in the action
  */
 public function getRegisteredUserFunctions($namespace = null)
 {
     $url = UrlHelper::buildUrl(Urls::URL_AQL_USER_FUNCTION, array());
     if (!is_null($namespace)) {
         $url = UrlHelper::appendParamsUrl($url, array('namespace' => $namespace));
     }
     $response = $this->_connection->get($url);
     $responseArray = $response->getJson();
     return $responseArray;
 }
开发者ID:vinigomescunha,项目名称:ArangoDB-Ajax-PHP-Example,代码行数:21,代码来源:AqlUserFunction.php

示例5: getAllCollections

 /**
  * Get list of all available collections per default with the collection names as index.
  * Returns empty array if none are available.
  *
  * @param array $options            - optional - an array of options.
  *                                  <p>Options are :<br>
  *                                  <li>'excludeSystem' -   With a value of true, all system collections will be excluded from the response.</li>
  *                                  <li>'keys' -  With a value of "collections", the index of the resulting array is numerical,
  *                                  With a value of "names", the index of the resulting array are the collection names.</li>
  *                                  </p>
  *
  * @return array
  */
 public function getAllCollections($options = array())
 {
     $options = array_merge(array("excludeSystem" => false, 'keys' => "names"), $options);
     $params = array();
     if ($options["excludeSystem"] === true) {
         $params[self::OPTION_EXCLUDE_SYSTEM] = true;
     }
     $url = UrlHelper::appendParamsUrl(Urls::URL_COLLECTION, $params);
     $response = $this->getConnection()->get(UrlHelper::buildUrl($url, array()));
     $response = $response->getJson();
     if (isset($options["keys"]) && isset($response[$options["keys"]])) {
         return $response[$options["keys"]];
     }
     return $response;
 }
开发者ID:TomSearch,项目名称:arangodb-php-docs,代码行数:28,代码来源:CollectionHandler.php

示例6: removeUser

 /**
  * Remove a user, identified by the username
  *
  * @throws Exception
  *
  * @param mixed $username - username as a string, of the user that is to be deleted
  *
  * @return bool - always true, will throw if there is an error
  */
 public function removeUser($username)
 {
     // This preserves compatibility for the old policy parameter.
     $params = array();
     $url = UrlHelper::buildUrl(Urls::URL_USER, array($username));
     $url = UrlHelper::appendParamsUrl($url, $params);
     $this->getConnection()->delete($url);
     return true;
 }
开发者ID:vinigomescunha,项目名称:ArangoDB-Ajax-PHP-Example,代码行数:18,代码来源:UserHandler.php

示例7: erase

 /**
  * Remove a document from a collection (internal method)
  *
  * @throws Exception
  *
  * @param string $url          - the server-side URL being called
  * @param string $collectionId - collection id as string or number
  * @param mixed  $documentId   - document id as string or number
  * @param mixed $revision      - optional revision of the document to be deleted
  * @param mixed  $options      - optional, array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method)
  *                             <p>Options are :
  *                             <li>'policy' - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li>
  *                             <li>'waitForSync' - can be used to force synchronisation of the document removal operation to disk even in case that the waitForSync flag had been disabled for the entire collection</li>
  *                             </p>
  *
  * @return bool - always true, will throw if there is an error
  */
 protected function erase($url, $collectionId, $documentId, $revision = null, $options = array())
 {
     // This preserves compatibility for the old policy parameter.
     $params = array();
     $params = $this->validateAndIncludeOldSingleParameterInParams($options, $params, ConnectionOptions::OPTION_DELETE_POLICY);
     $params = $this->includeOptionsInParams($options, $params, array('waitForSync' => ConnectionOptions::OPTION_WAIT_SYNC));
     if (!is_null($revision)) {
         $params[ConnectionOptions::OPTION_REVISION] = $revision;
     }
     $url = UrlHelper::buildUrl($url, array($collectionId, $documentId));
     $url = UrlHelper::appendParamsUrl($url, $params);
     $this->getConnection()->delete($url);
     return true;
 }
开发者ID:TomSearch,项目名称:arangodb-php-docs,代码行数:31,代码来源:DocumentHandler.php

示例8: kill

 /**
  * Kills a specific query
  *
  * This will send an HTTP DELETE command to the server to terminate the specified query
  *
  * @param string $id - query id
  *
  * @throws Exception
  *
  * @return bool
  */
 public function kill($id)
 {
     $url = UrlHelper::buildUrl(Urls::URL_QUERY, array($id));
     $this->_connection->delete($url);
     return true;
 }
开发者ID:vinigomescunha,项目名称:ArangoDB-Ajax-PHP-Example,代码行数:17,代码来源:QueryHandler.php


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