@@ -128,8 +128,8 @@ class Zend_Service_SlideShare
128
128
protected $ _cacheobject ;
129
129
130
130
/**
131
- * Sets the Zend_Http_Client object to use in requests. If not provided a default will
132
- * be used.
131
+ * Sets the Zend_Http_Client object to use in requests. If not provided a
132
+ * default will be used.
133
133
*
134
134
* @param Zend_Http_Client $client The HTTP client instance to use
135
135
* @return Zend_Service_SlideShare
@@ -141,8 +141,8 @@ public function setHttpClient(Zend_Http_Client $client)
141
141
}
142
142
143
143
/**
144
- * Returns the instance of the Zend_Http_Client which will be used. Creates an instance
145
- * of Zend_Http_Client if no previous client was set.
144
+ * Returns the instance of the Zend_Http_Client which will be used. Creates
145
+ * an instance of Zend_Http_Client if no previous client was set.
146
146
*
147
147
* @return Zend_Http_Client The HTTP client which will be used
148
148
*/
@@ -179,9 +179,9 @@ public function setCacheObject(Zend_Cache_Core $cacheobject)
179
179
}
180
180
181
181
/**
182
- * Gets the Zend_Cache object which will be used to cache API queries. If no cache object
183
- * was previously set the the default will be used (Filesystem caching in /tmp with a life
184
- * time of 43200 seconds)
182
+ * Gets the Zend_Cache object which will be used to cache API queries. If no
183
+ * cache object was previously set the the default will be used (Filesystem
184
+ * caching in /tmp with a life time of 43200 seconds)
185
185
*
186
186
* @return Zend_Cache_Core The object used in caching
187
187
*/
@@ -193,8 +193,8 @@ public function getCacheObject()
193
193
'Core ' ,
194
194
'File ' ,
195
195
array (
196
- 'lifetime ' => 43200 ,
197
- 'automatic_serialization ' => true
196
+ 'lifetime ' => 43200 ,
197
+ 'automatic_serialization ' => true
198
198
),
199
199
array ('cache_dir ' => '/tmp ' )
200
200
);
@@ -316,9 +316,15 @@ public function __construct(
316
316
/**
317
317
* Uploads the specified Slide show the the server
318
318
*
319
- * @param Zend_Service_SlideShare_SlideShow $ss The slide show object representing the slide show to upload
320
- * @param boolean $makeSrcPublic Determines if the the slide show's source file is public or not upon upload
321
- * @return Zend_Service_SlideShare_SlideShow The passed Slide show object, with the new assigned ID provided
319
+ * @param Zend_Service_SlideShare_SlideShow $ss The slide show
320
+ * object representing the
321
+ * slide show to upload
322
+ * @param boolean $makeSrcPublic Determines if the slide
323
+ * show's source file is public
324
+ * or not upon upload
325
+ * @return Zend_Service_SlideShare_SlideShow The passed Slide show object,
326
+ * with the new assigned ID
327
+ * provided
322
328
* @throws Zend_Service_SlideShare_Exception
323
329
*/
324
330
public function uploadSlideShow (
@@ -383,11 +389,12 @@ public function uploadSlideShow(
383
389
384
390
if ($ sxe ->getName () == "SlideShareServiceError " ) {
385
391
$ message = (string )$ sxe ->Message [0 ];
386
- list ($ code , $ error_str ) = explode (': ' , $ message );
392
+ list ($ code , $ errorStr ) = explode (': ' , $ message );
387
393
require_once 'Zend/Service/SlideShare/Exception.php ' ;
388
- throw new Zend_Service_SlideShare_Exception (trim (
389
- $ error_str
390
- ), $ code );
394
+ throw new Zend_Service_SlideShare_Exception (
395
+ trim ($ errorStr ),
396
+ $ code
397
+ );
391
398
}
392
399
393
400
if (!$ sxe ->getName () == "SlideShowUploaded " ) {
@@ -405,26 +412,25 @@ public function uploadSlideShow(
405
412
/**
406
413
* Retrieves a slide show's information based on slide show ID
407
414
*
408
- * @param int $ss_id The slide show ID
415
+ * @param int $ssId The slide show ID
409
416
* @return Zend_Service_SlideShare_SlideShow the Slideshow object
410
417
* @throws Zend_Service_SlideShare_Exception
411
418
*/
412
- public function getSlideShow ($ ss_id )
419
+ public function getSlideShow ($ ssId )
413
420
{
414
421
$ timestamp = time ();
415
422
416
423
$ params = array (
417
424
'api_key ' => $ this ->getApiKey (),
418
425
'ts ' => $ timestamp ,
419
426
'hash ' => sha1 ($ this ->getSharedSecret () . $ timestamp ),
420
- 'slideshow_id ' => $ ss_id
427
+ 'slideshow_id ' => $ ssId
421
428
);
422
429
423
- $ cache = $ this ->getCacheObject ();
424
-
425
- $ cache_key = md5 ("__zendslideshare_cache_ $ ss_id " );
430
+ $ cache = $ this ->getCacheObject ();
431
+ $ cacheKey = md5 ("__zendslideshare_cache_ $ ssId " );
426
432
427
- if (!$ retval = $ cache ->load ($ cache_key )) {
433
+ if (!$ retval = $ cache ->load ($ cacheKey )) {
428
434
$ client = $ this ->getHttpClient ();
429
435
430
436
$ client ->setUri (self ::SERVICE_GET_SHOW_URI );
@@ -444,11 +450,12 @@ public function getSlideShow($ss_id)
444
450
445
451
if ($ sxe ->getName () == "SlideShareServiceError " ) {
446
452
$ message = (string )$ sxe ->Message [0 ];
447
- list ($ code , $ error_str ) = explode (': ' , $ message );
453
+ list ($ code , $ errorStr ) = explode (': ' , $ message );
448
454
require_once 'Zend/Service/SlideShare/Exception.php ' ;
449
- throw new Zend_Service_SlideShare_Exception (trim (
450
- $ error_str
451
- ), $ code );
455
+ throw new Zend_Service_SlideShare_Exception (
456
+ trim ($ errorStr ),
457
+ $ code
458
+ );
452
459
}
453
460
454
461
if (!($ sxe ->getName () == 'Slideshow ' )) {
@@ -459,7 +466,7 @@ public function getSlideShow($ss_id)
459
466
}
460
467
$ retval = $ this ->_slideShowNodeToObject (clone $ sxe );
461
468
462
- $ cache ->save ($ retval , $ cache_key );
469
+ $ cache ->save ($ retval , $ cacheKey );
463
470
}
464
471
465
472
return $ retval ;
@@ -529,7 +536,9 @@ public function getSlideShowsByGroup($group, $offset = null, $limit = null)
529
536
* @return array An array of Zend_Service_SlideShare_SlideShow objects
530
537
* @throws Zend_Service_SlideShare_Exception
531
538
*/
532
- protected function _getSlideShowsByType ($ key , $ value , $ offset = null , $ limit = null )
539
+ protected function _getSlideShowsByType (
540
+ $ key , $ value , $ offset = null , $ limit = null
541
+ )
533
542
{
534
543
$ key = strtolower ($ key );
535
544
@@ -555,10 +564,12 @@ protected function _getSlideShowsByType($key, $value, $offset = null, $limit = n
555
564
556
565
$ timestamp = time ();
557
566
558
- $ params = array ('api_key ' => $ this ->getApiKey (),
559
- 'ts ' => $ timestamp ,
560
- 'hash ' => sha1 ($ this ->getSharedSecret ().$ timestamp ),
561
- $ key => $ value );
567
+ $ params = array (
568
+ 'api_key ' => $ this ->getApiKey (),
569
+ 'ts ' => $ timestamp ,
570
+ 'hash ' => sha1 ($ this ->getSharedSecret () . $ timestamp ),
571
+ $ key => $ value
572
+ );
562
573
563
574
if ($ offset !== null ) {
564
575
$ params ['offset ' ] = (int )$ offset ;
@@ -568,11 +579,10 @@ protected function _getSlideShowsByType($key, $value, $offset = null, $limit = n
568
579
$ params ['limit ' ] = (int )$ limit ;
569
580
}
570
581
571
- $ cache = $ this ->getCacheObject ();
572
-
573
- $ cache_key = md5 ($ key .$ value .$ offset .$ limit );
582
+ $ cache = $ this ->getCacheObject ();
583
+ $ cacheKey = md5 ($ key . $ value . $ offset . $ limit );
574
584
575
- if (!$ retval = $ cache ->load ($ cache_key )) {
585
+ if (!$ retval = $ cache ->load ($ cacheKey )) {
576
586
$ client = $ this ->getHttpClient ();
577
587
578
588
$ client ->setUri ($ queryUri );
@@ -592,10 +602,10 @@ protected function _getSlideShowsByType($key, $value, $offset = null, $limit = n
592
602
593
603
if ($ sxe ->getName () == "SlideShareServiceError " ) {
594
604
$ message = (string )$ sxe ->Message [0 ];
595
- list ($ code , $ error_str ) = explode (': ' , $ message );
605
+ list ($ code , $ errorStr ) = explode (': ' , $ message );
596
606
require_once 'Zend/Service/SlideShare/Exception.php ' ;
597
607
throw new Zend_Service_SlideShare_Exception (
598
- trim ($ error_str ), $ code
608
+ trim ($ errorStr ), $ code
599
609
);
600
610
}
601
611
@@ -614,7 +624,7 @@ protected function _getSlideShowsByType($key, $value, $offset = null, $limit = n
614
624
}
615
625
}
616
626
617
- $ cache ->save ($ retval , $ cache_key );
627
+ $ cache ->save ($ retval , $ cacheKey );
618
628
}
619
629
620
630
return $ retval ;
@@ -633,7 +643,7 @@ protected function _getSlideShowsByType($key, $value, $offset = null, $limit = n
633
643
protected function _slideShowNodeToObject (SimpleXMLElement $ node )
634
644
{
635
645
636
- if ($ node ->getName () == 'Slideshow ' ) {
646
+ if ($ node ->getName () == 'Slideshow ' ) {
637
647
$ ss = new Zend_Service_SlideShare_SlideShow ();
638
648
639
649
$ ss ->setId ((string )$ node ->ID );
0 commit comments