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


PHP Validate::notNullOrEmpty方法代码示例

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


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

示例1: __construct

 /**
  * Creates new media services settings instance.
  *
  * @param string $accountName      The user provided account name.
  * @param string $accessKey        The user provided primary access key
  * @param string $endpointUri      The service management endpoint uri.
  * @param string $oauthEndpointUri The OAuth service endpoint uri.
  */
 public function __construct($accountName, $accessKey, $endpointUri = null, $oauthEndpointUri = null)
 {
     Validate::notNullOrEmpty($accountName, 'accountName');
     Validate::notNullOrEmpty($accessKey, 'accountKey');
     Validate::isString($accountName, 'accountName');
     Validate::isString($accessKey, 'accountKey');
     if ($endpointUri != null) {
         Validate::isValidUri($endpointUri);
     } else {
         $endpointUri = Resources::MEDIA_SERVICES_URL;
     }
     if ($oauthEndpointUri != null) {
         Validate::isValidUri($oauthEndpointUri);
     } else {
         $oauthEndpointUri = Resources::MEDIA_SERVICES_OAUTH_URL;
     }
     $this->_accountName = $accountName;
     $this->_accessKey = $accessKey;
     $this->_endpointUri = $endpointUri;
     $this->_oauthEndpointUri = $oauthEndpointUri;
 }
开发者ID:skinnard,项目名称:FTL-2,代码行数:29,代码来源:MediaServicesSettings.php

示例2: createTopic

 /**
  * Creates a topic with specified topic info.  
  *
  * @link http://msdn.microsoft.com/en-us/library/windowsazure/hh780728
  * 
  * @param TopicInfo $topicInfo The information of the topic. 
  *
  * @return TopicInfo
  */
 public function createTopic($topicInfo)
 {
     Validate::notNullOrEmpty($topicInfo, 'topicInfo');
     $httpCallContext = new HttpCallContext();
     $httpCallContext->setMethod(Resources::HTTP_PUT);
     $httpCallContext->setPath($topicInfo->getTitle());
     $httpCallContext->addHeader(Resources::CONTENT_TYPE, Resources::ATOM_ENTRY_CONTENT_TYPE);
     $httpCallContext->addStatusCode(Resources::STATUS_CREATED);
     $topicDescriptionXml = XmlSerializer::objectSerialize($topicInfo->getTopicDescription(), 'TopicDescription');
     $entry = new Entry();
     $content = new Content($topicDescriptionXml);
     $content->setType(Resources::XML_CONTENT_TYPE);
     $entry->setContent($content);
     $entry->setAttribute(Resources::XMLNS, Resources::SERVICE_BUS_NAMESPACE);
     $xmlWriter = new \XMLWriter();
     $xmlWriter->openMemory();
     $entry->writeXml($xmlWriter);
     $httpCallContext->setBody($xmlWriter->outputMemory());
     $response = $this->sendContext($httpCallContext);
     $topicInfo = new TopicInfo();
     $topicInfo->parseXml($response->getBody());
     return $topicInfo;
 }
开发者ID:southworkscom,项目名称:azure-sdk-for-php,代码行数:32,代码来源:ServiceBusRestProxy.php

示例3: setAffinityGroup

 /**
  * Sets the affinityGroup.
  * 
  * @param string $affinityGroup The affinityGroup.
  * 
  * @return none
  */
 public function setAffinityGroup($affinityGroup)
 {
     Validate::isString($affinityGroup, 'affinityGroup');
     Validate::notNullOrEmpty($affinityGroup, 'affinityGroup');
     $this->_affinityGroup = $affinityGroup;
 }
开发者ID:bitmovin,项目名称:azure-sdk-for-php,代码行数:13,代码来源:CreateServiceOptions.php

示例4: unregisterSource

 /**
  * Unregisters a connection string source.
  * 
  * @param string $name The source name.
  * 
  * @return callable
  */
 public static function unregisterSource($name)
 {
     Validate::isString($name, 'name');
     Validate::notNullOrEmpty($name, 'name');
     self::_init();
     $sourceCallback = Utilities::tryGetValue(self::$_sources, $name);
     if (!is_null($sourceCallback)) {
         unset(self::$_sources[$name]);
     }
     return $sourceCallback;
 }
