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


PHP Lang::noslash方法代码示例

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


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

示例1: Url

 /**
  * Returns the URL of the container
  *
  * @return string
  * @param string $subresource not used; required for compatibility
  * @throws NoNameError
  */
 public function Url($subresource = '')
 {
     if (!$this->name) {
         throw new Exceptions\NoNameError(Lang::translate('Container does not have an identifier'));
     }
     return Lang::noslash($this->Service()->Url(rawurlencode($this->name)));
 }
开发者ID:omusico,项目名称:home365,代码行数:14,代码来源:CDNContainer.php

示例2: __construct

 /**
  * Called when creating a new Compute service object
  *
  * _NOTE_ that the order of parameters for this is *different* from the
  * parent Service class. This is because the earlier parameters are the
  * ones that most typically change, whereas the later ones are not
  * modified as often.
  *
  * @param \OpenCloud\Identity $conn - a connection object
  * @param string $serviceRegion - identifies the region of this Compute
  *      service
  * @param string $urltype - identifies the URL type ("publicURL",
  *      "privateURL")
  * @param string $serviceName - identifies the name of the service in the
  *      catalog
  */
 public function __construct(OpenStack $conn, $serviceType, $serviceName, $serviceRegion, $urltype)
 {
     parent::__construct($conn, $serviceType, $serviceName, $serviceRegion, $urltype);
     $this->_url = Lang::noslash(parent::Url());
     $this->getLogger()->info(Lang::translate('Initializing Nova...'));
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:22,代码来源:Nova.php

示例3: ips

 /**
  * Returns the IP address block for the Server or for a specific network.
  *
  * @api
  * @param string $network - if supplied, then only the IP(s) for the
  *                        specified network are returned. Otherwise, all IPs are returned.
  * @return object
  * @throws Exceptions\ServerIpsError
  */
 public function ips($network = null)
 {
     $url = Lang::noslash($this->Url('ips/' . $network));
     $response = $this->getClient()->get($url)->send();
     $body = Formatter::decode($response);
     return isset($body->addresses) ? $body->addresses : (isset($body->network) ? $body->network : (object) array());
 }
开发者ID:brighten01,项目名称:opencloud-zendframework,代码行数:16,代码来源:Server.php

示例4: url

 /**
  * Returns the URL of the data object
  *
  * If the object is new and doesn't have a name, then an exception is
  * thrown.
  *
  * @param string $subresource Not used
  * @return string
  * @throws NoNameError
  */
 public function url($subresource = '')
 {
     if (!$this->name) {
         throw new Exceptions\NoNameError(Lang::translate('Object has no name'));
     }
     return Lang::noslash($this->container->url()) . '/' . str_replace('%2F', '/', rawurlencode($this->name));
 }
开发者ID:BulatSa,项目名称:Ctex,代码行数:17,代码来源:DataObject.php

示例5: ips

 /**
  * Returns the IP address block for the Server or for a specific network
  *
  * @api
  * @param string $network - if supplied, then only the IP(s) for
  *      the specified network are returned. Otherwise, all IPs are returned.
  * @return object
  * @throws ServerIpsError
  */
 public function ips($network = null)
 {
     $url = Lang::noslash($this->Url('ips/' . $network));
     $response = $this->Service()->Request($url);
     // @codeCoverageIgnoreStart
     if ($response->HttpStatus() >= 300) {
         throw new Exceptions\ServerIpsError(sprintf(Lang::translate('Error in Server::ips(), status [%d], response [%s]'), $response->HttpStatus(), $response->HttpBody()));
     }
     $object = json_decode($response->httpBody());
     $this->checkJsonError();
     if (isset($object->addresses)) {
         return $object->addresses;
     } elseif (isset($object->network)) {
         return $object->network;
     } else {
         return new \stdClass();
     }
     // @codeCoverageIgnoreEnd
 }
开发者ID:BulatSa,项目名称:Ctex,代码行数:28,代码来源:Server.php

示例6: Url

 /**
  * Returns the URL of this object
  *
  * @api
  * @param string $subresource specified subresource
  * @return string
  */
 public function Url($subresource = 'tokens')
 {
     return Lang::noslash($this->url) . '/' . $subresource;
 }
开发者ID:sajib88,项目名称:studentdoctor,代码行数:11,代码来源:OpenStack.php

示例7: getMetaUrl

 /**
  * Constructs a specified URL from the subresource
  *
  * Given a subresource (e.g., "extensions"), this constructs the proper
  * URL and retrieves the resource.
  *
  * @param string $resource The resource requested; should NOT have slashes
  *      at the beginning or end
  * @return \stdClass object
  */
 private function getMetaUrl($resource)
 {
     $urlBase = $this->getEndpoint($this->service_type, $this->service_name, $this->service_region, RAXSDK_URL_PUBLIC);
     $url = Lang::noslash($urlBase) . '/' . $resource;
     $response = $this->request($url);
     // check for NOT FOUND response
     if ($response->httpStatus() == 404) {
         return array();
     }
     // @codeCoverageIgnoreStart
     if ($response->httpStatus() >= 300) {
         throw new Exceptions\HttpError(sprintf(Lang::translate('Error accessing [%s] - status [%d], response [%s]'), $urlBase, $response->httpStatus(), $response->httpBody()));
     }
     // @codeCoverageIgnoreEnd
     // we're good; proceed
     $object = json_decode($response->httpBody());
     $this->checkJsonError();
     return $object;
 }
开发者ID:BulatSa,项目名称:Ctex,代码行数:29,代码来源:Service.php

示例8: GetMetaUrl

 /**
  * Constructs a specified URL from the subresource
  *
  * Given a subresource (e.g., "extensions"), this constructs the proper
  * URL and retrieves the resource.
  *
  * @param string $resource The resource requested; should NOT have slashes
  *      at the beginning or end
  * @return \stdClass object
  */
 private function GetMetaUrl($resource)
 {
     $urlbase = $this->get_endpoint($this->service_type, $this->service_name, $this->service_region, RAXSDK_URL_PUBLIC);
     if ($urlbase == '') {
         return array();
     }
     $ext_url = Lang::noslash($urlbase) . '/' . $resource;
     $response = $this->Request($ext_url);
     // check for NOT FOUND response
     if ($response->HttpStatus() == 404) {
         return array();
     }
     // check for error status
     if ($response->HttpStatus() >= 300) {
         throw new Exceptions\HttpError(sprintf(Lang::translate('Error accessing [%s] - status [%d], response [%s]'), $urlbase, $response->HttpStatus(), $response->HttpBody()));
     }
     // we're good; proceed
     $obj = json_decode($response->HttpBody());
     if ($this->CheckJsonError()) {
         return false;
     }
     return $obj;
 }
开发者ID:svn2github,项目名称:rackspace-cloud-files-cdn,代码行数:33,代码来源:Service.php

示例9: Url

 /**
  * Returns the URL of the data object
  *
  * If the object is new and doesn't have a name, then an exception is
  * thrown.
  *
  * @param string $subresource Not used
  * @return string
  * @throws NoNameError
  */
 public function Url($subresource = '')
 {
     if (!$this->name) {
         throw new Exceptions\NoNameError(Lang::translate('Object has no name'));
     }
     $this_name = $this->name;
     if (gettype($this->name) == 'array') {
         $this->name = $this->name['name'];
     }
     return Lang::noslash($this->container->Url()) . '/' . str_replace('%2F', '/', rawurlencode($this->name));
 }
开发者ID:svn2github,项目名称:rackspace-cloud-files-cdn,代码行数:21,代码来源:DataObject.php

示例10: test_noslash

 public function test_noslash()
 {
     $this->assertEquals(Lang::noslash('String/'), 'String');
     $this->assertEquals(Lang::noslash('String'), 'String');
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:5,代码来源:BaseTest.php

示例11: __construct

 /**
  * Called when creating a new Compute service object
  *
  * _NOTE_ that the order of parameters for this is *different* from the
  * parent Service class. This is because the earlier parameters are the
  * ones that most typically change, whereas the later ones are not
  * modified as often.
  *
  * @param \OpenCloud\Identity $conn - a connection object
  * @param string $serviceRegion - identifies the region of this Compute
  *      service
  * @param string $urltype - identifies the URL type ("publicURL",
  *      "privateURL")
  * @param string $serviceName - identifies the name of the service in the
  *      catalog
  */
 public function __construct(OpenStack $conn, $serviceType, $serviceName, $serviceRegion, $urltype)
 {
     $this->debug(Lang::translate('initializing Nova...'));
     parent::__construct($conn, $serviceType, $serviceName, $serviceRegion, $urltype);
     $this->_url = Lang::noslash(parent::Url());
 }
开发者ID:omusico,项目名称:home365,代码行数:22,代码来源:Nova.php


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