25
25
require_once 'Zend/Service/Rackspace/Files/Container.php ' ;
26
26
require_once 'Zend/Service/Rackspace/Files/Object.php ' ;
27
27
28
+ /**
29
+ * Zend_Service_Rackspace_Files
30
+ *
31
+ * @category Zend
32
+ * @package Zend_Service
33
+ * @subpackage Rackspace
34
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
35
+ * @license http://framework.zend.com/license/new-bsd New BSD License
36
+ */
28
37
class Zend_Service_Rackspace_Files extends Zend_Service_Rackspace_Abstract
29
38
{
30
39
const ERROR_CONTAINER_NOT_EMPTY = 'The container is not empty, I cannot delete it. ' ;
@@ -70,7 +79,7 @@ class Zend_Service_Rackspace_Files extends Zend_Service_Rackspace_Abstract
70
79
/**
71
80
* Return the total count of containers
72
81
*
73
- * @return integer
82
+ * @return int
74
83
*/
75
84
public function getCountContainers ()
76
85
{
@@ -80,7 +89,7 @@ public function getCountContainers()
80
89
/**
81
90
* Return the size in bytes of all the containers
82
91
*
83
- * @return integer
92
+ * @return int
84
93
*/
85
94
public function getSizeContainers ()
86
95
{
@@ -90,7 +99,7 @@ public function getSizeContainers()
90
99
/**
91
100
* Return the count of objects contained in all the containers
92
101
*
93
- * @return integer
102
+ * @return int
94
103
*/
95
104
public function getCountObjects ()
96
105
{
@@ -100,8 +109,8 @@ public function getCountObjects()
100
109
/**
101
110
* Get all the containers
102
111
*
103
- * @param array $options
104
- * @return Zend_Service_Rackspace_Files_ContainerList|boolean
112
+ * @param array $options
113
+ * @return Zend_Service_Rackspace_Files_ContainerList|bool
105
114
*/
106
115
public function getContainers ($ options =array ())
107
116
{
@@ -115,7 +124,7 @@ public function getContainers($options=array())
115
124
* Get all the CDN containers
116
125
*
117
126
* @param array $options
118
- * @return array|boolean
127
+ * @return array|bool
119
128
*/
120
129
public function getCdnContainers ($ options =array ())
121
130
{
@@ -132,7 +141,7 @@ public function getCdnContainers($options=array())
132
141
* - size in bytes of all the containers
133
142
* - total objects in all the containers
134
143
*
135
- * @return array|boolean
144
+ * @return array|bool
136
145
*/
137
146
public function getInfoAccount ()
138
147
{
@@ -147,12 +156,16 @@ public function getInfoAccount()
147
156
}
148
157
return false ;
149
158
}
159
+
150
160
/**
151
161
* Get all the objects of a container
152
162
*
153
- * @param string $container
154
- * @param array $options
155
- * @return Zend_Service_Rackspace_Files_ObjectList|boolean
163
+ * Returns a maximum of 10,000 object names.
164
+ *
165
+ * @param string $container
166
+ * @param array $options
167
+ * @return bool|Zend_Service_Rackspace_Files_ObjectList
168
+ * @throws Zend_Service_Rackspace_Exception
156
169
*/
157
170
public function getObjects ($ container ,$ options =array ())
158
171
{
@@ -166,12 +179,14 @@ public function getObjects($container,$options=array())
166
179
}
167
180
return false ;
168
181
}
182
+
169
183
/**
170
184
* Create a container
171
185
*
172
- * @param string $container
173
- * @param array $metadata
174
- * @return Zend_Service_Rackspace_Files_Container|boolean
186
+ * @param string $container
187
+ * @param array $metadata
188
+ * @return bool|Zend_Service_Rackspace_Files_Container
189
+ * @throws Zend_Service_Rackspace_Exception
175
190
*/
176
191
public function createContainer ($ container ,$ metadata =array ())
177
192
{
@@ -203,11 +218,13 @@ public function createContainer($container,$metadata=array())
203
218
$ this ->errorCode = $ status ;
204
219
return false ;
205
220
}
221
+
206
222
/**
207
223
* Delete a container (only if it's empty)
208
224
*
209
- * @param sting $container
210
- * @return boolean
225
+ * @param string $container
226
+ * @return bool
227
+ * @throws Zend_Service_Rackspace_Exception
211
228
*/
212
229
public function deleteContainer ($ container )
213
230
{
@@ -233,11 +250,13 @@ public function deleteContainer($container)
233
250
$ this ->errorCode = $ status ;
234
251
return false ;
235
252
}
253
+
236
254
/**
237
255
* Get the metadata of a container
238
256
*
239
- * @param string $container
240
- * @return array|boolean
257
+ * @param string $container
258
+ * @return array|bool
259
+ * @throws Zend_Service_Rackspace_Exception
241
260
*/
242
261
public function getMetadataContainer ($ container )
243
262
{
@@ -279,8 +298,8 @@ public function getMetadataContainer($container)
279
298
/**
280
299
* Get a container
281
300
*
282
- * @param string $container
283
- * @return Container|boolean
301
+ * @param string $container
302
+ * @return Zend_Service_Rackspace_Files_Container|bool
284
303
*/
285
304
public function getContainer ($ container ) {
286
305
$ result = $ this ->getMetadataContainer ($ container );
@@ -289,13 +308,15 @@ public function getContainer($container) {
289
308
}
290
309
return false ;
291
310
}
311
+
292
312
/**
293
313
* Get an object in a container
294
314
*
295
- * @param string $container
296
- * @param string $object
297
- * @param array $headers
298
- * @return Zend_Service_Rackspace_Files_Object|boolean
315
+ * @param string $container
316
+ * @param string $object
317
+ * @param array $headers
318
+ * @return bool|Zend_Service_Rackspace_Files_Object
319
+ * @throws Zend_Service_Rackspace_Exception
299
320
*/
300
321
public function getObject ($ container ,$ object ,$ headers =array ())
301
322
{
@@ -331,16 +352,17 @@ public function getObject($container,$object,$headers=array())
331
352
$ this ->errorCode = $ status ;
332
353
return false ;
333
354
}
355
+
334
356
/**
335
357
* Store a file in a container
336
358
*
337
- * @param string $container
338
- * @param string $object
339
- * @param string $content
340
- * @param array $metadata
341
- * @param string $content_type
342
- *
343
- * @return boolean
359
+ * @param string $container
360
+ * @param string $object
361
+ * @param string $content
362
+ * @param array $metadata
363
+ * @param string $content_type
364
+ * @return bool
365
+ * @throws Zend_Service_Rackspace_Exception
344
366
*/
345
367
public function storeObject ($ container ,$ object ,$ content ,$ metadata =array (),$ content_type =null ) {
346
368
if (empty ($ container )) {
@@ -383,12 +405,14 @@ public function storeObject($container,$object,$content,$metadata=array(),$conte
383
405
$ this ->errorCode = $ status ;
384
406
return false ;
385
407
}
408
+
386
409
/**
387
410
* Delete an object in a container
388
411
*
389
- * @param string $container
390
- * @param string $object
391
- * @return boolean
412
+ * @param string $container
413
+ * @param string $object
414
+ * @return bool
415
+ * @throws Zend_Service_Rackspace_Exception
392
416
*/
393
417
public function deleteObject ($ container ,$ object ) {
394
418
if (empty ($ container )) {
@@ -414,16 +438,18 @@ public function deleteObject($container,$object) {
414
438
$ this ->errorCode = $ status ;
415
439
return false ;
416
440
}
441
+
417
442
/**
418
443
* Copy an object from a container to another
419
444
*
420
- * @param string $container_source
421
- * @param string $obj_source
422
- * @param string $container_dest
423
- * @param string $obj_dest
424
- * @param array $metadata
425
- * @param string $content_type
426
- * @return boolean
445
+ * @param string $container_source
446
+ * @param string $obj_source
447
+ * @param string $container_dest
448
+ * @param string $obj_dest
449
+ * @param array $metadata
450
+ * @param string $content_type
451
+ * @return bool
452
+ * @throws Zend_Service_Rackspace_Exception
427
453
*/
428
454
public function copyObject ($ container_source ,$ obj_source ,$ container_dest ,$ obj_dest ,$ metadata =array (),$ content_type =null ) {
429
455
if (empty ($ container_source )) {
@@ -466,12 +492,14 @@ public function copyObject($container_source,$obj_source,$container_dest,$obj_de
466
492
$ this ->errorCode = $ status ;
467
493
return false ;
468
494
}
495
+
469
496
/**
470
497
* Get the metadata of an object
471
498
*
472
- * @param string $container
473
- * @param string $object
474
- * @return array|boolean
499
+ * @param string $container
500
+ * @param string $object
501
+ * @return array|bool
502
+ * @throws Zend_Service_Rackspace_Exception
475
503
*/
476
504
public function getMetadataObject ($ container ,$ object ) {
477
505
if (empty ($ container )) {
@@ -516,14 +544,16 @@ public function getMetadataObject($container,$object) {
516
544
$ this ->errorCode = $ status ;
517
545
return false ;
518
546
}
547
+
519
548
/**
520
549
* Set the metadata of a object in a container
521
550
* The old metadata values are replaced with the new one
522
- *
523
- * @param string $container
524
- * @param string $object
525
- * @param array $metadata
526
- * @return boolean
551
+ *
552
+ * @param string $container
553
+ * @param string $object
554
+ * @param array $metadata
555
+ * @return bool
556
+ * @throws Zend_Service_Rackspace_Exception
527
557
*/
528
558
public function setMetadataObject ($ container ,$ object ,$ metadata )
529
559
{
@@ -558,12 +588,14 @@ public function setMetadataObject($container,$object,$metadata)
558
588
$ this ->errorCode = $ status ;
559
589
return false ;
560
590
}
591
+
561
592
/**
562
593
* Enable the CDN for a container
563
594
*
564
595
* @param string $container
565
- * @param integer $ttl
566
- * @return array|boolean
596
+ * @param int $ttl
597
+ * @return array|bool
598
+ * @throws Zend_Service_Rackspace_Exception
567
599
*/
568
600
public function enableCdnContainer ($ container ,$ ttl =self ::CDN_TTL_MIN ) {
569
601
if (empty ($ container )) {
@@ -597,14 +629,16 @@ public function enableCdnContainer ($container,$ttl=self::CDN_TTL_MIN) {
597
629
$ this ->errorCode = $ status ;
598
630
return false ;
599
631
}
632
+
600
633
/**
601
634
* Update the attribute of a CDN container
602
635
*
603
636
* @param string $container
604
- * @param integer $ttl
605
- * @param boolean $cdn_enabled
606
- * @param boolean $log
607
- * @return boolean
637
+ * @param int $ttl
638
+ * @param bool $cdn_enabled
639
+ * @param bool $log
640
+ * @return bool
641
+ * @throws Zend_Service_Rackspace_Exception
608
642
*/
609
643
public function updateCdnContainer ($ container ,$ ttl =null ,$ cdn_enabled =null ,$ log =null )
610
644
{
@@ -655,11 +689,13 @@ public function updateCdnContainer($container,$ttl=null,$cdn_enabled=null,$log=n
655
689
$ this ->errorCode = $ status ;
656
690
return false ;
657
691
}
692
+
658
693
/**
659
694
* Get the information of a Cdn container
660
695
*
661
- * @param string $container
662
- * @return array|boolean
696
+ * @param string $container
697
+ * @return array|bool
698
+ * @throws Zend_Service_Rackspace_Exception
663
699
*/
664
700
public function getInfoCdnContainer ($ container ) {
665
701
if (empty ($ container )) {
0 commit comments