开发者ID:skinnard,项目名称:FTL-2,代码行数:18,代码来源:CloudConfigurationManager.php

示例5: __construct

 /**
  * Creates a WRAP token manager with specified parameters. 
  *
  * @param string $wrapUri       The URI of the WRAP service.
  * @param string $wrapName      The user name of the WRAP service.
  * @param string $wrapPassword  The password of the WRAP service.
  * @param IWrap  $wrapRestProxy The WRAP service REST proxy.
  */
 public function __construct($wrapUri, $wrapName, $wrapPassword, $wrapRestProxy)
 {
     Validate::isString($wrapUri, 'wrapUri');
     Validate::isString($wrapName, 'wrapName');
     Validate::isString($wrapPassword, 'wrapPassword');
     Validate::notNullOrEmpty($wrapRestProxy, 'wrapRestProxy');
     $this->_wrapUri = $wrapUri;
     $this->_wrapName = $wrapName;
     $this->_wrapPassword = $wrapPassword;
     $this->_wrapRestProxy = $wrapRestProxy;
     $this->_activeTokens = array();
 }
开发者ID:mat33470,项目名称:PFA,代码行数:20,代码来源:WrapTokenManager.php

示例6: setDeploymentName

 /**
  * Sets the deployment name.
  * 
  * @param string $deploymentName The deployment name.
  * 
  * @return none
  */
 public function setDeploymentName($deploymentName)
 {
     Validate::isString($deploymentName, 'deploymentName');
     Validate::notNullOrEmpty($deploymentName, 'deploymentName');
     $this->_deploymentName = $deploymentName;
 }
开发者ID:bitmovin,项目名称:azure-sdk-for-php,代码行数:13,代码来源:GetDeploymentOptions.php

示例7: createBlobSnapshot

 /**
  * Creates a snapshot of a blob.
  * 
  * @param string                           $container The name of the container.
  * @param string                           $blob      The name of the blob.
  * @param Models\CreateBlobSnapshotOptions $options   The optional parameters.
  * 
  * @return Models\CreateBlobSnapshotResult
  * 
  * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691971.aspx
  */
 public function createBlobSnapshot($container, $blob, $options = null)
 {
     Validate::isString($container, 'container');
     Validate::isString($blob, 'blob');
     Validate::notNullOrEmpty($blob, 'blob');
     $method = Resources::HTTP_PUT;
     $headers = array();
     $postParams = array();
     $queryParams = array();
     $path = $this->_createPath($container, $blob);
     $expectedStatusCode = Resources::STATUS_CREATED;
     if (is_null($options)) {
         $options = new CreateBlobSnapshotOptions();
     }
     $queryParams[Resources::QP_COMP] = 'snapshot';
     $this->addOptionalQueryParam($queryParams, Resources::QP_TIMEOUT, $options->getTimeout());
     $headers = $this->addOptionalAccessConditionHeader($headers, $options->getAccessCondition());
     $headers = $this->addMetadataHeaders($headers, $options->getMetadata());
     $this->addOptionalHeader($headers, Resources::X_MS_LEASE_ID, $options->getLeaseId());
     $response = $this->send($method, $headers, $queryParams, $postParams, $path, $expectedStatusCode);
     return CreateBlobSnapshotResult::create($response->getHeader());
 }
开发者ID:yszar,项目名称:linuxwp,代码行数:33,代码来源:BlobRestProxy.php

