Ejemplo n.º 1
0
 protected function checkOptions($options)
 {
     $options = parent::checkOptions($options);
     AssertUtils::assertSet(array(OSSOptions::BUCKET, OSSOptions::KEY), $options);
     OSSUtils::assertBucketName($options[OSSOptions::BUCKET]);
     OSSUtils::assertObjectKey($options[OSSOptions::KEY]);
     return $options;
 }
Ejemplo n.º 2
0
 protected function checkOptions($options)
 {
     $options = parent::checkOptions($options);
     AssertUtils::assertSet(array(OSSOptions::CONTENT, OSSOptions::BUCKET, OSSOptions::KEY, OSSOptions::UPLOAD_ID, OSSOptions::PART_NUMBER, OSSOptions::PART_SIZE), $options);
     OSSUtils::assertBucketName($options[OSSOptions::BUCKET]);
     OSSUtils::assertObjectKey($options[OSSOptions::KEY]);
     AssertUtils::assertNumber($options[OSSOptions::PART_NUMBER], OSSOptions::PART_NUMBER);
     AssertUtils::assertNumber($options[OSSOptions::PART_SIZE], OSSOptions::PART_SIZE);
     return $options;
 }
 private function checkOptions($options)
 {
     AssertUtils::assertSet(array(OSSOptions::BUCKET, OSSOptions::KEY, OSSOptions::EXPIRES), $options);
     OSSUtils::assertBucketName($options[OSSOptions::BUCKET]);
     if (isset($options[OSSOptions::KEY])) {
         OSSUtils::assertObjectKey($options[OSSOptions::KEY]);
     }
     if (!$options[OSSOptions::EXPIRES] instanceof \DateTime) {
         throw new \InvalidArgumentException(OSSOptions::EXPIRES . ' must be instance of \\DateTime');
     }
     $options[OSSOptions::METHOD] = strtoupper($options[OSSOptions::METHOD]);
     return $options;
 }
Ejemplo n.º 4
0
 protected function checkOptions($options)
 {
     $options = parent::checkOptions($options);
     AssertUtils::assertSet(array(OSSOptions::BUCKET, OSSOptions::KEY), $options);
     OSSUtils::assertBucketName($options[OSSOptions::BUCKET]);
     OSSUtils::assertObjectKey($options[OSSOptions::KEY]);
     if (isset($options[OSSOptions::META_ONLY])) {
         if ($options[OSSOptions::META_ONLY]) {
             unset($options[OSSOptions::SAVE_AS]);
         }
     }
     return $options;
 }
 protected function checkOptions($options)
 {
     $options = parent::checkOptions($options);
     AssertUtils::assertSet(array(OSSOptions::BUCKET, OSSOptions::KEY, OSSOptions::UPLOAD_ID, OSSOptions::PART_ETAGS), $options);
     OSSUtils::assertBucketName($options[OSSOptions::BUCKET]);
     OSSUtils::assertObjectKey($options[OSSOptions::KEY]);
     AssertUtils::assertArray($options[OSSOptions::PART_ETAGS], OSSOptions::PART_ETAGS);
     for ($i = 0; $i < count($options[OSSOptions::PART_ETAGS]); $i++) {
         $partETag = $options[OSSOptions::PART_ETAGS][$i];
         AssertUtils::assertArray($partETag, OSSOptions::PART_ETAGS . '.' . $i);
         AssertUtils::assertSet(array(OSSOptions::PART_NUMBER, OSSOptions::ETAG), $partETag);
     }
     return $options;
 }
Ejemplo n.º 6
0
 protected function checkOptions($options)
 {
     $options = parent::checkOptions($options);
     AssertUtils::assertSet(array(OSSOptions::CONTENT, OSSOptions::BUCKET, OSSOptions::KEY), $options);
     OSSUtils::assertBucketName($options[OSSOptions::BUCKET]);
     OSSUtils::assertObjectKey($options[OSSOptions::KEY]);
     if (isset($options[OSSOptions::CONTENT_LENGTH])) {
         AssertUtils::assertNumber($options[OSSOptions::CONTENT_LENGTH], OSSOptions::CONTENT_LENGTH);
     }
     if (is_resource($options[OSSOptions::CONTENT]) && !isset($options[OSSOptions::CONTENT_LENGTH])) {
         throw new \InvalidArgumentException(OSSOptions::CONTENT_LENGTH . ' must be set when the content is a resource.');
     }
     return $options;
 }
Ejemplo n.º 7
0
 protected function checkOptions($options)
 {
     $options = parent::checkOptions($options);
     AssertUtils::assertSet(array(OSSOptions::BUCKET, OSSOptions::KEY, OSSOptions::UPLOAD_ID), $options);
     OSSUtils::assertBucketName($options[OSSOptions::BUCKET]);
     OSSUtils::assertObjectKey($options[OSSOptions::KEY]);
     if (isset($options[OSSOptions::PART_NUMBER_MARKER])) {
         AssertUtils::assertNumber($options[OSSOptions::PART_NUMBER_MARKER], OSSOptions::PART_NUMBER_MARKER);
     }
     if (isset($options[OSSOptions::MAX_PARTS])) {
         AssertUtils::assertNumber($options[OSSOptions::MAX_PARTS], OSSOptions::MAX_PARTS);
     }
     return $options;
 }