本文整理汇总了PHP中WindowsAzure\Common\Internal\Utilities::endsWith方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::endsWith方法的具体用法?PHP Utilities::endsWith怎么用?PHP Utilities::endsWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowsAzure\Common\Internal\Utilities
的用法示例。
在下文中一共展示了Utilities::endsWith方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testEndsWith
/**
* @covers WindowsAzure\Common\Internal\Utilities::endsWith
*/
public function testEndsWith()
{
// Setup
$haystack = 'tesT';
$needle = 't';
$expected = true;
// Test
$actual = Utilities::endsWith($haystack, $needle, true);
// Assert
$this->assertEquals($expected, $actual);
}
示例2: rollbackUpdateOrUpgrade
/**
* Cancels an in progress configuration change (update) or upgrade and returns
* the deployment to its state before the upgrade or configuration change was
* started.
*
* Note that you can rollback update or upgrade either by specifying the
* deployment environment (staging or production), or by specifying the
* deployment's unique name.
*
* @param string $name The hosted service name.
* @param string $mode Specifies whether the rollback
* should proceed automatically or not. Auto, The rollback proceeds without
* further user input. Manual, You must call the walkUpgradeDomain API to apply
* the rollback to each upgrade domain.
* @param boolean $force Specifies whether the rollback
* should proceed even when it will cause local data to be lost from some role
* instances. True if the rollback should proceed; otherwise false if the
* rollback should fail.
* @param GetDeploymentOptions $options The optional parameters.
*
* @return none
*
* @see http://msdn.microsoft.com/en-us/library/windowsazure/hh403977.aspx
*/
public function rollbackUpdateOrUpgrade($name, $mode, $force, $options)
{
Validate::isString($name, 'name');
Validate::notNullOrEmpty($name, 'name');
Validate::isString($mode, 'mode');
Validate::isTrue(Mode::isValid($mode), Resources::INVALID_CHANGE_MODE_MSG);
Validate::isBoolean($force, 'force');
Validate::notNullOrEmpty($force, 'force');
Validate::notNullOrEmpty($options, 'options');
$xmlElements = array(Resources::XTAG_MODE => $mode, Resources::XTAG_FORCE => Utilities::booleanToString($force));
$body = $this->_createRequestXml($xmlElements, Resources::XTAG_ROLLBACK_UPDATE_OR_UPGRADE);
$context = new HttpCallContext();
$context->setMethod(Resources::HTTP_POST);
$context->setPath($this->_getDeploymentPath($name, $options) . '/');
$context->addStatusCode(Resources::STATUS_ACCEPTED);
$context->addQueryParameter(Resources::QP_COMP, Resources::QPV_ROLLBACK);
$context->setBody($body);
$context->addHeader(Resources::CONTENT_TYPE, Resources::XML_CONTENT_TYPE);
assert(Utilities::endsWith($context->getPath(), '/'));
$response = $this->sendContext($context);
return AsynchronousOperationResult::create($response->getHeader());
}