示例8: createFileContents

 /**
  * Creates or updates the content of an existing file.
  *
  * Note that the default content type is application/octet-stream.
  *
  * @param string                   $share         The name of the share.
  * @param string                   $directoryPath The path of the directory.
  * @param string                   $file          The name of the file.
  * @param string|resource          $content       The content of the file.
  * @param Models\CreateFileOptions $options       The optional parameters.
  *
  * @return Models\CreateFileRangeResult|null
  *
  */
 public function createFileContents($share, $directoryPath, $file, $content, $options = null)
 {
     Validate::isString($share, 'share');
     Validate::isString($directoryPath, 'directoryPath');
     Validate::notNullOrEmpty($directoryPath, 'directoryPath');
     Validate::isString($file, 'file');
     Validate::isTrue(is_string($content) || is_resource($content), sprintf(Resources::INVALID_PARAM_MSG, 'content', 'string|resource'));
     $response = null;
     if (is_null($options)) {
         $options = new CreateFileOptions();
     }
     // This is for large or failsafe upload
     $end = 0;
     $offset = 0;
     // if threshold is lower than 4mb, honor threshold, else use 4mb
     $blockSize = 4194304;
     while (!$end) {
         if (is_resource($content)) {
             $body = fread($content, $blockSize);
             if (feof($content)) {
                 $end = 1;
             }
         } else {
             if (strlen($content) <= $blockSize) {
                 $body = $content;
                 $end = 1;
             } else {
                 $body = substr($content, 0, $blockSize);
                 $content = substr_replace($content, '', 0, $blockSize);
             }
         }
         $range = new FileRange($offset, $offset + strlen($body) - 1);
         $offset += $range->getLength();
         $response = $this->createFileRange($share, $directoryPath, $file, $range, $body, $options);
     }
     return $response;
 }
开发者ID:jancinert,项目名称:lnc-azureFileService,代码行数:51,代码来源:FileRestProxy.php

示例9: 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());
 }
开发者ID:mat33470,项目名称:PFA,代码行数:46,代码来源:ServiceManagementRestProxy.php

示例10: addInsertOrMergeEntity

 /**
  * Adds insertOrMergeEntity operation.
  * 
  * @param string $table  The table name.
  * @param Entity $entity The entity instance.
  * 
  * @return none
  */
 public function addInsertOrMergeEntity($table, $entity)
 {
     Validate::isString($table, 'table');
     Validate::notNullOrEmpty($entity, 'entity');
     $operation = new BatchOperation();
     $type = BatchOperationType::INSERT_MERGE_ENTITY_OPERATION;
     $operation->setType($type);
     $operation->addParameter(BatchOperationParameterName::BP_TABLE, $table);
     $operation->addParameter(BatchOperationParameterName::BP_ENTITY, $entity);
     $this->addOperation($operation);
 }
开发者ID:pankajadhyapak,项目名称:um_new,代码行数:19,代码来源:BatchOperations.php

示例11: updateMessage

 /**
  * Updates the visibility timeout of a message and/or the message contents.
  * 
  * @param string              $queueName                  The queue name.
  * @param string              $messageId                  The id of the message.
  * @param string              $popReceipt                 The valid pop receipt 
  * value returned from an earlier call to the Get Messages or Update Message
  * operation.
  * @param string              $messageText                The message contents.
  * @param int                 $visibilityTimeoutInSeconds Specifies the new 
  * visibility timeout value, in seconds, relative to server time. 
  * The new value must be larger than or equal to 0, and cannot be larger 
  * than 7 days. The visibility timeout of a message cannot be set to a value 
  * later than the expiry time. A message can be updated until it has been 
  * deleted or has expired.
  * @param QueueServiceOptions $options                    The optional 
  * parameters.
  * 
  * @return WindowsAzure\Common\Models\UpdateMessageResult
  */
 public function updateMessage($queueName, $messageId, $popReceipt, $messageText, $visibilityTimeoutInSeconds, $options = null)
 {
     Validate::isString($queueName, 'queueName');
     Validate::notNullOrEmpty($queueName, 'queueName');
     Validate::isString($messageId, 'messageId');
     Validate::notNullOrEmpty($messageId, 'messageId');
     Validate::isString($popReceipt, 'popReceipt');
     Validate::notNullOrEmpty($popReceipt, 'popReceipt');
     Validate::isString($messageText, 'messageText');
     Validate::isInteger($visibilityTimeoutInSeconds, 'visibilityTimeoutInSeconds');
     Validate::notNull($visibilityTimeoutInSeconds, 'visibilityTimeoutInSeconds');
     $method = Resources::HTTP_PUT;
     $headers = array();
     $postParams = array();
     $queryParams = array();
     $path = $queueName . '/messages' . '/' . $messageId;
     $body = Resources::EMPTY_STRING;
     $statusCode = Resources::STATUS_NO_CONTENT;
     if (is_null($options)) {
         $options = new QueueServiceOptions();
     }
     $this->addOptionalQueryParam($queryParams, Resources::QP_VISIBILITY_TIMEOUT, $visibilityTimeoutInSeconds);
     $this->addOptionalQueryParam($queryParams, Resources::QP_TIMEOUT, $options->getTimeout());
     $this->addOptionalQueryParam($queryParams, Resources::QP_POPRECEIPT, $popReceipt);
     if (!empty($messageText)) {
         $this->addOptionalHeader($headers, Resources::CONTENT_TYPE, Resources::URL_ENCODED_CONTENT_TYPE);
         $message = new QueueMessage();
         $message->setMessageText($messageText);
         $body = $message->toXml($this->dataSerializer);
     }
     $response = $this->send($method, $headers, $queryParams, $postParams, $path, $statusCode, $body);
     $popReceipt = $response->getHeader(Resources::X_MS_POPRECEIPT);
     $timeNextVisible = $response->getHeader(Resources::X_MS_TIME_NEXT_VISIBLE);
     $date = Utilities::rfc1123ToDateTime($timeNextVisible);
     $result = new UpdateMessageResult();
     $result->setPopReceipt($popReceipt);
     $result->setTimeNextVisible($date);
     return $result;
 }
开发者ID:southworkscom,项目名称:vscom,代码行数:59,代码来源:QueueRestProxy.php

示例12: generateTestTokenJWT

 private static function generateTestTokenJWT($template, $verificationKey, $contentKeyUUID, $tokenExpiration, $notBefore)
 {
     $token = array();
     foreach ($template->getRequiredClaims() as $claim) {
         $claimValue = $claim->getClaimValue();
         if ($claim->getClaimType() == TokenClaim::CONTENT_KEY_ID_CLAIM_TYPE) {
             Validate::notNullOrEmpty($contentKeyUUID, 'contentKeyUUID');
             $claimValue = $contentKeyUUID;
         }
         $token[$claim->getClaimType()] = $claimValue;
     }
     $token["iss"] = $template->getIssuer();
     $token["aud"] = $template->getAudience();
     $token["exp"] = $tokenExpiration;
     if (!empty($notBefore)) {
         $token["nbf"] = $notBefore;
     }
     return JWT::encode($token, $verificationKey->getKeyValue());
 }
开发者ID:jwdunne,项目名称:azure-sdk-for-php,代码行数:19,代码来源:TokenRestrictionTemplateSerializer.php

示例13: setRoleToUpgrade

 /**
  * Sets the role to upgrade name.
  * 
  * @param string $roleToUpgrade The role to upgrade name.
  * 
  * @return none
  */
 public function setRoleToUpgrade($roleToUpgrade)
 {
     Validate::isString($roleToUpgrade, 'roleToUpgrade');
     Validate::notNullOrEmpty($roleToUpgrade, 'roleToUpgrade');
     $this->_roleToUpgrade = $roleToUpgrade;
 }
开发者ID:azt3k,项目名称:drupal-azure-blob,代码行数:13,代码来源:UpgradeDeploymentOptions.php

示例14: testNotNullWithNull

 /**
  * @covers WindowsAzure\Common\Internal\Validate::notNull
  */
 public function testNotNullWithNull()
 {
     $this->setExpectedException('\\InvalidArgumentException');
     Validate::notNullOrEmpty(null, 'variable');
 }
开发者ID:rdohms,项目名称:azure-sdk-for-php,代码行数:8,代码来源:ValidateTest.php

示例15: getAffinityGroupProperties

 /**
  * Returns the system properties associated with the specified affinity group.
  * 
  * @param string $name The affinity group name.
  * 
  * @return Models\GetAffinityGroupPropertiesResult
  * 
  * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee460789.aspx
  */
 public function getAffinityGroupProperties($name)
 {
     Validate::isString($name, 'name');
     Validate::notNullOrEmpty($name, 'name');
     $context = new HttpCallContext();
     $context->setMethod(Resources::HTTP_GET);
     $context->setPath($this->_getAffinityGroupPath($name));
     $context->addStatusCode(Resources::STATUS_OK);
     $response = $this->sendContext($context);
     $parsed = $this->dataSerializer->unserialize($response->getBody());
     return GetAffinityGroupPropertiesResult::create($parsed);
 }
开发者ID:rdohms,项目名称:azure-sdk-for-php,代码行数:21,代码来源:ServiceManagementRestProxy.php


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