瀏覽代碼

Remove trailing whitespaces, change tab for spaces, convert CRLF to LF. ZF-7316 related.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@18950 44c647ce-9c0f-0410-b52a-842ac1e357ba
alexander 16 年之前
父節點
當前提交
2b422321df
共有 100 個文件被更改,包括 1120 次插入1120 次删除
  1. 3 3
      demos/Zend/Feeds/consume-feed.php
  2. 77 77
      demos/Zend/Gdata/Blogger.php
  3. 2 2
      demos/Zend/Gdata/BooksBrowser/index.php
  4. 94 94
      demos/Zend/Gdata/Calendar.php
  5. 28 28
      demos/Zend/Gdata/Docs.php
  6. 168 168
      demos/Zend/Gdata/Gapps.php
  7. 130 130
      demos/Zend/Gdata/Gbase.php
  8. 6 6
      demos/Zend/Gdata/MyLibrary/demo.php
  9. 61 61
      demos/Zend/Gdata/Photos.php
  10. 14 14
      demos/Zend/Gdata/Spreadsheet-ClientLogin.php
  11. 2 2
      demos/Zend/Gdata/YouTubeVideoApp/index.php
  12. 3 3
      demos/Zend/Gdata/YouTubeVideoApp/session_details.php
  13. 20 20
      demos/Zend/Gdata/YouTubeVideoBrowser/index.php
  14. 1 1
      demos/Zend/Locale/AllLanguages.php
  15. 2 2
      demos/Zend/OpenId/mvc_auth/application/controllers/ErrorController.php
  16. 2 2
      demos/Zend/OpenId/mvc_auth/application/controllers/IndexController.php
  17. 4 4
      demos/Zend/Pdf/demo.php
  18. 32 32
      demos/Zend/ProgressBar/JsPush.php
  19. 32 32
      demos/Zend/ProgressBar/Upload.php
  20. 1 1
      demos/Zend/Wildfire/application/controllers/Boot/Zend-Db-Profiler-Firebug/IndexController.php
  21. 1 1
      demos/Zend/Wildfire/application/controllers/Boot/Zend-Log-Writer-Firebug/IndexController.php
  22. 3 3
      demos/Zend/Wildfire/application/controllers/ErrorController.php
  23. 11 11
      demos/Zend/Wildfire/application/controllers/ZendDbProfilerFirebugController.php
  24. 11 11
      demos/Zend/Wildfire/public/Boot/Zend-Db-Profiler-Firebug/TestDocExample.php
  25. 11 11
      demos/Zend/Wildfire/public/Boot/Zend-Log-Writer-Firebug/TestDocExample.php
  26. 1 1
      demos/Zend/Wildfire/public/index.php
  27. 4 4
      library/Zend/Acl.php
  28. 1 1
      library/Zend/Acl/Role.php
  29. 3 3
      library/Zend/Acl/Role/Registry.php
  30. 2 2
      library/Zend/Amf/Adobe/Introspector.php
  31. 3 3
      library/Zend/Application.php
  32. 1 1
      library/Zend/Application/Bootstrap/BootstrapAbstract.php
  33. 3 3
      library/Zend/Application/Resource/Dojo.php
  34. 1 1
      library/Zend/Application/Resource/Modules.php
  35. 1 1
      library/Zend/Application/Resource/Router.php
  36. 6 6
      library/Zend/Application/Resource/Translate.php
  37. 2 2
      library/Zend/Auth.php
  38. 3 3
      library/Zend/Auth/Adapter/DbTable.php
  39. 1 1
      library/Zend/CodeGenerator/Php/Parameter.php
  40. 4 4
      library/Zend/Controller/Plugin/ActionStack.php
  41. 9 9
      library/Zend/Controller/Request/Http.php
  42. 17 17
      library/Zend/Controller/Router/Rewrite.php
  43. 39 39
      library/Zend/Db/Adapter/Pdo/Mssql.php
  44. 2 2
      library/Zend/Db/Adapter/Pdo/Sqlite.php
  45. 5 5
      library/Zend/Db/Statement.php
  46. 1 1
      library/Zend/Db/Statement/Exception.php
  47. 6 6
      library/Zend/Db/Statement/Mysqli.php
  48. 2 2
      library/Zend/Db/Statement/Pdo.php
  49. 3 3
      library/Zend/Db/Table/Abstract.php
  50. 1 1
      library/Zend/Db/Table/Select.php
  51. 4 4
      library/Zend/Dojo/View/Helper/Dojo/Container.php
  52. 1 1
      library/Zend/Dojo/View/Helper/Editor.php
  53. 5 5
      library/Zend/Feed/Reader/Extension/Atom/Entry.php
  54. 4 4
      library/Zend/Feed/Reader/Extension/Atom/Feed.php
  55. 1 1
      library/Zend/Feed/Reader/Feed/Atom.php
  56. 6 6
      library/Zend/Filter/Compress.php
  57. 1 1
      library/Zend/Filter/Compress/CompressInterface.php
  58. 1 1
      library/Zend/Filter/Null.php
  59. 1 1
      library/Zend/Form.php
  60. 1 1
      library/Zend/Form/Element.php
  61. 1 1
      library/Zend/Form/Element/Captcha.php
  62. 1 1
      library/Zend/Form/Element/Radio.php
  63. 3 3
      library/Zend/Gdata/HttpClient.php
  64. 2 2
      library/Zend/Http/Client.php
  65. 2 2
      library/Zend/Json/Server/Response.php
  66. 9 9
      library/Zend/Loader/Autoloader.php
  67. 4 4
      library/Zend/Queue/Adapter/Memcacheq.php
  68. 1 1
      library/Zend/Reflection/Docblock.php
  69. 5 5
      library/Zend/Rest/Route.php
  70. 1 1
      library/Zend/Service/Amazon/Abstract.php
  71. 9 9
      library/Zend/Service/Amazon/Ec2/Abstract.php
  72. 2 2
      library/Zend/Service/Amazon/Ec2/CloudWatch.php
  73. 2 2
      library/Zend/Service/Amazon/Offer.php
  74. 3 3
      library/Zend/Service/Amazon/S3.php
  75. 23 23
      library/Zend/Service/Twitter.php
  76. 2 2
      library/Zend/Service/Yahoo.php
  77. 1 1
      library/Zend/Test/DbAdapter.php
  78. 1 1
      library/Zend/Test/PHPUnit/Db/Operation/Truncate.php
  79. 1 1
      library/Zend/Uri.php
  80. 1 1
      library/Zend/Validate/CreditCard.php
  81. 8 8
      library/Zend/Validate/Ip.php
  82. 1 1
      library/Zend/View/Helper/FormCheckbox.php
  83. 1 1
      library/Zend/View/Helper/HeadTitle.php
  84. 1 1
      library/Zend/XmlRpc/Server/System.php
  85. 2 2
      tests/AllTests.php
  86. 51 51
      tests/Zend/Acl/AclTest.php
  87. 5 5
      tests/Zend/Acl/_files/AssertionZF7973.php
  88. 7 7
      tests/Zend/Acl/_files/MockAssertion.php
  89. 18 18
      tests/Zend/Acl/_files/UseCase1/Acl.php
  90. 6 6
      tests/Zend/Acl/_files/UseCase1/UserIsBlogPostOwnerAssertion.php
  91. 4 4
      tests/Zend/AllTests.php
  92. 6 6
      tests/Zend/Application/ApplicationTest.php
  93. 1 1
      tests/Zend/Application/Bootstrap/BootstrapAbstractTest.php
  94. 1 1
      tests/Zend/Application/Resource/AllTests.php
  95. 1 1
      tests/Zend/Application/Resource/DojoTest.php
  96. 43 43
      tests/Zend/Application/Resource/NavigationTest.php
  97. 1 1
      tests/Zend/Application/Resource/RouterTest.php
  98. 20 20
      tests/Zend/Application/Resource/TranslateTest.php
  99. 3 3
      tests/Zend/Application/Resource/_files/ZfAppBootstrapCustomView.php
  100. 1 1
      tests/Zend/Application/_files/ZfAppBootstrap.php

+ 3 - 3
demos/Zend/Feeds/consume-feed.php

@@ -20,7 +20,7 @@
  */
 
 /**
- * Consume an RSS feed and display all of the titles and 
+ * Consume an RSS feed and display all of the titles and
  * associated links within.
  */
 
@@ -32,8 +32,8 @@ require_once 'Zend/Feed.php';
 $feed = Zend_Feed::import('http://news.google.com/?output=rss');
 
 foreach ($feed->items as $item) {
-    
+
     echo "<p>" . $item->title() . "<br />";
     echo $item->link()  . "</p>";
-    
+
 }

+ 77 - 77
demos/Zend/Gdata/Blogger.php

@@ -20,7 +20,7 @@
  */
 
 /*
-* This sample utilizes the Zend Gdata Client Library, which can be 
+* This sample utilizes the Zend Gdata Client Library, which can be
 * downloaded from: http://framework.zend.com/download
 *
 * This sample is meant to show basic CRUD (Create, Retrieve, Update
@@ -53,7 +53,7 @@ Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
 
 
 /**
- * Class that contains all simple CRUD operations for Blogger. 
+ * Class that contains all simple CRUD operations for Blogger.
  *
  * @category   Zend
  * @package    Zend_Gdata
@@ -68,18 +68,18 @@ class SimpleCRUD
      *
      * @var string
      */
-    public $blogID; 
+    public $blogID;
 
     /**
      * $gdClient - Client class used to communicate with the Blogger service
      *
      * @var Zend_Gdata_Client
      */
-    public $gdClient; 
-    
+    public $gdClient;
+
 
     /**
-     * Constructor for the class. Takes in user credentials and generates the  
+     * Constructor for the class. Takes in user credentials and generates the
      * the authenticated client object.
      *
      * @param  string $email    The user's email address.
@@ -91,13 +91,13 @@ class SimpleCRUD
         $client = Zend_Gdata_ClientLogin::getHttpClient($email, $password, 'blogger');
         $this->gdClient = new Zend_Gdata($client);
     }
-    
+
     /**
-     * This function retrieves all the blogs associated with the authenticated  
+     * This function retrieves all the blogs associated with the authenticated
      * user and prompts the user to choose which to manipulate.
      *
-     * Once the index is selected by the user, the corresponding blogID is 
-     * extracted and stored for easy access. 
+     * Once the index is selected by the user, the corresponding blogID is
+     * extracted and stored for easy access.
      *
      * @return void
      */
@@ -112,7 +112,7 @@ class SimpleCRUD
         $idText = explode('-', $feed->entries[$input]->id->text);
         $this->blogID = $idText[2];
     }
-    
+
     /**
      * This function creates a new Zend_Gdata_Entry representing a blog
      * post, and inserts it into the user's blog. It also checks for
@@ -129,28 +129,28 @@ class SimpleCRUD
         // We're using the magic factory method to create a Zend_Gdata_Entry.
         // http://framework.zend.com/manual/en/zend.gdata.html#zend.gdata.introdduction.magicfactory
         $entry = $this->gdClient->newEntry();
-    
+
         $entry->title = $this->gdClient->newTitle(trim($title));
         $entry->content = $this->gdClient->newContent(trim($content));
-        $entry->content->setType('text'); 
-        $uri = "http://www.blogger.com/feeds/" . $this->blogID . "/posts/default";  
-        
+        $entry->content->setType('text');
+        $uri = "http://www.blogger.com/feeds/" . $this->blogID . "/posts/default";
+
         if ($isDraft)
         {
-            $control = $this->gdClient->newControl(); 
+            $control = $this->gdClient->newControl();
             $draft = $this->gdClient->newDraft('yes');
-            $control->setDraft($draft);  
-            $entry->control = $control; 
-        }        
+            $control->setDraft($draft);
+            $entry->control = $control;
+        }
 
         $createdPost = $this->gdClient->insertEntry($entry, $uri);
-        //format of id text: tag:blogger.com,1999:blog-blogID.post-postID 
+        //format of id text: tag:blogger.com,1999:blog-blogID.post-postID
         $idText = explode('-', $createdPost->id->text);
         $postID = $idText[2];
 
-        return $postID; 
+        return $postID;
     }
-    
+
     /**
      * Prints the titles of all the posts in the user's blog.
      *
@@ -172,75 +172,75 @@ class SimpleCRUD
      * @param string  $updatedTitle   The new title of the post.
      * @param string  $updatedContent The new body of the post.
      * @param boolean $isDraft        Whether the post will be published or saved as a draft.
-     * @return Zend_Gdata_Entry The updated post. 
+     * @return Zend_Gdata_Entry The updated post.
      */
     public function updatePost($postID, $updatedTitle, $updatedContent, $isDraft)
     {
-        $query = new Zend_Gdata_Query('http://www.blogger.com/feeds/' . $this->blogID . '/posts/default/' . $postID); 
+        $query = new Zend_Gdata_Query('http://www.blogger.com/feeds/' . $this->blogID . '/posts/default/' . $postID);
         $postToUpdate = $this->gdClient->getEntry($query);
         $postToUpdate->title->text = $this->gdClient->newTitle(trim($updatedTitle));
         $postToUpdate->content->text = $this->gdClient->newContent(trim($updatedContent));
 
         if ($isDraft) {
-            $draft = $this->gdClient->newDraft('yes'); 
+            $draft = $this->gdClient->newDraft('yes');
         } else {
             $draft = $this->gdClient->newDraft('no');
         }
-   
+
         $control = $this->gdClient->newControl();
         $control->setDraft($draft);
         $postToUpdate->control = $control;
         $updatedPost = $postToUpdate->save();
-        
-        return $updatedPost; 
+
+        return $updatedPost;
     }
 
     /**
-     * This function uses query parameters to retrieve and print all posts 
+     * This function uses query parameters to retrieve and print all posts
      * within a specified date range.
      *
      * @param  string $startDate Beginning date, inclusive. Preferred format is a RFC-3339 date,
-     *                           though other formats are accepted. 
+     *                           though other formats are accepted.
      * @param  string $endDate   End date, exclusive.
-     * @return void  
+     * @return void
      */
     public function printPostsInDateRange($startDate, $endDate)
     {
-        $query = new Zend_Gdata_Query('http://www.blogger.com/feeds/' . $this->blogID . '/posts/default'); 
+        $query = new Zend_Gdata_Query('http://www.blogger.com/feeds/' . $this->blogID . '/posts/default');
         $query->setParam('published-min', $startDate);
-        $query->setParam('published-max', $endDate); 
-   
-        $feed = $this->gdClient->getFeed($query); 
-        $this->printFeed($feed); 
+        $query->setParam('published-max', $endDate);
+
+        $feed = $this->gdClient->getFeed($query);
+        $this->printFeed($feed);
     }
 
-    /** 
+    /**
      * This function creates a new comment and adds it to the specified post.
      * A comment is created as a Zend_Gdata_Entry.
      *
      * @param  string $postID      The ID of the post to add the comment to. PostID
      *                             in the <id> field: tag:blogger.com,1999:blog-blogID.post-postID
-     * @param  string $commentText The text of the comment to add. 
+     * @param  string $commentText The text of the comment to add.
      * @return string The ID of the newly created comment.
      */
     public function createComment($postID, $commentText)
     {
-        $uri = 'http://www.blogger.com/feeds/' . $this->blogID . '/' . $postID . '/comments/default'; 
-        
-        $newComment = $this->gdClient->newEntry(); 
-        $newComment->content = $this->gdClient->newContent($commentText); 
-        $newComment->content->setType('text'); 
-        $createdComment = $this->gdClient->insertEntry($newComment, $uri); 
-        
+        $uri = 'http://www.blogger.com/feeds/' . $this->blogID . '/' . $postID . '/comments/default';
+
+        $newComment = $this->gdClient->newEntry();
+        $newComment->content = $this->gdClient->newContent($commentText);
+        $newComment->content->setType('text');
+        $createdComment = $this->gdClient->insertEntry($newComment, $uri);
+
         echo 'Added new comment: ' . $createdComment->content->text . "\n";
-        // Edit link follows format: /feeds/blogID/postID/comments/default/commentID 
+        // Edit link follows format: /feeds/blogID/postID/comments/default/commentID
         $editLink = explode('/', $createdComment->getEditLink()->href);
-        $commentID = $editLink[8];      
- 
-        return $commentID; 
+        $commentID = $editLink[8];
+
+        return $commentID;
     }
 
-    /** 
+    /**
      * This function prints all comments associated with the specified post.
      *
      * @param  string $postID The ID of the post whose comments we'll print.
@@ -248,27 +248,27 @@ class SimpleCRUD
      */
     public function printAllComments($postID)
     {
-        $query = new Zend_Gdata_Query('http://www.blogger.com/feeds/' . $this->blogID . '/' . $postID . '/comments/default'); 
+        $query = new Zend_Gdata_Query('http://www.blogger.com/feeds/' . $this->blogID . '/' . $postID . '/comments/default');
         $feed = $this->gdClient->getFeed($query);
-        $this->printFeed($feed); 
+        $this->printFeed($feed);
     }
 
-    /** 
+    /**
      * This function deletes the specified comment from a post.
      *
      * @param  string $postID    The ID of the post where the comment is. PostID in
      *                           the <id> field: tag:blogger.com,1999:blog-blogID.post-postID
      * @param  string $commentID The ID of the comment to delete. The commentID
      *                           in the editURL: /feeds/blogID/postID/comments/default/commentID
-     * @return void 
+     * @return void
      */
     public function deleteComment($postID, $commentID)
     {
-        $uri = 'http://www.blogger.com/feeds/' . $this->blogID . '/' . $postID . '/comments/default/' . $commentID; 
-        $this->gdClient->delete($uri); 
+        $uri = 'http://www.blogger.com/feeds/' . $this->blogID . '/' . $postID . '/comments/default/' . $commentID;
+        $this->gdClient->delete($uri);
     }
 
-    /** 
+    /**
      * This function deletes the specified post.
      *
      * @param  string $postID The ID of the post to delete.
@@ -276,11 +276,11 @@ class SimpleCRUD
      */
     public function deletePost($postID)
     {
-        $uri = 'http://www.blogger.com/feeds/' . $this->blogID . '/posts/default/' . $postID; 
-        $this->gdClient->delete($uri);  
+        $uri = 'http://www.blogger.com/feeds/' . $this->blogID . '/posts/default/' . $postID;
+        $this->gdClient->delete($uri);
     }
 
-    /** 
+    /**
      * Helper function to print out the titles of all supplied Blogger
      * feeds.
      *
@@ -290,13 +290,13 @@ class SimpleCRUD
     public function printFeed($feed)
     {
         $i = 0;
-        foreach($feed->entries as $entry) 
+        foreach($feed->entries as $entry)
         {
             echo "\t" . $i ." ". $entry->title->text . "\n";
             $i++;
         }
     }
-   
+
     /**
      * Runs the sample.
      *
@@ -308,35 +308,35 @@ class SimpleCRUD
              "stored in the account provided.  Please exit now if you provided " .
              "an account which contains important data.\n\n";
         $this->promptForBlogID();
-        
+
         echo "Creating a post.\n";
         $this->createPost('Hello, world!', 'I am on the intarweb!', False);
-        
-        echo "Creating a draft post.\n"; 
-        $postID = $this->createPost('Salutations, world!', 'Does not sound right.. must work on title.', True); 
-        
+
+        echo "Creating a draft post.\n";
+        $postID = $this->createPost('Salutations, world!', 'Does not sound right.. must work on title.', True);
+
         echo "Updating the previous post and publishing it.\n";
         $updatedPost = $this->updatePost($postID, 'Hello, world, it is.', 'There we go.', False);
         echo "The new title of the post is: " . $updatedPost->title->text . "\n";
-        echo "The new body of the post is: " . $updatedPost->content->text . "\n";        
+        echo "The new body of the post is: " . $updatedPost->content->text . "\n";
 
-        echo "Adding a comment to the previous post.\n"; 
+        echo "Adding a comment to the previous post.\n";
         $this->createComment($postID, 'I am so glad this is public now.');
 
-        echo "Adding another comment.\n";  
-        $commentID = $this->createComment($postID, 'This is a spammy comment.'); 
+        echo "Adding another comment.\n";
+        $commentID = $this->createComment($postID, 'This is a spammy comment.');
 
-        echo "Deleting the previous comment.\n"; 
+        echo "Deleting the previous comment.\n";
         $this->deleteComment($postID, $commentID);
 
         echo "Printing all posts.\n";
         $this->printAllPosts();
 
-        echo "Printing posts between 2007-01-01 and 2007-03-01.\n"; 
+        echo "Printing posts between 2007-01-01 and 2007-03-01.\n";
         $this->printPostsInDateRange('2007-01-01','2007-06-30');
- 
+
         echo "Deleting the post titled: " . $updatedPost->title->text . "\n";
-        $this->deletePost($postID); 
+        $this->deletePost($postID);
     }
 }
 
@@ -344,7 +344,7 @@ class SimpleCRUD
  * Gets credentials from user.
  *
  * @param  string $text
- * @return string Index of the blog the user has chosen. 
+ * @return string Index of the blog the user has chosen.
  */
 function getInput($text)
 {
@@ -369,5 +369,5 @@ if (($user == null) || ($pass == null)) {
     exit("php Blogger.php --user=[username] --pass=[password]\n");
 }
 
-$sample = new SimpleCRUD($user, $pass); 
+$sample = new SimpleCRUD($user, $pass);
 $sample->run();

+ 2 - 2
demos/Zend/Gdata/BooksBrowser/index.php

@@ -115,7 +115,7 @@ if ($queryType === null) {
 } else {
     $books = new Zend_Gdata_Books();
     $query = $books->newVolumeQuery();
-    
+
     /* display a list of volumes */
     if (isset($_GET['searchTerm'])) {
         $searchTerm = $_GET['searchTerm'];
@@ -133,7 +133,7 @@ if ($queryType === null) {
         $minViewability = $_GET['minViewability'];
         $query->setMinViewability($minViewability);
     }
-    
+
     /* check for one of the restricted feeds, or list from 'all' videos */
     switch ($queryType) {
     case 'full_view':

+ 94 - 94
demos/Zend/Gdata/Calendar.php

@@ -20,9 +20,9 @@
  */
 
 /**
- * PHP sample code for the Google Calendar data API.  Utilizes the 
+ * PHP sample code for the Google Calendar data API.  Utilizes the
  * Zend Framework Gdata components to communicate with the Google API.
- * 
+ *
  * Requires the Zend Framework Gdata components and PHP >= 5.1.4
  *
  * You can run this sample both from the command line (CLI) and also
@@ -37,7 +37,7 @@
  *     http://www.php.net/features.commandline
  *
  * NOTE: You must ensure that the Zend Framework is in your PHP include
- * path.  You can do this via php.ini settings, or by modifying the 
+ * path.  You can do this via php.ini settings, or by modifying the
  * argument to set_include_path in the code below.
  *
  * NOTE: As this is sample code, not all of the functions do full error
@@ -87,7 +87,7 @@ $_authSubKeyFilePassphrase = null;
 
 /**
  * Returns the full URL of the current page, based upon env variables
- * 
+ *
  * Env variables used:
  * $_SERVER['HTTPS'] = (on|off|)
  * $_SERVER['HTTP_HOST'] = value of the Host: header
@@ -96,7 +96,7 @@ $_authSubKeyFilePassphrase = null;
  *
  * @return string Current URL
  */
-function getCurrentUrl() 
+function getCurrentUrl()
 {
   global $_SERVER;
 
@@ -122,7 +122,7 @@ function getCurrentUrl()
 }
 
 /**
- * Returns the AuthSub URL which the user must visit to authenticate requests 
+ * Returns the AuthSub URL which the user must visit to authenticate requests
  * from this application.
  *
  * Uses getCurrentUrl() to get the next URL which the user will be redirected
@@ -130,7 +130,7 @@ function getCurrentUrl()
  *
  * @return string AuthSub URL
  */
-function getAuthSubUrl() 
+function getAuthSubUrl()
 {
   global $_authSubKeyFile;
   $next = getCurrentUrl();
@@ -141,22 +141,22 @@ function getAuthSubUrl()
   } else {
     $secure = false;
   }
-  return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, 
+  return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure,
       $session);
 }
 
 /**
  * Outputs a request to the user to login to their Google account, including
  * a link to the AuthSub URL.
- * 
+ *
  * Uses getAuthSubUrl() to get the URL which the user must visit to authenticate
  *
  * @return void
  */
-function requestUserLogin($linkText) 
+function requestUserLogin($linkText)
 {
   $authSubUrl = getAuthSubUrl();
-  echo "<a href=\"{$authSubUrl}\">{$linkText}</a>"; 
+  echo "<a href=\"{$authSubUrl}\">{$linkText}</a>";
 }
 
 /**
@@ -164,13 +164,13 @@ function requestUserLogin($linkText)
  * with Google using AuthSub authentication.
  *
  * Uses the $_SESSION['sessionToken'] to store the AuthSub session token after
- * it is obtained.  The single use token supplied in the URL when redirected 
- * after the user succesfully authenticated to Google is retrieved from the 
+ * it is obtained.  The single use token supplied in the URL when redirected
+ * after the user succesfully authenticated to Google is retrieved from the
  * $_GET['token'] variable.
  *
  * @return Zend_Http_Client
  */
-function getAuthSubHttpClient() 
+function getAuthSubHttpClient()
 {
   global $_SESSION, $_GET, $_authSubKeyFile, $_authSubKeyFilePassphrase;
   $client = new Zend_Gdata_HttpClient();
@@ -179,21 +179,21 @@ function getAuthSubHttpClient()
     $client->setAuthSubPrivateKeyFile($_authSubKeyFile, $_authSubKeyFilePassphrase, true);
   }
   if (!isset($_SESSION['sessionToken']) && isset($_GET['token'])) {
-    $_SESSION['sessionToken'] = 
+    $_SESSION['sessionToken'] =
         Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token'], $client);
-  } 
+  }
   $client->setAuthSubToken($_SESSION['sessionToken']);
   return $client;
 }
 
 /**
  * Processes loading of this sample code through a web browser.  Uses AuthSub
- * authentication and outputs a list of a user's calendars if succesfully 
+ * authentication and outputs a list of a user's calendars if succesfully
  * authenticated.
  *
  * @return void
  */
-function processPageLoad() 
+function processPageLoad()
 {
   global $_SESSION, $_GET;
   if (!isset($_SESSION['sessionToken']) && !isset($_GET['token'])) {
@@ -212,7 +212,7 @@ function processPageLoad()
  * @param  string $pass The password for the user specified
  * @return Zend_Http_Client
  */
-function getClientLoginHttpClient($user, $pass) 
+function getClientLoginHttpClient($user, $pass)
 {
   $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
 
@@ -230,7 +230,7 @@ function getClientLoginHttpClient($user, $pass)
  * @param  string $magicCookie The magic cookie token
  * @return void
  */
-function outputCalendarMagicCookie($user, $magicCookie) 
+function outputCalendarMagicCookie($user, $magicCookie)
 {
   $gdataCal = new Zend_Gdata_Calendar();
   $query = $gdataCal->newEventQuery();
@@ -246,14 +246,14 @@ function outputCalendarMagicCookie($user, $magicCookie)
   echo "</ul>\n";
 }
 
-/** 
+/**
  * Outputs an HTML unordered list (ul), with each list item representing a
- * calendar in the authenticated user's calendar list.  
+ * calendar in the authenticated user's calendar list.
  *
  * @param  Zend_Http_Client $client The authenticated client object
  * @return void
  */
-function outputCalendarList($client) 
+function outputCalendarList($client)
 {
   $gdataCal = new Zend_Gdata_Calendar($client);
   $calFeed = $gdataCal->getCalendarListFeed();
@@ -263,7 +263,7 @@ function outputCalendarList($client)
     echo "\t<li>" . $calendar->title->text . "</li>\n";
   }
   echo "</ul>\n";
-} 
+}
 
 /**
  * Outputs an HTML unordered list (ul), with each list item representing an
@@ -274,7 +274,7 @@ function outputCalendarList($client)
  * @param  Zend_Http_Client $client The authenticated client object
  * @return void
  */
-function outputCalendar($client) 
+function outputCalendar($client)
 {
   $gdataCal = new Zend_Gdata_Calendar($client);
   $query = $gdataCal->newEventQuery();
@@ -304,9 +304,9 @@ function outputCalendar($client)
 
 /**
  * Outputs an HTML unordered list (ul), with each list item representing an
- * event on the authenticated user's calendar which occurs during the 
+ * event on the authenticated user's calendar which occurs during the
  * specified date range.
- * 
+ *
  * To query for all events occurring on 2006-12-24, you would query for
  * a startDate of '2006-12-24' and an endDate of '2006-12-25' as the upper
  * bound for date queries is exclusive.  See the 'query parameters reference':
@@ -317,8 +317,8 @@ function outputCalendar($client)
  * @param  string           $endDate   The end date in YYYY-MM-DD format
  * @return void
  */
-function outputCalendarByDateRange($client, $startDate='2007-05-01', 
-                                   $endDate='2007-08-01') 
+function outputCalendarByDateRange($client, $startDate='2007-05-01',
+                                   $endDate='2007-08-01')
 {
   $gdataCal = new Zend_Gdata_Calendar($client);
   $query = $gdataCal->newEventQuery();
@@ -346,12 +346,12 @@ function outputCalendarByDateRange($client, $startDate='2007-05-01',
  * Outputs an HTML unordered list (ul), with each list item representing an
  * event on the authenticated user's calendar which matches the search string
  * specified as the $fullTextQuery parameter
- * 
+ *
  * @param  Zend_Http_Client $client        The authenticated client object
  * @param  string           $fullTextQuery The string for which you are searching
  * @return void
  */
-function outputCalendarByFullTextQuery($client, $fullTextQuery='tennis') 
+function outputCalendarByFullTextQuery($client, $fullTextQuery='tennis')
 {
   $gdataCal = new Zend_Gdata_Calendar($client);
   $query = $gdataCal->newEventQuery();
@@ -388,9 +388,9 @@ function outputCalendarByFullTextQuery($client, $fullTextQuery='tennis')
  * @param  string           $tzOffset  The offset from GMT/UTC in [+-]DD format (eg -08)
  * @return string The ID URL for the event.
  */
-function createEvent ($client, $title = 'Tennis with Beth', 
-    $desc='Meet for a quick lesson', $where = 'On the courts', 
-    $startDate = '2008-01-20', $startTime = '10:00', 
+function createEvent ($client, $title = 'Tennis with Beth',
+    $desc='Meet for a quick lesson', $where = 'On the courts',
+    $startDate = '2008-01-20', $startTime = '10:00',
     $endDate = '2008-01-20', $endTime = '11:00', $tzOffset = '-08')
 {
   $gc = new Zend_Gdata_Calendar($client);
@@ -411,7 +411,7 @@ function createEvent ($client, $title = 'Tennis with Beth',
 }
 
 /**
- * Creates an event on the authenticated user's default calendar using 
+ * Creates an event on the authenticated user's default calendar using
  * the specified QuickAdd string.
  *
  * @param  Zend_Http_Client $client       The authenticated client object
@@ -429,8 +429,8 @@ function createQuickAddEvent ($client, $quickAddText) {
 }
 
 /**
- * Creates a new web content event on the authenticated user's default 
- * calendar with the specified event details. For simplicity, the event 
+ * Creates a new web content event on the authenticated user's default
+ * calendar with the specified event details. For simplicity, the event
  * is created as an all day event and does not include a description.
  *
  * @param  Zend_Http_Client $client    The authenticated client object
@@ -444,8 +444,8 @@ function createQuickAddEvent ($client, $quickAddText) {
  * @param  string           $type      The MIME type of the web content.
  * @return string The ID URL for the event.
  */
-function createWebContentEvent ($client, $title = 'World Cup 2006', 
-    $startDate = '2006-06-09', $endDate = '2006-06-09', 
+function createWebContentEvent ($client, $title = 'World Cup 2006',
+    $startDate = '2006-06-09', $endDate = '2006-06-09',
     $icon = 'http://www.google.com/calendar/images/google-holiday.gif',
     $url = 'http://www.google.com/logos/worldcup06.gif',
     $height  = '120', $width = '276', $type = 'image/gif'
@@ -459,7 +459,7 @@ function createWebContentEvent ($client, $title = 'World Cup 2006',
   $when->startTime = $startDate;
   $when->endTime = $endDate;
   $newEntry->when = array($when);
-  
+
   $wc = $gc->newWebContent();
   $wc->url = $url;
   $wc->height = $height;
@@ -470,7 +470,7 @@ function createWebContentEvent ($client, $title = 'World Cup 2006',
   $wcLink->title = $title;
   $wcLink->type = $type;
   $wcLink->href = $icon;
-  
+
   $wcLink->webContent = $wc;
   $newEntry->link = array($wcLink);
 
@@ -480,7 +480,7 @@ function createWebContentEvent ($client, $title = 'World Cup 2006',
 
 /**
  * Creates a recurring event on the authenticated user's default calendar with
- * the specified event details.  
+ * the specified event details.
  *
  * @param  Zend_Http_Client $client    The authenticated client object
  * @param  string           $title     The event title
@@ -489,8 +489,8 @@ function createWebContentEvent ($client, $title = 'World Cup 2006',
  * @param  string           $recurData The iCalendar recurring event syntax (RFC2445)
  * @return void
  */
-function createRecurringEvent ($client, $title = 'Tennis with Beth', 
-    $desc='Meet for a quick lesson', $where = 'On the courts', 
+function createRecurringEvent ($client, $title = 'Tennis with Beth',
+    $desc='Meet for a quick lesson', $where = 'On the courts',
     $recurData = null)
 {
   $gc = new Zend_Gdata_Calendar($client);
@@ -524,7 +524,7 @@ function createRecurringEvent ($client, $title = 'Tennis with Beth',
  * @param  string           $eventId The event ID string
  * @return Zend_Gdata_Calendar_EventEntry|null if the event is found, null if it's not
  */
-function getEvent($client, $eventId) 
+function getEvent($client, $eventId)
 {
   $gdataCal = new Zend_Gdata_Calendar($client);
   $query = $gdataCal->newEventQuery();
@@ -549,10 +549,10 @@ function getEvent($client, $eventId)
  *
  * @param  Zend_Http_Client $client   The authenticated client object
  * @param  string           $eventId  The event ID string
- * @param  string           $newTitle The new title to set on this event 
+ * @param  string           $newTitle The new title to set on this event
  * @return Zend_Gdata_Calendar_EventEntry|null The updated entry
  */
-function updateEvent ($client, $eventId, $newTitle) 
+function updateEvent ($client, $eventId, $newTitle)
 {
   $gdataCal = new Zend_Gdata_Calendar($client);
   if ($eventOld = getEvent($client, $eventId)) {
@@ -584,8 +584,8 @@ function updateEvent ($client, $eventId, $newTitle)
  * @param  string           $value   The value of the extended property
  * @return Zend_Gdata_Calendar_EventEntry|null The updated entry
  */
-function addExtendedProperty ($client, $eventId, 
-    $name='http://www.example.com/schemas/2005#mycal.id', $value='1234') 
+function addExtendedProperty ($client, $eventId,
+    $name='http://www.example.com/schemas/2005#mycal.id', $value='1234')
 {
   $gc = new Zend_Gdata_Calendar($client);
   if ($event = getEvent($client, $eventId)) {
@@ -597,7 +597,7 @@ function addExtendedProperty ($client, $eventId,
   } else {
     return null;
   }
-} 
+}
 
 
 /**
@@ -637,7 +637,7 @@ function setReminder($client, $eventId, $minutes=15)
  * @param  string           $eventId The event ID string
  * @return void
  */
-function deleteEventById ($client, $eventId) 
+function deleteEventById ($client, $eventId)
 {
   $event = getEvent($client, $eventId);
   $event->delete();
@@ -649,10 +649,10 @@ function deleteEventById ($client, $eventId)
  * http://www.google.com/calendar/feeds/default/private/full/<eventId>
  *
  * @param  Zend_Http_Client $client The authenticated client object
- * @param  string           $url    The url for the event to be deleted 
+ * @param  string           $url    The url for the event to be deleted
  * @return void
  */
-function deleteEventByUrl ($client, $url) 
+function deleteEventByUrl ($client, $url)
 {
   $gdataCal = new Zend_Gdata_Calendar($client);
   $gdataCal->delete($url);
@@ -662,7 +662,7 @@ function deleteEventByUrl ($client, $url)
  * Main logic for running this sample code via the command line or,
  * for AuthSub functionality only, via a web browser.  The output of
  * many of the functions is in HTML format for demonstration purposes,
- * so you may wish to pipe the output to Tidy when running from the 
+ * so you may wish to pipe the output to Tidy when running from the
  * command-line for clearer results.
  *
  * Run without any arguments to get usage information
@@ -670,7 +670,7 @@ function deleteEventByUrl ($client, $url)
 if (isset($argc) && $argc >= 2) {
   switch ($argv[1]) {
     case 'outputCalendar':
-      if ($argc == 4) { 
+      if ($argc == 4) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
         outputCalendar($client);
       } else {
@@ -679,8 +679,8 @@ if (isset($argc) && $argc >= 2) {
       }
       break;
     case 'outputCalendarMagicCookie':
-      if ($argc == 4) { 
-        outputCalendarMagicCookie($argv[2], $argv[3]); 
+      if ($argc == 4) {
+        outputCalendarMagicCookie($argv[2], $argv[3]);
       } else {
         echo "Usage: php {$argv[0]} {$argv[1]} " .
              "<username> <magicCookie>\n";
@@ -691,7 +691,7 @@ if (isset($argc) && $argc >= 2) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
         outputCalendarByDateRange($client, $argv[4], $argv[5]);
       } else {
-        echo "Usage: php {$argv[0]} {$argv[1]} " . 
+        echo "Usage: php {$argv[0]} {$argv[1]} " .
              "<username> <password> <startDate> <endDate>\n";
       }
       break;
@@ -700,12 +700,12 @@ if (isset($argc) && $argc >= 2) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
         outputCalendarByFullTextQuery($client, $argv[4]);
       } else {
-        echo "Usage: php {$argv[0]} {$argv[1]} " . 
+        echo "Usage: php {$argv[0]} {$argv[1]} " .
              "<username> <password> <fullTextQuery>\n";
       }
       break;
     case 'outputCalendarList':
-      if ($argc == 4) { 
+      if ($argc == 4) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
         outputCalendarList($client);
       } else {
@@ -714,115 +714,115 @@ if (isset($argc) && $argc >= 2) {
       }
       break;
     case 'updateEvent':
-      if ($argc == 6) { 
+      if ($argc == 6) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
-        updateEvent($client, $argv[4], $argv[5]); 
+        updateEvent($client, $argv[4], $argv[5]);
       } else {
-        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " . 
+        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " .
              "<eventId> <newTitle>\n";
       }
       break;
     case 'setReminder':
-      if ($argc == 6) { 
+      if ($argc == 6) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
-        setReminder($client, $argv[4], $argv[5]); 
+        setReminder($client, $argv[4], $argv[5]);
       } else {
-        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " . 
+        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " .
              "<eventId> <minutes>\n";
       }
       break;
     case 'addExtendedProperty':
-      if ($argc == 7) { 
+      if ($argc == 7) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
         addExtendedProperty($client, $argv[4], $argv[5], $argv[6]);
       } else {
-        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " . 
+        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " .
              "<eventId> <name> <value>\n";
       }
       break;
     case 'deleteEventById':
-      if ($argc == 5) { 
+      if ($argc == 5) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
-        deleteEventById($client, $argv[4]); 
+        deleteEventById($client, $argv[4]);
       } else {
-        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " . 
+        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " .
              "<eventId>\n";
       }
       break;
     case 'deleteEventByUrl':
-      if ($argc == 5) { 
+      if ($argc == 5) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
-        deleteEventByUrl($client, $argv[4]); 
+        deleteEventByUrl($client, $argv[4]);
       } else {
-        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " . 
+        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " .
              "<eventUrl>\n";
       }
       break;
     case 'createEvent':
-      if ($argc == 12) { 
+      if ($argc == 12) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
-        $id = createEvent($client, $argv[4], $argv[5], $argv[6], $argv[7], 
+        $id = createEvent($client, $argv[4], $argv[5], $argv[6], $argv[7],
             $argv[8], $argv[9], $argv[10], $argv[11]);
         print "Event created with ID: $id\n";
       } else {
-        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " . 
+        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " .
              "<title> <description> <where> " .
              "<startDate> <startTime> <endDate> <endTime> <tzOffset>\n";
-        echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <password> " . 
+        echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <password> " .
              "'Tennis with Beth' 'Meet for a quick lesson' 'On the courts' " .
              "'2008-01-01' '10:00' '2008-01-01' '11:00' '-08'\n";
       }
       break;
     case 'createQuickAddEvent':
-      if ($argc == 5) { 
+      if ($argc == 5) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
         $id = createQuickAddEvent($client, $argv[4]);
         print "Event created with ID: $id\n";
       } else {
-        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " . 
+        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " .
              "<quickAddText>\n";
-        echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <password> " . 
+        echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <password> " .
              "'Dinner at the beach on Thursday 8 PM'\n";
       }
       break;
     case 'createWebContentEvent':
-        if ($argc == 12) { 
+        if ($argc == 12) {
           $client = getClientLoginHttpClient($argv[2], $argv[3]);
-          $id = createWebContentEvent($client, $argv[4], $argv[5], $argv[6], 
+          $id = createWebContentEvent($client, $argv[4], $argv[5], $argv[6],
               $argv[7], $argv[8], $argv[9], $argv[10], $argv[11]);
           print "Event created with ID: $id\n";
         } else {
-          echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " . 
+          echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " .
                "<title> <startDate> <endDate> <icon> <url> <height> <width> <type>\n\n";
           echo "This creates a web content event on 2007/06/09.\n";
-          echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <password> " . 
-               "'World Cup 2006' '2007-06-09' '2007-06-10' " . 
-               "'http://www.google.com/calendar/images/google-holiday.gif' " . 
-               "'http://www.google.com/logos/worldcup06.gif' " . 
+          echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <password> " .
+               "'World Cup 2006' '2007-06-09' '2007-06-10' " .
+               "'http://www.google.com/calendar/images/google-holiday.gif' " .
+               "'http://www.google.com/logos/worldcup06.gif' " .
                "'120' '276' 'image/gif'\n";
         }
         break;
     case 'createRecurringEvent':
-      if ($argc == 7) { 
+      if ($argc == 7) {
         $client = getClientLoginHttpClient($argv[2], $argv[3]);
         createRecurringEvent($client, $argv[4], $argv[5], $argv[6]);
       } else {
-        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " . 
+        echo "Usage: php {$argv[0]} {$argv[1]} <username> <password> " .
              "<title> <description> <where>\n\n";
         echo "This creates an all-day event which occurs first on 2007/05/01" .
              "and repeats weekly on Tuesdays until 2007/09/04\n";
-        echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <password> " . 
+        echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <password> " .
              "'Tennis with Beth' 'Meet for a quick lesson' 'On the courts'\n";
       }
       break;
-  } 
+  }
 } else if (!isset($_SERVER["HTTP_HOST"]))  {
   // running from command line, but action left unspecified
   echo "Usage: php {$argv[0]} <action> [<username>] [<password>] " .
       "[<arg1> <arg2> ...]\n\n";
   echo "Possible action values include:\n" .
-       "outputCalendar\n" . 
-       "outputCalendarMagicCookie\n" . 
+       "outputCalendar\n" .
+       "outputCalendarMagicCookie\n" .
        "outputCalendarByDateRange\n" .
        "outputCalendarByFullTextQuery\n" .
        "outputCalendarList\n" .

+ 28 - 28
demos/Zend/Gdata/Docs.php

@@ -20,9 +20,9 @@
  */
 
 /**
- * PHP sample code for the Google Documents List data API.  Utilizes the 
+ * PHP sample code for the Google Documents List data API.  Utilizes the
  * Zend Framework Gdata components to communicate with the Google API.
- * 
+ *
  * Requires the Zend Framework Gdata components and PHP >= 5.1.4
  *
  * You can run this sample both from the command line (CLI) and also
@@ -37,11 +37,11 @@
  *     http://www.php.net/features.commandline
  *
  * NOTE: You must ensure that Zend Framework is in your PHP include
- * path.  You can do this via php.ini settings, or by modifying the 
+ * path.  You can do this via php.ini settings, or by modifying the
  * argument to set_include_path in the code below.
  *
  * NOTE: As this is sample code, not all of the functions do full error
- * handling.  
+ * handling.
  */
 
 /**
@@ -166,8 +166,8 @@ function runCLIVersion($argv, $argc)
                 break;
             case 'fullTextSearch':
                 if ($argc >= 4) {
-                    // Combine all of the query args into one query string. 
-                    // The command line split the query string on space 
+                    // Combine all of the query args into one query string.
+                    // The command line split the query string on space
                     // characters.
                     $queryString = implode(' ', array_slice($argv, 4));
                     fullTextSearch($docs, false, $queryString);
@@ -180,7 +180,7 @@ function runCLIVersion($argv, $argc)
                 break;
             case 'uploadDocument':
                 if ($argc >= 5) {
-                    // Pass in the file name of the document to be uploaded. 
+                    // Pass in the file name of the document to be uploaded.
                     // Since the document is on this machine, we  do not need
                     // to set the temporary file name. The temp file name is
                     // used only when uploading to a webserver.
@@ -205,8 +205,8 @@ function runCLIVersion($argv, $argc)
     }
 }
 
-/** 
- * Displays the titles for the Google Documents entries in the feed. In HTML 
+/**
+ * Displays the titles for the Google Documents entries in the feed. In HTML
  * mode, the titles are links which point to the HTML version of the document.
  *
  * @param  Zend_Gdata_Docs_DocumentListFeed $feed
@@ -214,14 +214,14 @@ function runCLIVersion($argv, $argc)
  *                                          a web browser
  * @return void
  */
-function printDocumentsFeed($feed, $html) 
+function printDocumentsFeed($feed, $html)
 {
   if ($html) {echo "<ul>\n";}
 
   // Iterate over the document entries in the feed and display each document's
   // title.
   foreach ($feed->entries as $entry) {
-  
+
     if ($html) {
         // Find the URL of the HTML view of the document.
         $alternateLink = '';
@@ -243,7 +243,7 @@ function printDocumentsFeed($feed, $html)
 }
 
 /**
- * Obtain a list of all of a user's docs.google.com documents and print the 
+ * Obtain a list of all of a user's docs.google.com documents and print the
  * titles to the command line.
  *
  * @param  Zend_Gdata_Docs $client The service object to use for communicating with the Google
@@ -251,7 +251,7 @@ function printDocumentsFeed($feed, $html)
  * @param  boolean         $html   True if output should be formatted for display in a web browser.
  * @return void
  */
-function retrieveAllDocuments($client, $html) 
+function retrieveAllDocuments($client, $html)
 {
   if ($html) {echo "<h2>Your documents</h2>\n";}
 
@@ -261,7 +261,7 @@ function retrieveAllDocuments($client, $html)
 }
 
 /**
- * Obtain a list of all of a user's docs.google.com word processing 
+ * Obtain a list of all of a user's docs.google.com word processing
  * documents and print the titles to the command line.
  *
  * @param  Zend_Gdata_Docs $client The service object to use for communicating with the Google
@@ -269,7 +269,7 @@ function retrieveAllDocuments($client, $html)
  * @param  boolean         $html   True if output should be formatted for display in a web browser.
  * @return void
  */
-function retrieveWPDocs($client, $html) 
+function retrieveWPDocs($client, $html)
 {
   if ($html) {echo "<h2>Your word processing documents</h2>\n";}
 
@@ -280,7 +280,7 @@ function retrieveWPDocs($client, $html)
 }
 
 /**
- * Obtain a list of all of a user's docs.google.com spreadsheets 
+ * Obtain a list of all of a user's docs.google.com spreadsheets
  * documents and print the titles to the command line.
  *
  * @param  Zend_Gdata_Docs $client The service object to use for communicating with the Google
@@ -288,10 +288,10 @@ function retrieveWPDocs($client, $html)
  * @param  boolean         $html   True if output should be formatted for display in a web browser.
  * @return void
  */
-function retrieveSpreadsheets($client, $html) 
+function retrieveSpreadsheets($client, $html)
 {
   if ($html) {echo "<h2>Your spreadsheets</h2>\n";}
- 
+
   $feed = $client->getDocumentListFeed(
       'http://docs.google.com/feeds/documents/private/full/-/spreadsheet');
 
@@ -299,8 +299,8 @@ function retrieveSpreadsheets($client, $html)
 }
 
 /**
- * Obtain a list of all of a user's docs.google.com documents 
- * which match the specified search criteria and print the titles to the 
+ * Obtain a list of all of a user's docs.google.com documents
+ * which match the specified search criteria and print the titles to the
  * command line.
  *
  * @param  Zend_Gdata_Docs $client The service object to use for communicating with the Google
@@ -309,7 +309,7 @@ function retrieveSpreadsheets($client, $html)
  * @param  string          $query  The search query to use
  * @return void
  */
-function fullTextSearch($client, $html, $query) 
+function fullTextSearch($client, $html, $query)
 {
   if ($html) {echo "<h2>Documents containing $query</h2>\n";}
 
@@ -759,18 +759,18 @@ function runWWWVersion()
                     startHTML();
                     fullTextSearch($docs, true, $_REQUEST['query']);
                     endHTML(true);
-                    
+
             }
         }
-    
+
         // Now we handle the potentially destructive commands, which have to
         // be submitted by POST only.
         if (!empty($_POST['command'])) {
             switch ($_POST['command']) {
                 case 'uploadDocument':
                     startHTML();
-                    uploadDocument($docs, true, 
-                        $_FILES['uploadedFile']['name'], 
+                    uploadDocument($docs, true,
+                        $_FILES['uploadedFile']['name'],
                         $_FILES['uploadedFile']['tmp_name']);
                     endHTML(true);
                 case 'modifySubscription':
@@ -789,7 +789,7 @@ function runWWWVersion()
                     }
             }
         }
-    
+
         // Check for an invalid command. If so, display an error and exit.
         if (!empty($_REQUEST['command'])) {
             header('HTTP/1.1 400 Bad Request');
@@ -799,7 +799,7 @@ function runWWWVersion()
             endHTML(true);
         }
         // If a menu parameter is available, display a submenu.
-    
+
         if (!empty($_REQUEST['menu'])) {
             switch ($_REQUEST['menu']) {
                 case 'list':
@@ -880,7 +880,7 @@ function displayListMenu()
  *
  * @return void
  */
-function displayQueryMenu() 
+function displayQueryMenu()
 {
 ?>
 <h2>Query the Documents List Feed</h2>

文件差異過大導致無法顯示
+ 168 - 168
demos/Zend/Gdata/Gapps.php


+ 130 - 130
demos/Zend/Gdata/Gbase.php

@@ -29,8 +29,8 @@ define('ITEMS_FEED_URI', 'http://www.google.com/base/feeds/items');
 
 /* Types of cuisine the user may select when inserting a recipe. */
 $cuisines = array('African', 'American', 'Asian', 'Caribbean', 'Chinese',
-  'French', 'Greek', 'Indian', 'Italian', 'Japanese', 'Jewish', 
-  'Mediterranean', 'Mexican', 'Middle Eastern', 'Moroccan', 
+  'French', 'Greek', 'Indian', 'Italian', 'Japanese', 'Jewish',
+  'Mediterranean', 'Mexican', 'Middle Eastern', 'Moroccan',
   'North American', 'Spanish', 'Thai', 'Vietnamese', 'Other');
 
 
@@ -38,14 +38,14 @@ $cuisines = array('African', 'American', 'Asian', 'Caribbean', 'Chinese',
  * Inserts a new recipe by performing an HTTP POST to the
  * items feed.
  * @param boolean $dryRun (optional) True if this should be a dry run insert
- * @return Zend_Gdata_Gbase_ItemFeed The newly created entry 
+ * @return Zend_Gdata_Gbase_ItemFeed The newly created entry
  */
-function postItem($dryRun = false) { 
+function postItem($dryRun = false) {
   $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']);
   $gdata = new Zend_Gdata_Gbase($client);
 
   $newEntry = $gdata->newItemEntry();
-  
+
   // Add title
   $newEntry->title = $gdata->newTitle(trim($_POST['recipe_title']));
 
@@ -59,10 +59,10 @@ function postItem($dryRun = false) {
 
   // Add item-specific attributes
   $newEntry->addGbaseAttribute('cuisine', $_POST['cuisine'], 'text');
-  $newEntry->addGbaseAttribute('cooking_time', $_POST['time_val'] . ' ' . 
+  $newEntry->addGbaseAttribute('cooking_time', $_POST['time_val'] . ' ' .
       $_POST['time_units'], 'intUnit');
-  $newEntry->addGbaseAttribute('main_ingredient', 
-                               $_POST['main_ingredient'], 
+  $newEntry->addGbaseAttribute('main_ingredient',
+                               $_POST['main_ingredient'],
                               'text');
   $newEntry->addGbaseAttribute('serving_count', $_POST['serves'], 'number');
 
@@ -77,13 +77,13 @@ function postItem($dryRun = false) {
  * on its feed URI, using the updated values as the data.
  * @return true
  */
-function updateItem() { 
+function updateItem() {
   $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']);
   $gdata = new Zend_Gdata_Gbase($client);
-  
+
   $itemUrl = $_POST['link'];
   $updatedEntry = $gdata->getGbaseItemEntry($itemUrl);
-  
+
   // Update title
   $updatedEntry->title = $gdata->newTitle(trim($_POST['recipe_title']));
 
@@ -96,35 +96,35 @@ function updateItem() {
   if (is_object($baseAttributeArr[0])) {
     $baseAttributeArr[0]->text = $_POST['cuisine'];
   }
-  
+
   $baseAttributeArr = $updatedEntry->getGbaseAttribute('cooking_time');
   if (is_object($baseAttributeArr[0])) {
-    $baseAttributeArr[0]->text = 
+    $baseAttributeArr[0]->text =
         $_POST['time_val'] . ' ' . $_POST['time_units'];
   }
-  
+
   $baseAttributeArr = $updatedEntry->getGbaseAttribute('main_ingredient');
   if (is_object($baseAttributeArr[0])) {
     $baseAttributeArr[0]->text = $_POST['main_ingredient'];
   }
-  
+
   $baseAttributeArr = $updatedEntry->getGbaseAttribute('serving_count');
   if (is_object($baseAttributeArr[0])) {
     $baseAttributeArr[0]->text = $_POST['serves'];
   }
 
   $dryRun = false;
-  $gdata->updateGbaseItem($updatedEntry, $dryRun); 
-  
+  $gdata->updateGbaseItem($updatedEntry, $dryRun);
+
   // Alternatively, you can call the save() method directly on the entry
   // $updatedEntry->save();
-  
+
   return true;
 }
 
 /**
  * Deletes a recipe by performing an HTTP DELETE on its feed URI.
- * @return void 
+ * @return void
  */
 function deleteItem() {
   $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']);
@@ -132,33 +132,33 @@ function deleteItem() {
 
   $itemUrl = $_POST['link'];
   $deleteEntry = $gdata->getGbaseItemEntry($itemUrl);
-  
+
   $dryRun = false;
   $gdata->deleteGbaseItem($deleteEntry, $dryRun);
-  
+
   // Alternatively, you can call the save() method directly on the entry
   // $gdata->delete($itemUrl);
 }
 
 /**
  * Creates the XML content used to perform a batch delete.
- * @return string The constructed XML to be used for the batch delete 
+ * @return string The constructed XML to be used for the batch delete
  */
 function buildBatchXML() {
-  $result =  '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . 
-             '<feed xmlns="http://www.w3.org/2005/Atom"' . "\n" . 
-             ' xmlns:g="http://base.google.com/ns/1.0"' . "\n" . 
+  $result =  '<?xml version="1.0" encoding="UTF-8"?>' . "\n" .
+             '<feed xmlns="http://www.w3.org/2005/Atom"' . "\n" .
+             ' xmlns:g="http://base.google.com/ns/1.0"' . "\n" .
              ' xmlns:batch="http://schemas.google.com/gdata/batch">' . "\n";
-  
+
   $counter = 0;
   foreach($_POST as $key => $value) {
     if(substr($key, 0, 5) == "link_") {
       $counter++;
 
-      $result .= '<entry>' . "\n" . 
-                 '<id>' . $value . '</id>' . "\n" . 
-                 '<batch:operation type="delete"/>' . "\n" . 
-                 '<batch:id>' . $counter . '</batch:id>' . "\n" . 
+      $result .= '<entry>' . "\n" .
+                 '<id>' . $value . '</id>' . "\n" .
+                 '<batch:operation type="delete"/>' . "\n" .
+                 '<batch:id>' . $counter . '</batch:id>' . "\n" .
                  '</entry>' . "\n";
     }
   }
@@ -170,14 +170,14 @@ function buildBatchXML() {
 /**
  * Deletes all recipes by performing an HTTP POST to the
  * batch URI.
- * @return Zend_Http_Response The reponse of the post 
+ * @return Zend_Http_Response The reponse of the post
  */
 function batchDelete() {
   $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']);
   $gdata = new Zend_Gdata_Gbase($client);
-  
+
   $response = $gdata->post(buildBatchXML(), ITEMS_FEED_URI . '/batch');
-  
+
   return $response;
 }
 
@@ -191,15 +191,15 @@ function batchDelete() {
  */
 function printHTMLHeader()
 {
-  print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' . "\n" . 
-        '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n" . 
-        '<html xmlns="http://www.w3.org/1999/xhtml" lang="en">' . "\n" . 
-        '<head><meta http-equiv="Content-Type" ' . 
-        'content="text/html;charset=utf-8"/>' . "\n" . 
-        '<title>PHP Demo: Google Base API</title>' . "\n" . 
-        '<link rel="stylesheet" type="text/css" ' . 
-        'href="http://code.google.com/css/dev_docs.css">' . "\n" . 
-        '</head>' . "\n" . 
+  print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' . "\n" .
+        '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n" .
+        '<html xmlns="http://www.w3.org/1999/xhtml" lang="en">' . "\n" .
+        '<head><meta http-equiv="Content-Type" ' .
+        'content="text/html;charset=utf-8"/>' . "\n" .
+        '<title>PHP Demo: Google Base API</title>' . "\n" .
+        '<link rel="stylesheet" type="text/css" ' .
+        'href="http://code.google.com/css/dev_docs.css">' . "\n" .
+        '</head>' . "\n" .
         '<body><center>' . "\n";
 }
 
@@ -209,7 +209,7 @@ function printHTMLHeader()
  * NOTE: We would normally keep the HTML/CSS markup separate from the business
  *       logic above, but have decided to include it here for simplicity of
  *       having a single-file sample.
- * @return void 
+ * @return void
  */
 function printHTMLFooter() {
   print '</center></body></html>' . "\n";
@@ -224,25 +224,25 @@ function showIntroPage() {
   $scope = ITEMS_FEED_URI;
   $secure = false;
   $session = true;
-  $redirect_url = Zend_Gdata_AuthSub::getAuthSubTokenUri($next_url, 
-                                                         $scope, 
-                                                         $secure, 
+  $redirect_url = Zend_Gdata_AuthSub::getAuthSubTokenUri($next_url,
+                                                         $scope,
+                                                         $secure,
                                                          $session);
 
   printHTMLHeader();
-  
-  print '<table style="width:50%;">' . "\n" . 
-        '<tr>' . "\n" .  
-        '<th colspan="2" style="text-align:center;">' . 
-        'PHP Demo: Google Base data API<br/>' . 
-        '<small><span style="font-variant: small-caps;">Powered By</span>' . 
-        ' <a href="http://framework.zend.com/download/gdata">' . 
-        'Zend Google Data Client Library</a></small></th>' . "\n" . 
-        '</tr>' . "\n" . 
-        '<tr><td>Before you get started, please <a href="' . $redirect_url . 
-        '">sign in</a> to your personal Google Base account.</td></tr>' . "\n" . 
+
+  print '<table style="width:50%;">' . "\n" .
+        '<tr>' . "\n" .
+        '<th colspan="2" style="text-align:center;">' .
+        'PHP Demo: Google Base data API<br/>' .
+        '<small><span style="font-variant: small-caps;">Powered By</span>' .
+        ' <a href="http://framework.zend.com/download/gdata">' .
+        'Zend Google Data Client Library</a></small></th>' . "\n" .
+        '</tr>' . "\n" .
+        '<tr><td>Before you get started, please <a href="' . $redirect_url .
+        '">sign in</a> to your personal Google Base account.</td></tr>' . "\n" .
         '</table>' . "\n";
-  
+
   printHTMLFooter();
 }
 
@@ -250,51 +250,51 @@ function showIntroPage() {
  * Prints the table of recipes the user has already entered
  * on the left-hand side of the page.
  * @param string $token The session token
- * @return void 
+ * @return void
  */
 function showRecipeListPane($token) {
   $client = Zend_Gdata_AuthSub::getHttpClient($token);
   $gdata = new Zend_Gdata_Gbase($client);
   try {
     $feed = $gdata->getGbaseItemFeed(ITEMS_FEED_URI . '/-/testrecipes');
-   
+
     print '<td style="width:50%;text-align:center;vertical-align:top">' . "\n" .
-          '<a href="http://www.google.com/base/dashboard" target="_blank">' . 
-          'View all of your published items</a>' . 
-          '<table>' . "\n" . 
-          '<tr><th colspan="5" style="text-align:center">' . 
+          '<a href="http://www.google.com/base/dashboard" target="_blank">' .
+          'View all of your published items</a>' .
+          '<table>' . "\n" .
+          '<tr><th colspan="5" style="text-align:center">' .
           'Recipes you have added that searchable via the API</th></tr>' . "\n";
-    
+
     if ($feed->count() == 0) {
-      print '<tr style="font-style:italic">' . 
-            '<td colspan="5" style="text-align:center">(none)</td>' . 
+      print '<tr style="font-style:italic">' .
+            '<td colspan="5" style="text-align:center">(none)</td>' .
             '</tr>' . "\n";
     } else {
-      print '<tr style="font-style:italic">' . "\n" . 
-            '<td style="text-align:center">Name</td>' . "\n" . 
-            '<td style="text-align:center">Cuisine</td>' . "\n" . 
-            '<td style="text-align:center">Serves</td>' . "\n" . 
-            '<td colspan="2" style="text-align:center">Actions</td>' . "\n" . 
+      print '<tr style="font-style:italic">' . "\n" .
+            '<td style="text-align:center">Name</td>' . "\n" .
+            '<td style="text-align:center">Cuisine</td>' . "\n" .
+            '<td style="text-align:center">Serves</td>' . "\n" .
+            '<td colspan="2" style="text-align:center">Actions</td>' . "\n" .
             '</tr>' . "\n";
 
-      foreach ($feed->entries as $feed_entry) {    
+      foreach ($feed->entries as $feed_entry) {
         $href = $feed_entry->link[0]->href;
         $title = $feed_entry->title->text;
         $id = $feed_entry->id->text;
-        
+
         $baseAttributeArr = $feed_entry->getGbaseAttribute('cuisine');
         // Only want first cuisine
         if (isset($baseAttributeArr[0]) && is_object($baseAttributeArr[0])) {
           $cuisine = $baseAttributeArr[0]->text;
-        } 
-        
+        }
+
         $baseAttributeArr = $feed_entry->getGbaseAttribute('serving_count');
         // Only want first serving_count
         if (isset($baseAttributeArr[0]) && is_object($baseAttributeArr[0])) {
           $serving_count = $baseAttributeArr[0]->text;
-        } 
+        }
 
-        print '<tr>' . "\n" .      
+        print '<tr>' . "\n" .
               '<td align="left" valign="top"><b><a href="' . $href . '">' .
               $title . '</a></b></td>' . "\n" .
               '<td style="text-align:center;vertical-align:top">' .
@@ -347,7 +347,7 @@ function showRecipeListPane($token) {
     }
     print '></form></td></tr>' . "\n";
     print '</table>' . "\n";
-    
+
     print '</td>' . "\n";
   } catch (Zend_Gdata_App_Exception $e) {
     showMainMenu("Error: " . $e->getMessage(), $token);
@@ -358,14 +358,14 @@ function showRecipeListPane($token) {
  * Prints a small form allowing the user to insert a new
  * recipe.
  * @param string $sessionToken A session token
- * @return void 
+ * @return void
  */
 function showRecipeInsertPane($sessionToken) {
   global $cuisines;
 
   print '<td valign="top" width="50%">' . "\n" .
         '<table width="90%">' . "\n" .
-        '<tr><th colspan="2" style="text-align:center">' . 
+        '<tr><th colspan="2" style="text-align:center">' .
         'Insert a new recipe</th></tr>' . "\n" .
         '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" .
         '<input type="hidden" name="action" value="insert">' . "\n" .
@@ -389,10 +389,10 @@ function showRecipeInsertPane($sessionToken) {
         '<select name="time_units"><option value="minutes">minutes</option>' .
         '<option value="hours">hours</option></select></td></tr>' . "\n" .
         '<tr><td align="right">Serves:</td>' . "\n" .
-        '<td><input type="text" name="serves" size=2 maxlength=3></td>' . 
+        '<td><input type="text" name="serves" size=2 maxlength=3></td>' .
         '</tr>' . "\n" .
         '<tr><td align="right">Recipe:</td>' . "\n" .
-        '<td><textarea class="full" name="recipe_text"></textarea></td>' . 
+        '<td><textarea class="full" name="recipe_text"></textarea></td>' .
         '</tr>' . "\n" .
         '<td>&nbsp;</td><td><input type="submit" value="Submit"></td>' . "\n" .
         '</form></tr></table>' . "\n" .
@@ -402,7 +402,7 @@ function showRecipeInsertPane($sessionToken) {
 /**
  * Shows a menu allowing the user to update an existing
  * recipe with the Base API update feature.
- * @return void  
+ * @return void
  */
 function showEditMenu() {
   global $cuisines;
@@ -414,56 +414,56 @@ function showEditMenu() {
     $feed = $gdata->getGbaseItemFeed(ITEMS_FEED_URI);
     foreach ($feed->entries as $feed_entry) {
       $editLink = $feed_entry->link[2]->href;
-      
+
       if ($editLink == $_POST['edit']) {
         $baseAttributeArr = $feed_entry->getGbaseAttribute('cooking_time');
         if (isset($baseAttributeArr[0]) && is_object($baseAttributeArr[0])) {
           $splitCookingTime = explode(' ', $baseAttributeArr[0]->text);
         }
-        
+
         $baseAttributeArr = $feed_entry->getGbaseAttribute('cuisine');
         // Cuisine can have multiple entries
         if (isset($baseAttributeArr[0]) && is_object($baseAttributeArr[0])) {
           $cuisine = $baseAttributeArr[0]->text;
         }
-        
+
         $baseAttributeArr = $feed_entry->getGbaseAttribute('serving_count');
         // $serving_count can have multiple entries
         if (isset($baseAttributeArr[0]) && is_object($baseAttributeArr[0])) {
           $serving_count = $baseAttributeArr[0]->text;
-        } 
-        
+        }
+
         $main_ingredient = $feed_entry->getGbaseAttribute('main_ingredient');
         // Main_ingredient can have multiple entries
         if (is_array($main_ingredient)) {
           $main_ingredient = $main_ingredient[0]->text;
-        } 
-        
+        }
+
         printHTMLHeader();
 
         print '<table style="width:50%">' . "\n";
-        print '<tr>' . 
-              '<th colspan="2" style="text-align:center">Edit recipe:</th>' . 
+        print '<tr>' .
+              '<th colspan="2" style="text-align:center">Edit recipe:</th>' .
               '</tr>' . "\n";
 
         print "<form method=\"post\" action=\"{$_SERVER['PHP_SELF']}\">\n" .
-              '<input type="hidden" name="action" value="update">' . "\n" . 
+              '<input type="hidden" name="action" value="update">' . "\n" .
               '<input type="hidden" name="link" value="' .
               $_POST['edit'] . '">' . "\n" .
               '<input type="hidden" name="token" value="' .
               $_POST['token'] . '">' . "\n";
 
-        print '<tr><td align="right">Title:</td>' . "\n" . 
-              '<td>' . 
+        print '<tr><td align="right">Title:</td>' . "\n" .
+              '<td>' .
               '<input type="text" name="recipe_title" class="half" value="' .
-              $feed_entry->title->text . '">' . 
+              $feed_entry->title->text . '">' .
               '</td></tr>' . "\n";
 
         print '<tr><td align="right">Main ingredient:</td>' . "\n" .
               '<td><input type="text" name="main_ingredient" value="' .
                $main_ingredient . '" class="half"></td></tr>' . "\n";
 
-        print '<tr><td align="right">Cuisine:</td>' . "\n" . 
+        print '<tr><td align="right">Cuisine:</td>' . "\n" .
               '<td><select name="cuisine" class="half">' . "\n";
 
         foreach ($cuisines as $curCuisine) {
@@ -476,8 +476,8 @@ function showEditMenu() {
 
         print '</select></td></tr>' . "\n";
         print '<tr><td align="right">Cooking Time:</td>' .
-              '<td><input type="text" name="time_val" size="2" maxlength="2" ' . 
-              'value="' . $splitCookingTime[0] . '">&nbsp;' . "\n" . 
+              '<td><input type="text" name="time_val" size="2" maxlength="2" ' .
+              'value="' . $splitCookingTime[0] . '">&nbsp;' . "\n" .
               '<select name="time_units">' . "\n";
         if ($splitCookingTime[1] == "minutes") {
           print '<option value="minutes" selected="selected">minutes</option>' .
@@ -489,17 +489,17 @@ function showEditMenu() {
             "\n";
         }
 
-        print '</select></td></tr>' . "\n" . 
-              '<tr><td align="right">Serves:</td>' . "\n" . 
+        print '</select></td></tr>' . "\n" .
+              '<tr><td align="right">Serves:</td>' . "\n" .
               '<td><input type="text" name="serves" value="' .
-              $serving_count . '" size="2" maxlength="3"></td></tr>' . "\n" . 
-              '<tr><td align="right">Recipe:</td>' . "\n" . 
+              $serving_count . '" size="2" maxlength="3"></td></tr>' . "\n" .
+              '<tr><td align="right">Recipe:</td>' . "\n" .
               '<td><textarea class="full" name="recipe_text">' .
-              $feed_entry->content->text . '</textarea></td></tr>' . "\n" . 
-              '<td>&nbsp;</td><td><input type="submit" value="Update">' . 
-              '</td>' . "\n" . 
+              $feed_entry->content->text . '</textarea></td></tr>' . "\n" .
+              '<td>&nbsp;</td><td><input type="submit" value="Update">' .
+              '</td>' . "\n" .
               '</form></tr></table>' . "\n";
-        
+
         printHTMLFooter();
 
         break;
@@ -514,22 +514,22 @@ function showEditMenu() {
  * Displays both the "List of current recipes" and
  * "Insert a new recipe" panels in a single table.
  * @param string $tableTitle The title to display in the html table
- * @param string $sessionToken A session token 
- * @return void  
+ * @param string $sessionToken A session token
+ * @return void
  */
 function showMainMenu($tableTitle, $sessionToken) {
   printHTMLHeader();
-  
-  print '<table style="width: 75%;text-align:center">' . "\n" . 
-        '<tr>' . "\n" . 
-        '<th colspan="2" style="text-align:center;">' . 
-        'PHP Demo: Google Base data API<br />' . 
-        '<font size="-1">' . 
+
+  print '<table style="width: 75%;text-align:center">' . "\n" .
+        '<tr>' . "\n" .
+        '<th colspan="2" style="text-align:center;">' .
+        'PHP Demo: Google Base data API<br />' .
+        '<font size="-1">' .
         '<span style="font-variant: small-caps;">Powered By</span> ' .
         '<a href="http://framework.zend.com/download/gdata">' .
-        'Zend Google Data Client Library</a></font></th>' . "\n" . 
-        '</tr>' . "\n" . 
-        '<tr><td colspan="2" align="center">' . $tableTitle . "</td></tr>\n" . 
+        'Zend Google Data Client Library</a></font></th>' . "\n" .
+        '</tr>' . "\n" .
+        '<tr><td colspan="2" align="center">' . $tableTitle . "</td></tr>\n" .
         '<tr>' . "\n";
 
   // Create the two sub-tables.
@@ -543,7 +543,7 @@ function showMainMenu($tableTitle, $sessionToken) {
 
   // Close the master table.
   print '</table>' . "\n";
-  
+
   printHTMLFooter();
 }
 
@@ -560,7 +560,7 @@ function exchangeToken($token) {
 /**
  * We arrive here after the user first authenticates and we get back
  * a single-use token.
- * @return void 
+ * @return void
  */
 function showFirstAuthScreen() {
   $singleUseToken = $_GET['token'];
@@ -569,17 +569,17 @@ function showFirstAuthScreen() {
   if (!$sessionToken) {
     showIntroPage();
   } else {
-    $tableTitle = "Here's your <b>single use token:</b> " . 
-      "<code>$singleUseToken</code><br/>" . "\n" . 
+    $tableTitle = "Here's your <b>single use token:</b> " .
+      "<code>$singleUseToken</code><br/>" . "\n" .
       "And here's the <b>session token:</b> <code>$sessionToken</code>";
-    
+
       showMainMenu($tableTitle, $sessionToken);
   }
 }
 
 /**
  * Main logic to handle the POST operation of inserting an item.
- * @return void 
+ * @return void
  */
 function handlePost() {
   try {
@@ -587,7 +587,7 @@ function handlePost() {
     if ($newEntry) {
       showMainMenu('Recipe inserted!  It will be searchable by the API soon...',
                     $_POST['token']);
-    } 
+    }
   } catch (Zend_Gdata_App_Exception $e) {
     showMainMenu('Recipe insertion failed: ' . $e->getMessage(),
                  $_POST['token']);
@@ -596,21 +596,21 @@ function handlePost() {
 
 /**
  * Main logic to handle deleting an item.
- * @return void 
+ * @return void
  */
 function handleDelete() {
   try {
     deleteItem();
     showMainMenu('Recipe deleted.', $_POST['token']);
   } catch (Zend_Gdata_App_Exception $e) {
-    showMainMenu('Recipe deletion failed: ' . $e->getMessage(), 
+    showMainMenu('Recipe deletion failed: ' . $e->getMessage(),
                  $_POST['token']);
   }
 }
 
 /**
  * Main logic to handle a batch deletion of items.
- * @return void 
+ * @return void
  */
 function handleBatch() {
   try {
@@ -628,7 +628,7 @@ function handleBatch() {
 
 /**
  * Main logic to handle updating an item
- * @return void 
+ * @return void
  */
 function handleUpdate() {
   try {

+ 6 - 6
demos/Zend/Gdata/MyLibrary/demo.php

@@ -51,7 +51,7 @@ class SimpleDemo {
     public function __construct($email, $password)
     {
         try {
-          $client = Zend_Gdata_ClientLogin::getHttpClient($email, $password, 
+          $client = Zend_Gdata_ClientLogin::getHttpClient($email, $password,
                     Zend_Gdata_Books::AUTH_SERVICE_NAME);
         } catch (Zend_Gdata_App_AuthException $ae) {
           exit("Error: ". $ae->getMessage() ."\nCredentials provided were ".
@@ -72,7 +72,7 @@ class SimpleDemo {
         foreach($feed as $entry) {
             $titles = $entry->getTitles();
             $rating = $entry->getRating();
-            if (count($titles)) {                
+            if (count($titles)) {
                 if (!is_object($rating)) {
                     $rating_str = "?";
                 } else {
@@ -124,14 +124,14 @@ class SimpleDemo {
         $entry->setId(
             new Zend_Gdata_App_Extension_Id($volumeId));
         print "Inserting ".$volumeId."\n\n";
-        return $this->gdClient->insertVolume($entry);        
+        return $this->gdClient->insertVolume($entry);
     }
 
     /**
      * Add an arbitrary book to the library feed.
      *
      * @param string $volumeId Volume to add a rating to
-     * @param float $rating Numeric rating from 0 to 5 
+     * @param float $rating Numeric rating from 0 to 5
      * @return void
      */
     public function addRating($volumeId, $rating)
@@ -143,7 +143,7 @@ class SimpleDemo {
             new Zend_Gdata_Extension_Rating($rating, "0", 5, 1));
         print "Inserting a rating of ".$rating." for ".$volumeId."\n\n";
         return $this->gdClient->insertVolume($entry,
-            Zend_Gdata_Books::MY_ANNOTATION_FEED_URI);        
+            Zend_Gdata_Books::MY_ANNOTATION_FEED_URI);
     }
 
     /**
@@ -157,7 +157,7 @@ class SimpleDemo {
     public function removeBook($entry)
     {
         print "Deleting ".$entry->getId()->getText()."\n\n";
-        $this->gdClient->deleteVolume($entry);        
+        $this->gdClient->deleteVolume($entry);
     }
 
     /**

+ 61 - 61
demos/Zend/Gdata/Photos.php

@@ -20,15 +20,15 @@
  */
 
 /**
- * PHP sample code for the Photos data API.  Utilizes the 
+ * PHP sample code for the Photos data API.  Utilizes the
  * Zend Framework Gdata components to communicate with the Google API.
- * 
+ *
  * Requires the Zend Framework Gdata components and PHP >= 5.1.4
  *
  * You can run this sample from a web browser.
  *
  * NOTE: You must ensure that Zend Framework is in your PHP include
- * path.  You can do this via php.ini settings, or by modifying the 
+ * path.  You can do this via php.ini settings, or by modifying the
  * argument to set_include_path in the code below.
  *
  * NOTE: As this is sample code, not all of the functions do full error
@@ -90,20 +90,20 @@ session_start();
 function addPhoto($client, $user, $albumId, $photo)
 {
     $photos = new Zend_Gdata_Photos($client);
-    
+
     $fd = $photos->newMediaFileSource($photo["tmp_name"]);
     $fd->setContentType($photo["type"]);
-    
+
     $entry = new Zend_Gdata_Photos_PhotoEntry();
     $entry->setMediaSource($fd);
     $entry->setTitle($photos->newTitle($photo["name"]));
-    
+
     $albumQuery = new Zend_Gdata_Photos_AlbumQuery;
     $albumQuery->setUser($user);
     $albumQuery->setAlbumId($albumId);
-    
+
     $albumEntry = $photos->getAlbumEntry($albumQuery);
-    
+
     $result = $photos->insertPhotoEntry($entry, $albumEntry);
     if ($result) {
         outputAlbumFeed($client, $user, $albumId);
@@ -124,7 +124,7 @@ function addPhoto($client, $user, $albumId, $photo)
 function deletePhoto($client, $user, $albumId, $photoId)
 {
     $photos = new Zend_Gdata_Photos($client);
-    
+
     $photoQuery = new Zend_Gdata_Photos_PhotoQuery;
     $photoQuery->setUser($user);
     $photoQuery->setAlbumId($albumId);
@@ -132,9 +132,9 @@ function deletePhoto($client, $user, $albumId, $photoId)
     $photoQuery->setType('entry');
 
     $entry = $photos->getPhotoEntry($photoQuery);
-    
+
     $photos->deletePhotoEntry($entry, true);
-    
+
     outputAlbumFeed($client, $user, $albumId);
 }
 
@@ -149,10 +149,10 @@ function deletePhoto($client, $user, $albumId, $photoId)
 function addAlbum($client, $user, $name)
 {
     $photos = new Zend_Gdata_Photos($client);
-    
+
     $entry = new Zend_Gdata_Photos_AlbumEntry();
     $entry->setTitle($photos->newTitle($name));
-    
+
     $result = $photos->insertAlbumEntry($entry);
     if ($result) {
         outputUserFeed($client, $user);
@@ -172,16 +172,16 @@ function addAlbum($client, $user, $name)
 function deleteAlbum($client, $user, $albumId)
 {
     $photos = new Zend_Gdata_Photos($client);
-    
+
     $albumQuery = new Zend_Gdata_Photos_AlbumQuery;
     $albumQuery->setUser($user);
     $albumQuery->setAlbumId($albumId);
     $albumQuery->setType('entry');
 
     $entry = $photos->getAlbumEntry($albumQuery);
-    
+
     $photos->deleteAlbumEntry($entry, true);
-    
+
     outputUserFeed($client, $user);
 }
 
@@ -198,11 +198,11 @@ function deleteAlbum($client, $user, $albumId)
 function addComment($client, $user, $album, $photo, $comment)
 {
     $photos = new Zend_Gdata_Photos($client);
-    
+
     $entry = new Zend_Gdata_Photos_CommentEntry();
     $entry->setTitle($photos->newTitle($comment));
     $entry->setContent($photos->newContent($comment));
-    
+
     $photoQuery = new Zend_Gdata_Photos_PhotoQuery;
     $photoQuery->setUser($user);
     $photoQuery->setAlbumId($album);
@@ -210,7 +210,7 @@ function addComment($client, $user, $album, $photo, $comment)
     $photoQuery->setType('entry');
 
     $photoEntry = $photos->getPhotoEntry($photoQuery);
-    
+
     $result = $photos->insertCommentEntry($entry, $photoEntry);
     if ($result) {
         outputPhotoFeed($client, $user, $album, $photo);
@@ -232,19 +232,19 @@ function addComment($client, $user, $album, $photo, $comment)
 function deleteComment($client, $user, $albumId, $photoId, $commentId)
 {
     $photos = new Zend_Gdata_Photos($client);
-    
+
     $photoQuery = new Zend_Gdata_Photos_PhotoQuery;
     $photoQuery->setUser($user);
     $photoQuery->setAlbumId($albumId);
     $photoQuery->setPhotoId($photoId);
     $photoQuery->setType('entry');
-    
+
     $path = $photoQuery->getQueryUrl() . '/commentid/' . $commentId;
-    
+
     $entry = $photos->getCommentEntry($path);
-    
+
     $photos->deleteCommentEntry($entry, true);
-    
+
     outputPhotoFeed($client, $user, $albumId, $photoId);
 }
 
@@ -261,10 +261,10 @@ function deleteComment($client, $user, $albumId, $photoId, $commentId)
 function addTag($client, $user, $album, $photo, $tag)
 {
     $photos = new Zend_Gdata_Photos($client);
-    
+
     $entry = new Zend_Gdata_Photos_TagEntry();
     $entry->setTitle($photos->newTitle($tag));
-    
+
     $photoQuery = new Zend_Gdata_Photos_PhotoQuery;
     $photoQuery->setUser($user);
     $photoQuery->setAlbumId($album);
@@ -272,7 +272,7 @@ function addTag($client, $user, $album, $photo, $tag)
     $photoQuery->setType('entry');
 
     $photoEntry = $photos->getPhotoEntry($photoQuery);
-    
+
     $result = $photos->insertTagEntry($entry, $photoEntry);
     if ($result) {
         outputPhotoFeed($client, $user, $album, $photo);
@@ -294,15 +294,15 @@ function addTag($client, $user, $album, $photo, $tag)
 function deleteTag($client, $user, $albumId, $photoId, $tagContent)
 {
     $photos = new Zend_Gdata_Photos($client);
-    
+
     $photoQuery = new Zend_Gdata_Photos_PhotoQuery;
     $photoQuery->setUser($user);
     $photoQuery->setAlbumId($albumId);
     $photoQuery->setPhotoId($photoId);
     $query = $photoQuery->getQueryUrl() . "?kind=tag";
-    
+
     $photoFeed = $photos->getPhotoFeed($query);
-    
+
     foreach ($photoFeed as $entry) {
         if ($entry instanceof Zend_Gdata_Photos_TagEntry) {
             if ($entry->getContent() == $tagContent) {
@@ -310,9 +310,9 @@ function deleteTag($client, $user, $albumId, $photoId, $tagContent)
             }
         }
     }
-    
+
     $photos->deleteTagEntry($tagEntry, true);
-    
+
     outputPhotoFeed($client, $user, $albumId, $photoId);
 }
 
@@ -324,7 +324,7 @@ function deleteTag($client, $user, $albumId, $photoId, $tagContent)
  *
  * @return string Current script path
  */
-function getCurrentScript() 
+function getCurrentScript()
 {
     global $_SERVER;
     return $_SERVER["PHP_SELF"];
@@ -332,7 +332,7 @@ function getCurrentScript()
 
 /**
  * Returns the full URL of the current page, based upon env variables
- * 
+ *
  * Env variables used:
  * $_SERVER['HTTPS'] = (on|off|)
  * $_SERVER['HTTP_HOST'] = value of the Host: header
@@ -341,7 +341,7 @@ function getCurrentScript()
  *
  * @return string Current URL
  */
-function getCurrentUrl() 
+function getCurrentUrl()
 {
     global $_SERVER;
 
@@ -368,7 +368,7 @@ function getCurrentUrl()
 }
 
 /**
- * Returns the AuthSub URL which the user must visit to authenticate requests 
+ * Returns the AuthSub URL which the user must visit to authenticate requests
  * from this application.
  *
  * Uses getCurrentUrl() to get the next URL which the user will be redirected
@@ -376,28 +376,28 @@ function getCurrentUrl()
  *
  * @return string AuthSub URL
  */
-function getAuthSubUrl() 
+function getAuthSubUrl()
 {
     $next = getCurrentUrl();
     $scope = 'http://picasaweb.google.com/data';
     $secure = false;
     $session = true;
-    return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, 
+    return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure,
         $session);
 }
 
 /**
  * Outputs a request to the user to login to their Google account, including
  * a link to the AuthSub URL.
- * 
+ *
  * Uses getAuthSubUrl() to get the URL which the user must visit to authenticate
  *
  * @return void
  */
-function requestUserLogin($linkText) 
+function requestUserLogin($linkText)
 {
     $authSubUrl = getAuthSubUrl();
-    echo "<a href=\"{$authSubUrl}\">{$linkText}</a>"; 
+    echo "<a href=\"{$authSubUrl}\">{$linkText}</a>";
 }
 
 /**
@@ -405,31 +405,31 @@ function requestUserLogin($linkText)
  * with Google using AuthSub authentication.
  *
  * Uses the $_SESSION['sessionToken'] to store the AuthSub session token after
- * it is obtained.  The single use token supplied in the URL when redirected 
- * after the user succesfully authenticated to Google is retrieved from the 
+ * it is obtained.  The single use token supplied in the URL when redirected
+ * after the user succesfully authenticated to Google is retrieved from the
  * $_GET['token'] variable.
  *
  * @return Zend_Http_Client
  */
-function getAuthSubHttpClient() 
+function getAuthSubHttpClient()
 {
     global $_SESSION, $_GET;
     if (!isset($_SESSION['sessionToken']) && isset($_GET['token'])) {
-        $_SESSION['sessionToken'] = 
+        $_SESSION['sessionToken'] =
             Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token']);
-    } 
+    }
     $client = Zend_Gdata_AuthSub::getHttpClient($_SESSION['sessionToken']);
     return $client;
 }
 
 /**
  * Processes loading of this sample code through a web browser.  Uses AuthSub
- * authentication and outputs a list of a user's albums if succesfully 
+ * authentication and outputs a list of a user's albums if succesfully
  * authenticated.
  *
  * @return void
  */
-function processPageLoad() 
+function processPageLoad()
 {
     global $_SESSION, $_GET;
     if (!isset($_SESSION['sessionToken']) && !isset($_GET['token'])) {
@@ -454,7 +454,7 @@ function processPageLoad()
             }
         }
 
-        // Now we handle the potentially destructive commands, which have to 
+        // Now we handle the potentially destructive commands, which have to
         // be submitted by POST only.
         if (!empty($_POST['command'])) {
             switch ($_POST['command']) {
@@ -513,7 +513,7 @@ function processPageLoad()
                 echo "<p>Please check your request and try again.</p>";
           }
         }
-        
+
         if (empty($_REQUEST['menu']) && empty($_REQUEST['command'])) {
             displayMenu();
         }
@@ -530,7 +530,7 @@ function displayMenu()
 ?>
 <h2>Main Menu</h2>
 
-<p>Welcome to the Photos API demo page. Please select 
+<p>Welcome to the Photos API demo page. Please select
     from one of the following four options to fetch information.</p>
 
     <ul>
@@ -643,7 +643,7 @@ function displayAlbumMenu()
     displayBackLink();
 }
 
-/** 
+/**
  * Outputs an HTML unordered list (ul), with each list item representing an
  * album in the user's feed.
  *
@@ -651,10 +651,10 @@ function displayAlbumMenu()
  * @param  string           $user   The user's account name
  * @return void
  */
-function outputUserFeed($client, $user) 
+function outputUserFeed($client, $user)
 {
     $photos = new Zend_Gdata_Photos($client);
-    
+
     $query = new Zend_Gdata_Photos_UserQuery();
     $query->setUser($user);
 
@@ -694,19 +694,19 @@ function outputUserFeed($client, $user)
     displayBackLink();
 }
 
-/** 
+/**
  * Outputs an HTML unordered list (ul), with each list item representing a
- * photo in the user's album feed.  
+ * photo in the user's album feed.
  *
  * @param  Zend_Http_Client $client  The authenticated client object
  * @param  string           $user    The user's account name
  * @param  integer          $albumId The album's id
  * @return void
  */
-function outputAlbumFeed($client, $user, $albumId) 
+function outputAlbumFeed($client, $user, $albumId)
 {
     $photos = new Zend_Gdata_Photos($client);
-    
+
     $query = new Zend_Gdata_Photos_AlbumQuery();
     $query->setUser($user);
     $query->setAlbumId($albumId);
@@ -748,7 +748,7 @@ function outputAlbumFeed($client, $user, $albumId)
     displayBackLink();
 }
 
-/** 
+/**
  * Outputs the feed of the specified photo
  *
  * @param  Zend_Http_Client $client  The authenticated client object
@@ -757,7 +757,7 @@ function outputAlbumFeed($client, $user, $albumId)
  * @param  integer          $photoId The photo's id
  * @return void
  */
-function outputPhotoFeed($client, $user, $albumId, $photoId) 
+function outputPhotoFeed($client, $user, $albumId, $photoId)
 {
     $photos = new Zend_Gdata_Photos($client);
 
@@ -766,7 +766,7 @@ function outputPhotoFeed($client, $user, $albumId, $photoId)
     $query->setAlbumId($albumId);
     $query->setPhotoId($photoId);
     $query = $query->getQueryUrl() . "?kind=comment,tag";
-    
+
     $photoFeed = $photos->getPhotoFeed($query);
     echo "<h2>Photo Feed for: " . $photoFeed->getTitle() . "</h2>";
     $thumbs = $photoFeed->getMediaGroup()->getThumbnail();

+ 14 - 14
demos/Zend/Gdata/Spreadsheet-ClientLogin.php

@@ -71,12 +71,12 @@ class SimpleCRUD
     public function __construct($email, $password)
     {
         try {
-          $client = Zend_Gdata_ClientLogin::getHttpClient($email, $password, 
+          $client = Zend_Gdata_ClientLogin::getHttpClient($email, $password,
                     Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME);
         } catch (Zend_Gdata_App_AuthException $ae) {
           exit("Error: ". $ae->getMessage() ."\nCredentials provided were email: [$email] and password [$password].\n");
         }
-        
+
         $this->gdClient = new Zend_Gdata_Spreadsheets($client);
         $this->currKey = '';
         $this->currWkshtId = '';
@@ -189,12 +189,12 @@ class SimpleCRUD
      */
     public function promptForListAction()
     {
-        echo  "\n== Options ==\n". 
-              "dump -- dump row information\n". 
+        echo  "\n== Options ==\n".
+              "dump -- dump row information\n".
               "insert {row_data} -- insert data in the next available cell in a given column (example: insert column_header=content)\n".
-              "update {row_index} {row_data} -- update data in the row provided (example: update row-number column-header=newdata\n". 
+              "update {row_index} {row_data} -- update data in the row provided (example: update row-number column-header=newdata\n".
               "delete {row_index} -- delete a row\n\n";
-        
+
         $input = getInput('Command');
         $command = explode(' ', $input);
         if ($command[0] == 'dump') {
@@ -233,14 +233,14 @@ class SimpleCRUD
      * @return void
      */
     public function cellsUpdateAction($row, $col, $inputValue)
-    {   
+    {
         if (($row > $this->rowCount) || ($col > $this->columnCount)) {
             print "Current worksheet only has $this->rowCount rows and $this->columnCount columns.\n";
             if (!$this->promptToResize($row, $col)) {
                 return;
             }
         }
-        $entry = $this->gdClient->updateCell($row, $col, $inputValue, 
+        $entry = $this->gdClient->updateCell($row, $col, $inputValue,
                 $this->currKey, $this->currWkshtId);
         if ($entry instanceof Zend_Gdata_Spreadsheets_CellEntry) {
             echo "Success!\n";
@@ -258,9 +258,9 @@ class SimpleCRUD
         $query->setSpreadsheetKey($this->currKey);
         $query->setWorksheetId($this->currWkshtId);
         $this->listFeed = $this->gdClient->getListFeed($query);
-        print "entry id | row-content in column A | column-header: cell-content\n". 
+        print "entry id | row-content in column A | column-header: cell-content\n".
               "Please note: The 'dump' command on the list feed only dumps data until the first blank row is encountered.\n\n";
-        
+
         $this->printFeed($this->listFeed);
         print "\n";
     }
@@ -360,13 +360,13 @@ class SimpleCRUD
      *
      * @return void
      */
-    public function getRowAndColumnCount() 
+    public function getRowAndColumnCount()
     {
         $query = new Zend_Gdata_Spreadsheets_CellQuery();
         $query->setSpreadsheetKey($this->currKey);
         $query->setWorksheetId($this->currWkshtId);
         $feed = $this->gdClient->getCellFeed($query);
-         
+
         if ($feed instanceOf Zend_Gdata_Spreadsheets_CellFeed) {
             $this->rowCount = $feed->getRowCount();
             $this->columnCount = $feed->getColumnCount();
@@ -404,7 +404,7 @@ class SimpleCRUD
       } else {
             print "Invalid input. Please try again.\n";
             $this->promptForFeedtype();
-      }  
+      }
     }
 
     /**
@@ -450,5 +450,5 @@ if (($email == null) || ($pass == null)) {
     $pass = getInput("Please enter your password [example: mypassword]");
 }
 
-$sample = new SimpleCRUD($email, $pass); 
+$sample = new SimpleCRUD($email, $pass);
 $sample->run();

+ 2 - 2
demos/Zend/Gdata/YouTubeVideoApp/index.php

@@ -37,9 +37,9 @@
 session_start();
 
 /**
- * Set your developer key here. 
+ * Set your developer key here.
  *
- * NOTE: In a production application you may want to store this information in 
+ * NOTE: In a production application you may want to store this information in
  * an external file.
  */
 $_SESSION['developerKey'] = '<YOUR DEVELOPER KEY>';

+ 3 - 3
demos/Zend/Gdata/YouTubeVideoApp/session_details.php

@@ -19,7 +19,7 @@
  */
 
 /**
- * PHP sample code for the YouTube data API.  Utilizes the Zend Framework 
+ * PHP sample code for the YouTube data API.  Utilizes the Zend Framework
  * Zend_Gdata component to communicate with the YouTube data API.
  *
  * Requires the Zend Framework Zend_Gdata component and PHP >= 5.1.4
@@ -56,8 +56,8 @@ foreach($session_copy as $key => $value) {
 
     print '<h3>'. $key . '</h3><div id="sessionVariable" >'. $value .'</div><br />'.
         '<form method="POST" action="operations.php">' .
-        '<input type="hidden" value="clear_session_var" name="operation"/>'. 
-        '<input type="hidden" name="name" value="'. $key .'"/>'. 
+        '<input type="hidden" value="clear_session_var" name="operation"/>'.
+        '<input type="hidden" name="name" value="'. $key .'"/>'.
         '<input type="submit" value="click to delete"/></form><hr />';
 }
 ?>

+ 20 - 20
demos/Zend/Gdata/YouTubeVideoBrowser/index.php

@@ -20,7 +20,7 @@
  */
 
 /**
- * PHP sample code for the YouTube data API.  Utilizes the Zend Framework 
+ * PHP sample code for the YouTube data API.  Utilizes the Zend Framework
  * Zend_Gdata component to communicate with the YouTube data API.
  *
  * Requires the Zend Framework Zend_Gdata component and PHP >= 5.1.4
@@ -52,7 +52,7 @@ Zend_Loader::loadClass('Zend_Gdata_YouTube');
  * @param  Zend_Gdata_YouTube_VideoEntry $entry The video entry
  * @return string|null The URL or null, if the URL is not found
  */
-function findFlashUrl($entry) 
+function findFlashUrl($entry)
 {
     foreach ($entry->mediaGroup->content as $content) {
         if ($content->type === 'application/x-shockwave-flash') {
@@ -65,15 +65,15 @@ function findFlashUrl($entry)
 /**
  * Returns a feed of top rated videos for the specified user
  *
- * @param  string $user The username 
+ * @param  string $user The username
  * @return Zend_Gdata_YouTube_VideoFeed The feed of top rated videos
  */
-function getTopRatedVideosByUser($user) 
+function getTopRatedVideosByUser($user)
 {
-    $userVideosUrl = 'http://gdata.youtube.com/feeds/users/' . 
+    $userVideosUrl = 'http://gdata.youtube.com/feeds/users/' .
                      $user . '/uploads';
     $yt = new Zend_Gdata_YouTube();
-    $ytQuery = $yt->newVideoQuery($userVideosUrl);  
+    $ytQuery = $yt->newVideoQuery($userVideosUrl);
     // order by the rating of the videos
     $ytQuery->setOrderBy('rating');
     // retrieve a maximum of 5 videos
@@ -89,7 +89,7 @@ function getTopRatedVideosByUser($user)
  * @param  string $videoId The video
  * @return Zend_Gdata_YouTube_VideoFeed The feed of related videos
  */
-function getRelatedVideos($videoId) 
+function getRelatedVideos($videoId)
 {
     $yt = new Zend_Gdata_YouTube();
     $ytQuery = $yt->newVideoQuery();
@@ -105,14 +105,14 @@ function getRelatedVideos($videoId)
 }
 
 /**
- * Echo img tags for the first thumbnail representing each video in the 
+ * Echo img tags for the first thumbnail representing each video in the
  * specified video feed.  Upon clicking the thumbnails, the video should
  * be presented.
  *
  * @param  Zend_Gdata_YouTube_VideoFeed $feed The video feed
  * @return void
  */
-function echoThumbnails($feed) 
+function echoThumbnails($feed)
 {
     foreach ($feed as $entry) {
         $videoId = $entry->getVideoId();
@@ -128,16 +128,16 @@ function echoThumbnails($feed)
  * @param  string $videoId The video
  * @return void
  */
-function echoVideoPlayer($videoId) 
+function echoVideoPlayer($videoId)
 {
     $yt = new Zend_Gdata_YouTube();
-    
+
     $entry = $yt->getVideoEntry($videoId);
     $videoTitle = $entry->mediaGroup->title;
     $videoUrl = findFlashUrl($entry);
     $relatedVideoFeed = getRelatedVideos($entry->getVideoId());
     $topRatedFeed = getTopRatedVideosByUser($entry->author[0]->name);
-    
+
     print <<<END
     <b>$videoTitle</b><br />
     <object width="425" height="350">
@@ -150,18 +150,18 @@ END;
     echo '<br />';
     echoVideoMetadata($entry);
     echo '<br /><b>Related:</b><br />';
-    echoThumbnails($relatedVideoFeed); 
+    echoThumbnails($relatedVideoFeed);
     echo '<br /><b>Top rated videos by user:</b><br />';
-    echoThumbnails($topRatedFeed); 
+    echoThumbnails($topRatedFeed);
 }
 
 /**
  * Echo video metadata
- * 
+ *
  * @param  Zend_Gdata_YouTube_VideoEntry $entry The video entry
  * @return void
  */
-function echoVideoMetadata($entry) 
+function echoVideoMetadata($entry)
 {
     $title = $entry->mediaGroup->title;
     $description = $entry->mediaGroup->description;
@@ -193,7 +193,7 @@ END;
  * @param  Zend_Gdata_YouTube_VideoFeed $feed The video feed
  * @return void
  */
-function echoVideoList($feed) 
+function echoVideoList($feed)
 {
     echo '<table class="videoList">';
     echo '<tbody width="100%">';
@@ -240,14 +240,14 @@ if ($queryType === null) {
     $searchTerm = $_POST['searchTerm'];
     $startIndex = $_POST['startIndex'];
     $maxResults = $_POST['maxResults'];
-    
+
     $yt = new Zend_Gdata_YouTube();
     $query = $yt->newVideoQuery();
     $query->setQuery($searchTerm);
     $query->setStartIndex($startIndex);
     $query->setMaxResults($maxResults);
-   
-    /* check for one of the standard feeds, or list from 'all' videos */ 
+
+    /* check for one of the standard feeds, or list from 'all' videos */
     switch ($queryType) {
     case 'most_viewed':
         $query->setFeedType('most viewed');

+ 1 - 1
demos/Zend/Locale/AllLanguages.php

@@ -22,7 +22,7 @@
 /**
  * This example shows how to get the language for all
  * languages written in native letters
- * 
+ *
  * So en = english de = deutsch da = dánsk and so on
  */
 

+ 2 - 2
demos/Zend/OpenId/mvc_auth/application/controllers/ErrorController.php

@@ -25,7 +25,7 @@
 require_once 'Zend/Controller/Action.php';
 
 /**
- * Error Controller 
+ * Error Controller
  *
  * @category   Zend
  * @package    Zend_OpenId
@@ -38,7 +38,7 @@ class ErrorController extends Zend_Controller_Action
 {
     /**
      * Handle errors
-     * 
+     *
      * @return void
      */
     public function errorAction()

+ 2 - 2
demos/Zend/OpenId/mvc_auth/application/controllers/IndexController.php

@@ -44,7 +44,7 @@ class IndexController extends Zend_Controller_Action
      *
      * @return void
      */
-    public function indexAction() 
+    public function indexAction()
     {
         $auth = Zend_Auth::getInstance();
         if (!$auth->hasIdentity()) {
@@ -59,7 +59,7 @@ class IndexController extends Zend_Controller_Action
      *
      * @return void
      */
-    public function welcomeAction() 
+    public function welcomeAction()
     {
         $auth = Zend_Auth::getInstance();
         if (!$auth->hasIdentity()) {

+ 4 - 4
demos/Zend/Pdf/demo.php

@@ -157,7 +157,7 @@ $page2->drawPolygon($x, $y,
 // Coordination system movement
 $page2->saveGS();
 $page2->translate(60, 250); // Shift coordination system
-                    
+
 // Draw rectangle
 $page2->setFillColor(new Zend_Pdf_Color_GrayScale(0.8))
       ->setLineColor(new Zend_Pdf_Color_GrayScale(0.2))
@@ -195,7 +195,7 @@ for ($count = 0; $count < 8; $count++) {
 $page2->drawPolygon($x, $y,
                     Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE,
                     Zend_Pdf_Page::FILL_METHOD_EVEN_ODD);
-                    
+
 // Draw line
 $page2->setLineWidth(0.5)
       ->drawLine(0, 25, 340, 25);
@@ -208,7 +208,7 @@ $page2->saveGS();
 $page2->translate(60, 150)     // Shift coordination system
       ->skew(0, 0, 0, -M_PI/9) // Skew coordination system
       ->scale(0.9, 0.9);       // Scale coordination system
-                    
+
 // Draw rectangle
 $page2->setFillColor(new Zend_Pdf_Color_GrayScale(0.8))
       ->setLineColor(new Zend_Pdf_Color_GrayScale(0.2))
@@ -246,7 +246,7 @@ for ($count = 0; $count < 8; $count++) {
 $page2->drawPolygon($x, $y,
                     Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE,
                     Zend_Pdf_Page::FILL_METHOD_EVEN_ODD);
-                    
+
 // Draw line
 $page2->setLineWidth(0.5)
       ->drawLine(0, 25, 340, 25);

+ 32 - 32
demos/Zend/ProgressBar/JsPush.php

@@ -26,14 +26,14 @@
 if (isset($_GET['progress'])) {
     set_include_path(realpath(dirname(__FILE__) . '/../../../library')
                      . PATH_SEPARATOR . get_include_path());
-    
-    require_once 'Zend/ProgressBar.php'; 
+
+    require_once 'Zend/ProgressBar.php';
     require_once 'Zend/ProgressBar/Adapter/JsPush.php';
-    
+
     $adapter     = new Zend_ProgressBar_Adapter_JsPush(array('updateMethodName' => 'Zend_ProgressBar_Update',
-                                                             'finishMethodName' => 'Zend_ProgressBar_Finish')); 
-    $progressBar = new Zend_ProgressBar($adapter, 0, 100); 
-     
+                                                             'finishMethodName' => 'Zend_ProgressBar_Finish'));
+    $progressBar = new Zend_ProgressBar($adapter, 0, 100);
+
     for ($i = 1; $i <= 100; $i++) {
         if ($i < 20) {
             $text = 'Just beginning';
@@ -44,82 +44,82 @@ if (isset($_GET['progress'])) {
         } else {
             $text = 'Nearly done';
         }
-        
-        $progressBar->update($i, $text); 
-        usleep(100000); 
-    } 
-    
+
+        $progressBar->update($i, $text);
+        usleep(100000);
+    }
+
     $progressBar->finish();
-    
+
     die;
 }
 ?>
 <html>
 <head>
     <title>Zend_ProgressBar Javascript Push Demo and Test</title>
-    <style type="text/css">   
+    <style type="text/css">
         iframe {
             position: absolute;
             left: -100px;
             top: -100px;
-        
+
             width: 10px;
             height: 10px;
             overflow: hidden;
         }
-    
+
         #progressbar {
             position: absolute;
             left: 10px;
             top: 10px;
         }
-        
+
         .pg-progressbar {
             position: relative;
-        
+
             width: 250px;
             height: 24px;
             overflow: hidden;
-        
+
             border: 1px solid #c6c6c6;
         }
-        
+
         .pg-progress {
             z-index: 150;
-        
+
             position: absolute;
             left: 0;
             top: 0;
-        
+
             width: 0;
             height: 24px;
             overflow: hidden;
         }
-        
+
         .pg-progressstyle {
             height: 22px;
-        
+
             border: 1px solid #748a9e;
             background-image: url('animation.gif');
         }
-        
+
         .pg-text,
         .pg-invertedtext {
             position: absolute;
             left: 0;
             top: 4px;
-        
+
             width: 250px;
-        
+
             text-align: center;
             font-family: sans-serif;
             font-size: 12px;
         }
-        
+
         .pg-invertedtext {
             color: #ffffff;
         }
-        
+
         .pg-text {
             z-index: 100;
             color: #000000;
@@ -132,19 +132,19 @@ if (isset($_GET['progress'])) {
             document.getElementsByTagName('body')[0].appendChild(iFrame);
             iFrame.src = 'JsPush.php?progress';
         }
-        
+
         function Zend_ProgressBar_Update(data)
         {
             document.getElementById('pg-percent').style.width = data.percent + '%';
-        
+
             document.getElementById('pg-text-1').innerHTML = data.text;
             document.getElementById('pg-text-2').innerHTML = data.text;
         }
-        
+
         function Zend_ProgressBar_Finish()
         {
             document.getElementById('pg-percent').style.width = '100%';
-        
+
             document.getElementById('pg-text-1').innerHTML = 'Demo done';
             document.getElementById('pg-text-2').innerHTML = 'Demo done';
         }

+ 32 - 32
demos/Zend/ProgressBar/Upload.php

@@ -26,18 +26,18 @@
 if (isset($_GET['uploadId'])) {
     set_include_path(realpath(dirname(__FILE__) . '/../../../library')
                      . PATH_SEPARATOR . get_include_path());
-    
-    require_once 'Zend/ProgressBar.php'; 
+
+    require_once 'Zend/ProgressBar.php';
     require_once 'Zend/ProgressBar/Adapter/JsPull.php';
-    require_once 'Zend/Session/Namespace.php'; 
-   
-    $data          = uploadprogress_get_info($_GET['uploadId']);   
+    require_once 'Zend/Session/Namespace.php';
+
+    $data          = uploadprogress_get_info($_GET['uploadId']);
     $bytesTotal    = ($data === null ? 0 : $data['bytes_total']);
     $bytesUploaded = ($data === null ? 0 : $data['bytes_uploaded']);
-    
+
     $adapter     = new Zend_ProgressBar_Adapter_JsPull();
     $progressBar = new Zend_ProgressBar($adapter, 0, $bytesTotal, 'uploadProgress');
-    
+
     if ($bytesTotal === $bytesUploaded) {
         $progressBar->finish();
     } else {
@@ -48,69 +48,69 @@ if (isset($_GET['uploadId'])) {
 <html>
 <head>
     <title>Zend_ProgressBar Upload Demo</title>
-    <style type="text/css">   
+    <style type="text/css">
         iframe {
             position: absolute;
             left: -100px;
             top: -100px;
-        
+
             width: 10px;
             height: 10px;
             overflow: hidden;
         }
-    
+
         #progressbar {
             position: absolute;
             left: 10px;
             top: 50px;
         }
-        
+
         .pg-progressbar {
             position: relative;
-        
+
             width: 250px;
             height: 24px;
             overflow: hidden;
-        
+
             border: 1px solid #c6c6c6;
         }
-        
+
         .pg-progress {
             z-index: 150;
-        
+
             position: absolute;
             left: 0;
             top: 0;
-        
+
             width: 0;
             height: 24px;
             overflow: hidden;
         }
-        
+
         .pg-progressstyle {
             height: 22px;
-        
+
             border: 1px solid #748a9e;
             background-image: url('animation.gif');
         }
-        
+
         .pg-text,
         .pg-invertedtext {
             position: absolute;
             left: 0;
             top: 4px;
-        
+
             width: 250px;
-        
+
             text-align: center;
             font-family: sans-serif;
             font-size: 12px;
         }
-        
+
         .pg-invertedtext {
             color: #ffffff;
         }
-        
+
         .pg-text {
             z-index: 100;
             color: #000000;
@@ -120,7 +120,7 @@ if (isset($_GET['uploadId'])) {
         function makeRequest(url)
         {
             var httpRequest;
-        
+
             if (window.XMLHttpRequest) {
                 httpRequest = new XMLHttpRequest();
                 if (httpRequest.overrideMimeType) {
@@ -135,23 +135,23 @@ if (isset($_GET['uploadId'])) {
                     } catch (e) {}
                 }
             }
-        
+
             if (!httpRequest) {
                 alert('Giving up :( Cannot create an XMLHTTP instance');
                 return false;
             }
-            
+
             httpRequest.onreadystatechange = function() { evalProgress(httpRequest); };
             httpRequest.open('GET', url, true);
             httpRequest.send('');
-        
+
         }
-    
+
         function observeProgress()
         {
             setTimeout("getProgress()", 1500);
         }
-        
+
         function getProgress()
         {
             makeRequest('Upload.php?uploadId=' + document.getElementById('uploadId').value);
@@ -178,7 +178,7 @@ if (isset($_GET['uploadId'])) {
                 alert('Caught Exception: ' + e.description);
             }
         }
-        
+
         function update(data)
         {
             document.getElementById('pg-percent').style.width = data.percent + '%';
@@ -186,11 +186,11 @@ if (isset($_GET['uploadId'])) {
             document.getElementById('pg-text-1').innerHTML = data.timeRemaining + ' seconds remaining';
             document.getElementById('pg-text-2').innerHTML = data.timeRemaining + ' seconds remaining';
         }
-        
+
         function finish()
         {
             document.getElementById('pg-percent').style.width = '100%';
-        
+
             document.getElementById('pg-text-1').innerHTML = 'Upload done';
             document.getElementById('pg-text-2').innerHTML = 'Upload done';
         }

+ 1 - 1
demos/Zend/Wildfire/application/controllers/Boot/Zend-Db-Profiler-Firebug/IndexController.php

@@ -10,7 +10,7 @@ class IndexController extends Zend_Controller_Action
 
         $db->getConnection()->exec('CREATE TABLE foo (
                                       id      INTEGNER NOT NULL,
-                                      col1    VARCHAR(10) NOT NULL  
+                                      col1    VARCHAR(10) NOT NULL
                                     )');
 
         $db->insert('foo', array('id'=>1,'col1'=>'original'));

+ 1 - 1
demos/Zend/Wildfire/application/controllers/Boot/Zend-Log-Writer-Firebug/IndexController.php

@@ -8,6 +8,6 @@ class IndexController extends Zend_Controller_Action
     {
         $logger = Zend_Registry::get('logger');
 
-        $logger->log('This is a log message!', Zend_Log::INFO);      
+        $logger->log('This is a log message!', Zend_Log::INFO);
     }
 }

+ 3 - 3
demos/Zend/Wildfire/application/controllers/ErrorController.php

@@ -38,13 +38,13 @@ class ErrorController extends Zend_Controller_Action
         try {
 
             Zend_Registry::get('logger')->err($this->_getParam('error_handler')->exception);
-          
+
         } catch(Exception $e) {
-          
+
           /* TODO: You can log this exception somewhere or display it during development.
            *       DO NOT USE THE logger here as it will create an infinite loop!
            */
-          
+
         }
     }
 }

+ 11 - 11
demos/Zend/Wildfire/application/controllers/ZendDbProfilerFirebugController.php

@@ -31,14 +31,14 @@ require_once 'Zend/Controller/Action.php';
  */
 class ZendDbProfilerFirebugController extends Zend_Controller_Action
 {
-  
+
     public function testloggingAction()
     {
         $db = Zend_Registry::get('db');
 
         $db->getConnection()->exec('CREATE TABLE foo (
                                       id      INTEGNER NOT NULL,
-                                      col1    VARCHAR(10) NOT NULL  
+                                      col1    VARCHAR(10) NOT NULL
                                     )');
 
         $db->insert('foo', array('id'=>1,'col1'=>'original'));
@@ -53,35 +53,35 @@ class ZendDbProfilerFirebugController extends Zend_Controller_Action
 
         $db->getConnection()->exec('DROP TABLE foo');
     }
-    
+
     public function testmultipledatabasesAction()
     {
         $profiler1 = new Zend_Db_Profiler_Firebug('All DB Queries for first database');
-        
+
         $db1 = Zend_Db::factory('PDO_SQLITE',
                                array('dbname' => ':memory:',
                                      'profiler' => $profiler1));
-        
+
         $db1->getProfiler()->setEnabled(true);
 
         $profiler2 = new Zend_Db_Profiler_Firebug('All DB Queries for second database');
-        
+
         $db2 = Zend_Db::factory('PDO_SQLITE',
                                array('dbname' => ':memory:',
                                      'profiler' => $profiler2));
-        
+
         $db2->getProfiler()->setEnabled(true);
-        
+
         $db1->getConnection()->exec('CREATE TABLE foo (
                                       id      INTEGNER NOT NULL,
-                                      col1    VARCHAR(10) NOT NULL  
+                                      col1    VARCHAR(10) NOT NULL
                                     )');
 
         $db1->insert('foo', array('id'=>1,'col1'=>'original'));
-        
+
         $db2->getConnection()->exec('CREATE TABLE foo (
                                       id      INTEGNER NOT NULL,
-                                      col1    VARCHAR(10) NOT NULL  
+                                      col1    VARCHAR(10) NOT NULL
                                     )');
 
         $db2->insert('foo', array('id'=>1,'col1'=>'original'));

+ 11 - 11
demos/Zend/Wildfire/public/Boot/Zend-Db-Profiler-Firebug/TestDocExample.php

@@ -4,31 +4,31 @@ require_once('Zend/Loader.php');
 Zend_Loader::registerAutoload();
 
 switch($_GET['Example']) {
-    
+
     case 'WithController':
-  
+
         $profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
         $profiler->setEnabled(true);
         $db = Zend_Db::factory('PDO_SQLITE', array('dbname' => ':memory:'));
         $db->setProfiler($profiler);
         Zend_Registry::set('db',$db);
-        
+
         $controller = Zend_Controller_Front::getInstance();
         $controller->setParam('useDefaultControllerAlways',true);
-        $controller->setParam('noViewRenderer', true);        
+        $controller->setParam('noViewRenderer', true);
         $controller->setControllerDirectory(dirname(dirname(dirname(dirname(__FILE__)))).'/application/controllers/Boot/Zend-Db-Profiler-Firebug');
         $controller->dispatch();
-  
+
         print 'Test Doc Example with Controller';
         break;
-  
+
     case 'WithoutController':
-              
+
         $profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
         $profiler->setEnabled(true);
         $db = Zend_Db::factory('PDO_SQLITE', array('dbname' => ':memory:'));
         $db->setProfiler($profiler);
-        
+
         $request  = new Zend_Controller_Request_Http();
         $response = new Zend_Controller_Response_Http();
         $channel  = Zend_Wildfire_Channel_HttpHeaders::getInstance();
@@ -37,15 +37,15 @@ switch($_GET['Example']) {
 
         $db->getConnection()->exec('CREATE TABLE foo (
                                       id      INTEGNER NOT NULL,
-                                      col1    VARCHAR(10) NOT NULL  
+                                      col1    VARCHAR(10) NOT NULL
                                     )');
 
         $db->insert('foo', array('id'=>1,'col1'=>'original'));
-        
+
         $channel->flush();
         $response->sendHeaders();
 
         print 'Test Doc Example without Controller';
         break;
-  
+
 }

+ 11 - 11
demos/Zend/Wildfire/public/Boot/Zend-Log-Writer-Firebug/TestDocExample.php

@@ -4,38 +4,38 @@ require_once('Zend/Loader.php');
 Zend_Loader::registerAutoload();
 
 switch($_GET['Example']) {
-    
+
     case 'WithController':
-    
+
         $writer = new Zend_Log_Writer_Firebug();
         $logger = new Zend_Log($writer);
         Zend_Registry::set('logger',$logger);
-        
+
         $controller = Zend_Controller_Front::getInstance();
         $controller->setParam('useDefaultControllerAlways',true);
-        $controller->setParam('noViewRenderer', true);        
+        $controller->setParam('noViewRenderer', true);
         $controller->setControllerDirectory(dirname(dirname(dirname(dirname(__FILE__)))).'/application/controllers/Boot/Zend-Log-Writer-Firebug');
         $controller->dispatch();
-        
+
         print 'Test Doc Example with Controller';
         break;
-  
+
     case 'WithoutController':
-    
+
         $writer = new Zend_Log_Writer_Firebug();
         $logger = new Zend_Log($writer);
-        
+
         $request = new Zend_Controller_Request_Http();
         $response = new Zend_Controller_Response_Http();
         $channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
         $channel->setRequest($request);
         $channel->setResponse($response);
-        
+
         $logger->log('This is a log message!', Zend_Log::INFO);
-        
+
         $channel->flush();
         $response->sendHeaders();
-        
+
         print 'Test Doc Example without Controller';
         break;
 }

+ 1 - 1
demos/Zend/Wildfire/public/index.php

@@ -42,7 +42,7 @@ Zend_Registry::set('logger',$logger);
 /*
  * Add our Firebug DB Profiler to the registry
  */
- 
+
 require_once 'Zend/Db.php';
 require_once 'Zend/Db/Profiler/Firebug.php';
 

+ 4 - 4
library/Zend/Acl.php

@@ -1130,14 +1130,14 @@ class Zend_Acl
         return $visitor['byRoleId'][$roleId];
     }
 
-    
+
     /**
      * @return array of registered roles
      *
      */
     public function getRegisteredRoles()
-    { 
-        return $this->_getRoleRegistry()->getRoles(); 
-    } 
+    {
+        return $this->_getRoleRegistry()->getRoles();
+    }
 
 }

+ 1 - 1
library/Zend/Acl/Role.php

@@ -70,6 +70,6 @@ class Zend_Acl_Role implements Zend_Acl_Role_Interface
      */
     public function __toString()
     {
-    	return $this->getRoleId();
+        return $this->getRoleId();
     }
 }

+ 3 - 3
library/Zend/Acl/Role/Registry.php

@@ -264,8 +264,8 @@ class Zend_Acl_Role_Registry
     }
 
     public function getRoles()
-    { 
-        return $this->_roles; 
-    } 
+    {
+        return $this->_roles;
+    }
 
 }

+ 2 - 2
library/Zend/Amf/Adobe/Introspector.php

@@ -189,9 +189,9 @@ class Zend_Amf_Adobe_Introspector
 
                     $ptype = $this->_registerType($type);
                     $arg->setAttribute('type', $ptype);
-                    
+
                     if($param->isDefaultValueAvailable()) {
-                    	$arg->setAttribute('defaultvalue', $param->getDefaultValue());
+                        $arg->setAttribute('defaultvalue', $param->getDefaultValue());
                     }
 
                     $op->appendChild($arg);

+ 3 - 3
library/Zend/Application.php

@@ -50,7 +50,7 @@ class Zend_Application
 
     /**
      * Flattened (lowercase) option keys
-     * 
+     *
      * @var array
      */
     protected $_optionKeys = array();
@@ -149,8 +149,8 @@ class Zend_Application
             $autoloader = $this->getAutoloader();
             if (method_exists($autoloader, 'setZfPath')) {
                 $zfPath    = $options['autoloaderzfpath'];
-                $zfVersion = !empty($options['autoloaderzfversion']) 
-                           ? $options['autoloaderzfversion'] 
+                $zfVersion = !empty($options['autoloaderzfversion'])
+                           ? $options['autoloaderzfversion']
                            : 'latest';
                 $autoloader->setZfPath($zfPath, $zfVersion);
             }

+ 1 - 1
library/Zend/Application/Bootstrap/BootstrapAbstract.php

@@ -57,7 +57,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
 
     /**
      * Flattened (lowercase) option keys used for lookups
-     * 
+     *
      * @var array
      */
     protected $_optionKeys = array();

+ 3 - 3
library/Zend/Application/Resource/Dojo.php

@@ -58,13 +58,13 @@ class Zend_Application_Resource_Dojo
         if (null === $this->_dojo) {
             $this->getBootstrap()->bootstrap('view');
             $view = $this->getBootstrap()->view;
-            
+
             Zend_Dojo::enableView($view);
             $view->dojo()->setOptions($this->getOptions());
-            
+
             $this->_dojo = $view->dojo();
         }
-        
+
         return $this->_dojo;
     }
 }

+ 1 - 1
library/Zend/Application/Resource/Modules.php

@@ -92,7 +92,7 @@ class Zend_Application_Resource_Modules extends Zend_Application_Resource_Resour
             }
 
             if ($bootstrapClass == $curBootstrapClass) {
-                // If the found bootstrap class matches the one calling this 
+                // If the found bootstrap class matches the one calling this
                 // resource, don't re-execute.
                 continue;
             }

+ 1 - 1
library/Zend/Application/Resource/Router.php

@@ -75,7 +75,7 @@ class Zend_Application_Resource_Router
 
             $this->_router->addConfig(new Zend_Config($options['routes']));
         }
-        
+
         return $this->_router;
     }
 }

+ 6 - 6
library/Zend/Application/Resource/Translate.php

@@ -76,19 +76,19 @@ class Zend_Application_Resource_Translate extends Zend_Application_Resource_Reso
             if(Zend_Registry::isRegistered($key)) {
                 $translate = Zend_Registry::get($key);
                 if(!$translate instanceof Zend_Translate) {
-                	require_once 'Zend/Application/Resource/Exception.php';
-                	throw new Zend_Application_Resource_Exception($key
-                	               . ' already registered in registry but is '
-                	               . 'no instance of Zend_Translate');
+                    require_once 'Zend/Application/Resource/Exception.php';
+                    throw new Zend_Application_Resource_Exception($key
+                                   . ' already registered in registry but is '
+                                   . 'no instance of Zend_Translate');
                 }
-                
+
                 $translate->addTranslation($options['data'], $locale, $options);
                 $this->_translate = $translate;
             } else {
                 $this->_translate = new Zend_Translate(
                     $adapter, $options['data'], $locale, $translateOptions
                 );
-                
+
                 Zend_Registry::set($key, $this->_translate);
             }
         }

+ 2 - 2
library/Zend/Auth.php

@@ -119,11 +119,11 @@ class Zend_Auth
         /**
          * ZF-7546 - prevent multiple succesive calls from storing inconsistent results
          * Ensure storage has clean state
-         */ 
+         */
         if ($this->hasIdentity()) {
             $this->clearIdentity();
         }
-        
+
         if ($result->isValid()) {
             $this->getStorage()->write($result->getIdentity());
         }

+ 3 - 3
library/Zend/Auth/Adapter/DbTable.php

@@ -315,7 +315,7 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface
 
     /**
      * _authenticateSetup() - This method abstracts the steps involved with
-     * making sure that this adapter was indeed setup properly with all 
+     * making sure that this adapter was indeed setup properly with all
      * required pieces of information.
      *
      * @throws Zend_Auth_Adapter_Exception - in the event that setup was not done properly
@@ -421,7 +421,7 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface
     }
 
     /**
-     * _authenticateValidateResultSet() - This method attempts to make 
+     * _authenticateValidateResultSet() - This method attempts to make
      * certain that only one record was returned in the resultset
      *
      * @param array $resultIdentities
@@ -454,7 +454,7 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface
     protected function _authenticateValidateResult($resultIdentity)
     {
         $zendAuthCredentialMatchColumn = $this->_zendDb->foldCase('zend_auth_credential_match');
-        
+
         if ($resultIdentity[$zendAuthCredentialMatchColumn] != '1') {
             $this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
             $this->_authenticateResultInfo['messages'][] = 'Supplied credential is invalid.';

+ 1 - 1
library/Zend/CodeGenerator/Php/Parameter.php

@@ -82,7 +82,7 @@ class Zend_CodeGenerator_Php_Parameter extends Zend_CodeGenerator_Php_Abstract
                 $param->setType($typeClass->getName());
             }
         }
-        
+
         $param->setPosition($reflectionParameter->getPosition());
 
         if($reflectionParameter->isOptional()) {

+ 4 - 4
library/Zend/Controller/Plugin/ActionStack.php

@@ -65,7 +65,7 @@ class Zend_Controller_Plugin_ActionStack extends Zend_Controller_Plugin_Abstract
      * @var Bool
      */
     protected $_clearRequestParams = false;
- 
+
     /**
      * Constructor
      *
@@ -144,7 +144,7 @@ class Zend_Controller_Plugin_ActionStack extends Zend_Controller_Plugin_Abstract
         $this->_clearRequestParams = (bool) $clearRequestParams;
         return $this;
     }
- 
+
     /**
      * Retrieve clearRequestParams flag
      *
@@ -154,7 +154,7 @@ class Zend_Controller_Plugin_ActionStack extends Zend_Controller_Plugin_Abstract
     {
         return $this->_clearRequestParams;
     }
- 
+
     /**
      * Retrieve action stack
      *
@@ -270,7 +270,7 @@ class Zend_Controller_Plugin_ActionStack extends Zend_Controller_Plugin_Abstract
         if ($this->getClearRequestParams()) {
             $request->clearParams();
         }
-        
+
         $request->setModuleName($next->getModuleName())
                 ->setControllerName($next->getControllerName())
                 ->setActionName($next->getActionName())

+ 9 - 9
library/Zend/Controller/Request/Http.php

@@ -517,7 +517,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
             if (($pos = strpos($requestUri, '?')) !== false) {
                 $truncatedRequestUri = substr($requestUri, 0, $pos);
             }
-            
+
             $basename = basename($baseUrl);
             if (empty($basename) || !strpos($truncatedRequestUri, $basename)) {
                 // no match whatsoever; set it blank
@@ -736,17 +736,17 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
     {
         $return       = $this->_params;
         $paramSources = $this->getParamSources();
-        if (in_array('_GET', $paramSources) 
-            && isset($_GET) 
+        if (in_array('_GET', $paramSources)
+            && isset($_GET)
             && is_array($_GET)
-        ) { 
-            $return += $_GET; 
+        ) {
+            $return += $_GET;
         }
-        if (in_array('_POST', $paramSources) 
-            && isset($_POST) 
+        if (in_array('_POST', $paramSources)
+            && isset($_POST)
             && is_array($_POST)
-        ) { 
-            $return += $_POST; 
+        ) {
+            $return += $_POST;
         }
         return $return;
     }

+ 17 - 17
library/Zend/Controller/Router/Rewrite.php

@@ -72,11 +72,11 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
      * @var string
      */
     protected $_chainNameSeparator = '-';
-    
+
     /**
      * Determines if request parameters should be used as global parameters
      * inside this router.
-     * 
+     *
      * @var boolean
      */
     protected $_useCurrentParamsAsGlobal = false;
@@ -401,12 +401,12 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
         }
 
         if($this->_useCurrentParamsAsGlobal) {
-        	$params = $request->getParams();
+            $params = $request->getParams();
             foreach($params as $param => $value) {
-            	$this->setGlobalParam($param, $value);
+                $this->setGlobalParam($param, $value);
             }
-        }            
-        
+        }
+
         return $request;
 
     }
@@ -496,25 +496,25 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
     public function getChainNameSeparator() {
         return $this->_chainNameSeparator;
     }
-    
+
     /**
      * Determines/returns whether to use the request parameters as global parameters.
-     * 
-     * @param boolean|null $use 
+     *
+     * @param boolean|null $use
      *           Null/unset when you want to retrieve the current state.
      *           True when request parameters should be global, false otherwise
      * @return boolean|Zend_Controller_Router_Rewrite
      *              Returns a boolean if first param isn't set, returns an
      *              instance of Zend_Controller_Router_Rewrite otherwise.
-     *                                                 
+     *
      */
     public function useRequestParametersAsGlobal($use = null) {
-    	if($use === null) {
-    		return $this->_useCurrentParamsAsGlobal;
-    	}
-    	
-    	$this->_useCurrentParamsAsGlobal = (bool) $use;
-    	
-    	return $this;
+        if($use === null) {
+            return $this->_useCurrentParamsAsGlobal;
+        }
+
+        $this->_useCurrentParamsAsGlobal = (bool) $use;
+
+        return $this;
     }
 }

+ 39 - 39
library/Zend/Db/Adapter/Pdo/Mssql.php

@@ -254,7 +254,7 @@ class Zend_Db_Adapter_Pdo_Mssql extends Zend_Db_Adapter_Pdo_Abstract
         if ($schemaName != null) {
             $sql .= ", @table_owner = " . $this->quoteIdentifier($schemaName, true);
         }
-        
+
         $stmt = $this->query($sql);
         $primaryKeysResult = $stmt->fetchAll(Zend_Db::FETCH_NUM);
         $primaryKeyColumn = array();
@@ -335,46 +335,46 @@ class Zend_Db_Adapter_Pdo_Mssql extends Zend_Db_Adapter_Pdo_Abstract
             'SELECT $1TOP ' . ($count+$offset) . ' ',
             $sql
             );
-        
+
         if ($offset > 0) {
-	        $orderby = stristr($sql, 'ORDER BY');
-	        
-	        if ($orderby !== false) {
-	            $orderParts = explode(',', substr($orderby, 8));
-	            $pregReplaceCount = null;
-	            $orderbyInverseParts = array();
-	            foreach ($orderParts as $orderPart) {
-	            	$orderPart = rtrim($orderPart);
-	                $inv = preg_replace('/\s+desc$/i', ' ASC', $orderPart, 1, $pregReplaceCount);
-	                if ($pregReplaceCount) {
-	                    $orderbyInverseParts[] = $inv;
-	                    continue;
-	                }
-	                $inv = preg_replace('/\s+asc$/i', ' DESC', $orderPart, 1, $pregReplaceCount);
-	                if ($pregReplaceCount) {
-	                    $orderbyInverseParts[] = $inv;
-	                    continue;
-	                } else {
-	                    $orderbyInverseParts[] = $orderPart . ' DESC';
-	                }
-	            }
-	            
-	            $orderbyInverse = 'ORDER BY ' . implode(', ', $orderbyInverseParts);
-	        }
-	
-	        
-	
-	
-	        $sql = 'SELECT * FROM (SELECT TOP ' . $count . ' * FROM (' . $sql . ') AS inner_tbl';
-	        if ($orderby !== false) {
-	            $sql .= ' ' . $orderbyInverse . ' ';
-	        }
-	        $sql .= ') AS outer_tbl';
-	        if ($orderby !== false) {
-	            $sql .= ' ' . $orderby;
-	        }
+            $orderby = stristr($sql, 'ORDER BY');
+
+            if ($orderby !== false) {
+                $orderParts = explode(',', substr($orderby, 8));
+                $pregReplaceCount = null;
+                $orderbyInverseParts = array();
+                foreach ($orderParts as $orderPart) {
+                    $orderPart = rtrim($orderPart);
+                    $inv = preg_replace('/\s+desc$/i', ' ASC', $orderPart, 1, $pregReplaceCount);
+                    if ($pregReplaceCount) {
+                        $orderbyInverseParts[] = $inv;
+                        continue;
+                    }
+                    $inv = preg_replace('/\s+asc$/i', ' DESC', $orderPart, 1, $pregReplaceCount);
+                    if ($pregReplaceCount) {
+                        $orderbyInverseParts[] = $inv;
+                        continue;
+                    } else {
+                        $orderbyInverseParts[] = $orderPart . ' DESC';
+                    }
+                }
+
+                $orderbyInverse = 'ORDER BY ' . implode(', ', $orderbyInverseParts);
+            }
+
+
+
+
+            $sql = 'SELECT * FROM (SELECT TOP ' . $count . ' * FROM (' . $sql . ') AS inner_tbl';
+            if ($orderby !== false) {
+                $sql .= ' ' . $orderbyInverse . ' ';
+            }
+            $sql .= ') AS outer_tbl';
+            if ($orderby !== false) {
+                $sql .= ' ' . $orderby;
+            }
         }
-        
+
         return $sql;
     }
 

+ 2 - 2
library/Zend/Db/Adapter/Pdo/Sqlite.php

@@ -198,11 +198,11 @@ class Zend_Db_Adapter_Pdo_Sqlite extends Zend_Db_Adapter_Pdo_Abstract
     public function describeTable($tableName, $schemaName = null)
     {
         $sql = 'PRAGMA ';
-        
+
         if ($schemaName) {
             $sql .= $this->quoteIdentifier($schemaName) . '.';
         }
-        
+
         $sql .= 'table_info('.$this->quoteIdentifier($tableName).')';
 
         $stmt = $this->query($sql);

+ 5 - 5
library/Zend/Db/Statement.php

@@ -46,7 +46,7 @@ abstract class Zend_Db_Statement implements Zend_Db_Statement_Interface
      * @var resource|object The driver level statement object/resource
      */
     protected $_stmt = null;
-    
+
     /**
      * @var Zend_Db_Adapter_Abstract
      */
@@ -120,14 +120,14 @@ abstract class Zend_Db_Statement implements Zend_Db_Statement_Interface
     /**
      * Internal method called by abstract statment constructor to setup
      * the driver level statement
-     * 
+     *
      * @return void
      */
     protected function _prepare($sql)
     {
         return;
     }
-    
+
     /**
      * @param string $sql
      * @return void
@@ -472,9 +472,9 @@ abstract class Zend_Db_Statement implements Zend_Db_Statement_Interface
     {
         return $this->_adapter;
     }
-    
+
     /**
-     * Gets the resource or object setup by the 
+     * Gets the resource or object setup by the
      * _parse
      * @return unknown_type
      */

+ 1 - 1
library/Zend/Db/Statement/Exception.php

@@ -55,7 +55,7 @@ class Zend_Db_Statement_Exception extends Zend_Db_Exception
 
     /**
      * Check if this general exception has a specific database driver specific exception nested inside.
-     * 
+     *
      * @return bool
      */
     public function hasChainedException()

+ 6 - 6
library/Zend/Db/Statement/Mysqli.php

@@ -275,12 +275,12 @@ class Zend_Db_Statement_Mysqli extends Zend_Db_Statement
         // fetch the next result
         $retval = $this->_stmt->fetch();
         switch ($retval) {
-	        case null: // end of data
-	        case false: // error occurred
-	            $this->_stmt->reset();
-	            return false;
-	        default:
-	            // fallthrough
+            case null: // end of data
+            case false: // error occurred
+                $this->_stmt->reset();
+                return false;
+            default:
+                // fallthrough
         }
 
         // make sure we have a fetch mode

+ 2 - 2
library/Zend/Db/Statement/Pdo.php

@@ -132,9 +132,9 @@ class Zend_Db_Statement_Pdo extends Zend_Db_Statement implements IteratorAggrega
         if (is_string($parameter) && $parameter[0] != ':') {
             $parameter = ":$parameter";
         }
-        
+
         $this->_bindParam[$parameter] = $value;
-        
+
         try {
             if ($type === null) {
                 return $this->_stmt->bindValue($parameter, $value);

+ 3 - 3
library/Zend/Db/Table/Abstract.php

@@ -803,10 +803,10 @@ abstract class Zend_Db_Table_Abstract
         // If $this has a metadata cache
         if (null !== $this->_metadataCache) {
             // Define the cache identifier where the metadata are saved
-            
+
             //get db configuration
             $dbConfig = $this->_db->getConfig();
-                
+
             // Define the cache identifier where the metadata are saved
             $cacheId = md5( // port:host/dbname:schema.table (based on availabilty)
                 (isset($dbConfig['options']['port']) ? ':'.$dbConfig['options']['port'] : null)
@@ -1286,7 +1286,7 @@ abstract class Zend_Db_Table_Abstract
             }
             return new $rowsetClass(array('table' => $this, 'rowClass' => $this->getRowClass(), 'stored' => true));
         }
-        
+
         return $this->fetchAll($whereClause);
     }
 

+ 1 - 1
library/Zend/Db/Table/Select.php

@@ -195,7 +195,7 @@ class Zend_Db_Table_Select extends Zend_Db_Select
 
 
         if (count($this->_parts[self::UNION]) == 0) {
-            
+
             // If no fields are specified we assume all fields from primary table
             if (!count($fields)) {
                 $this->from($primary, self::SQL_WILDCARD, $schema);

+ 4 - 4
library/Zend/Dojo/View/Helper/Dojo/Container.php

@@ -201,10 +201,10 @@ class Zend_Dojo_View_Helper_Dojo_Container
     {
         return $this->_enabled;
     }
-    
+
     /**
      * Add options for the Dojo Container to use
-     * 
+     *
      * @param array|Zend_Config Array or Zend_Config object with options to use
      * @return Zend_Dojo_View_Helper_Dojo_Container
      */
@@ -263,7 +263,7 @@ class Zend_Dojo_View_Helper_Dojo_Container
                     break;
             }
         }
-        
+
         return $this;
     }
 
@@ -345,7 +345,7 @@ class Zend_Dojo_View_Helper_Dojo_Container
         if (!in_array($path, $this->_layers)) {
             $this->_layers[] = $path;
         }
-        
+
         return $this;
     }
 

+ 1 - 1
library/Zend/Dojo/View/Helper/Editor.php

@@ -112,7 +112,7 @@ class Zend_Dojo_View_Helper_Editor extends Zend_Dojo_View_Helper_Textarea
     }
 
     /**
-     * Generates the list of required modules to include, if any is needed. 
+     * Generates the list of required modules to include, if any is needed.
      *
      * @param array $plugins plugins to include
      * @return array

+ 5 - 5
library/Zend/Feed/Reader/Extension/Atom/Entry.php

@@ -268,7 +268,7 @@ class Zend_Feed_Reader_Extension_Atom_Entry
 
         return $this->_data['id'];
     }
-    
+
     /**
      * Get the base URI of the feed (if set).
      *
@@ -279,11 +279,11 @@ class Zend_Feed_Reader_Extension_Atom_Entry
         if (array_key_exists('baseUrl', $this->_data)) {
             return $this->_data['baseUrl'];
         }
-        
+
         $baseUrl = $this->_xpath->evaluate('string('
             . $this->getXpathPrefix() . '/@xml:base[1]'
         . ')');
-        
+
         if (!$baseUrl) {
             $baseUrl = $this->_xpath->evaluate('string(//@xml:base[1])');
         }
@@ -291,7 +291,7 @@ class Zend_Feed_Reader_Extension_Atom_Entry
         if (!$baseUrl) {
             $baseUrl = null;
         }
-        
+
         $this->_data['baseUrl'] = $baseUrl;
 
         return $this->_data['baseUrl'];
@@ -459,7 +459,7 @@ class Zend_Feed_Reader_Extension_Atom_Entry
 
         return $this->_data['commentfeedlink'];
     }
-    
+
     /**
      *  Attempt to absolutise the URI, i.e. if a relative URI apply the
      *  xml:base value as a prefix to turn into an absolute URI.

+ 4 - 4
library/Zend/Feed/Reader/Extension/Atom/Feed.php

@@ -298,7 +298,7 @@ class Zend_Feed_Reader_Extension_Atom_Feed
 
         return $this->_data['language'];
     }
-    
+
     /**
      * Get the base URI of the feed (if set).
      *
@@ -332,12 +332,12 @@ class Zend_Feed_Reader_Extension_Atom_Feed
         }
 
         $link = null;
-        
+
         $list = $this->_xpath->query(
             $this->getXpathPrefix() . '/atom:link[@rel="alternate"]/@href' . '|' .
             $this->getXpathPrefix() . '/atom:link[not(@rel)]/@href'
         );
-        
+
         if ($list->length) {
             $link = $list->item(0)->nodeValue;
             $link = $this->_absolutiseUri($link);
@@ -455,7 +455,7 @@ class Zend_Feed_Reader_Extension_Atom_Feed
 
         return null;
     }
-    
+
     /**
      *  Attempt to absolutise the URI, i.e. if a relative URI apply the
      *  xml:base value as a prefix to turn into an absolute URI.

+ 1 - 1
library/Zend/Feed/Reader/Feed/Atom.php

@@ -239,7 +239,7 @@ class Zend_Feed_Reader_Feed_Atom extends Zend_Feed_Reader_FeedAbstract
 
         return $this->_data['language'];
     }
-    
+
     /**
      * Get a link to the source website
      *

+ 6 - 6
library/Zend/Filter/Compress.php

@@ -65,8 +65,8 @@ class Zend_Filter_Compress implements Zend_Filter_Interface
 
     /**
      * Set filter setate
-     * 
-     * @param  array $options 
+     *
+     * @param  array $options
      * @return Zend_Filter_Compress
      */
     public function setOptions(array $options)
@@ -114,7 +114,7 @@ class Zend_Filter_Compress implements Zend_Filter_Interface
 
     /**
      * Retrieve adapter name
-     * 
+     *
      * @return string
      */
     public function getAdapterName()
@@ -145,7 +145,7 @@ class Zend_Filter_Compress implements Zend_Filter_Interface
 
     /**
      * Retrieve adapter options
-     * 
+     *
      * @return array
      */
     public function getAdapterOptions()
@@ -155,8 +155,8 @@ class Zend_Filter_Compress implements Zend_Filter_Interface
 
     /**
      * Set adapter options
-     * 
-     * @param  array $options 
+     *
+     * @param  array $options
      * @return void
      */
     public function setAdapterOptions(array $options)

+ 1 - 1
library/Zend/Filter/Compress/CompressInterface.php

@@ -47,7 +47,7 @@ interface Zend_Filter_Compress_CompressInterface
 
     /**
      * Return the adapter name
-     * 
+     *
      * @return string
      */
     public function toString();

+ 1 - 1
library/Zend/Filter/Null.php

@@ -128,7 +128,7 @@ class Zend_Filter_Null implements Zend_Filter_Interface
     /**
      * Defined by Zend_Filter_Interface
      *
-     * Returns null representation of $value, if value is empty and matches 
+     * Returns null representation of $value, if value is empty and matches
      * types that should be considered null.
      *
      * @param  string $value

+ 1 - 1
library/Zend/Form.php

@@ -1220,7 +1220,7 @@ class Zend_Form implements Iterator, Countable, Zend_Validate_Interface
      * Set default values for elements
      *
      * Sets values for all elements specified in the array of $defaults.
-     * 
+     *
      * @param  array $defaults
      * @return Zend_Form
      */

+ 1 - 1
library/Zend/Form/Element.php

@@ -98,7 +98,7 @@ class Zend_Form_Element implements Zend_Validate_Interface
     protected $_errors = array();
 
     /**
-     * Separator to use when concatenating aggregate error messages (for 
+     * Separator to use when concatenating aggregate error messages (for
      * elements having array values)
      * @var string
      */

+ 1 - 1
library/Zend/Form/Element/Captcha.php

@@ -154,7 +154,7 @@ class Zend_Form_Element_Captcha extends Zend_Form_Element_Xhtml
      */
     public function setOptions(array $options)
     {
-    	parent::setOptions($options);
+        parent::setOptions($options);
         if (array_key_exists('captcha', $options)) {
             if (array_key_exists('captchaOptions', $options)) {
                 $this->setCaptcha($options['captcha'], $options['captchaOptions']);

+ 1 - 1
library/Zend/Form/Element/Radio.php

@@ -44,7 +44,7 @@ class Zend_Form_Element_Radio extends Zend_Form_Element_Multi
      * Load default decorators
      *
      * Disables "for" attribute of label if label decorator enabled.
-     * 
+     *
      * @return void
      */
     public function loadDefaultDecorators()

+ 3 - 3
library/Zend/Gdata/HttpClient.php

@@ -98,10 +98,10 @@ class Zend_Gdata_HttpClient extends Zend_Http_Client
                                              $useIncludePath = false) {
         $fp = @fopen($file, "r", $useIncludePath);
         if (!$fp) {
-        	require_once 'Zend/Gdata/App/InvalidArgumentException.php';
-        	throw new Zend_Gdata_App_InvalidArgumentException('Failed to open private key file for AuthSub.');
+            require_once 'Zend/Gdata/App/InvalidArgumentException.php';
+            throw new Zend_Gdata_App_InvalidArgumentException('Failed to open private key file for AuthSub.');
         }
-        
+
         $key = '';
         while (!feof($fp)) {
             $key .= fread($fp, 8192);

+ 2 - 2
library/Zend/Http/Client.php

@@ -834,7 +834,7 @@ class Zend_Http_Client
         unset($config['adapter']);
         $this->adapter->setConfig($config);
     }
-    
+
     /**
      * Load the connection adapter
      *
@@ -842,7 +842,7 @@ class Zend_Http_Client
      */
     public function getAdapter()
     {
-    	return $this->adapter;
+        return $this->adapter;
     }
 
     /**

+ 2 - 2
library/Zend/Json/Server/Response.php

@@ -173,7 +173,7 @@ class Zend_Json_Server_Response
     {
         if ($this->isError()) {
             $response = array(
-            	'result' => null,
+                'result' => null,
                 'error'  => $this->getError()->toArray(),
                 'id'     => $this->getId(),
             );
@@ -181,7 +181,7 @@ class Zend_Json_Server_Response
             $response = array(
                 'result' => $this->getResult(),
                 'id'     => $this->getId(),
-            	'error'  => null,
+                'error'  => null,
             );
         }
 

+ 9 - 9
library/Zend/Loader/Autoloader.php

@@ -495,15 +495,15 @@ class Zend_Loader_Autoloader
 
     /**
      * Retrieve the filesystem path for the requested ZF version
-     * 
-     * @param  string $path 
-     * @param  string $version 
+     *
+     * @param  string $path
+     * @param  string $version
      * @return void
      */
     protected function _getVersionPath($path, $version)
     {
         $type = $this->_getVersionType($version);
-        
+
         if ($type == 'latest') {
             $version = 'latest';
         }
@@ -519,8 +519,8 @@ class Zend_Loader_Autoloader
 
     /**
      * Retrieve the ZF version type
-     * 
-     * @param  string $version 
+     *
+     * @param  string $version
      * @return string "latest", "major", "minor", or "specific"
      * @throws Zend_Loader_Exception if version string contains too many dots
      */
@@ -546,9 +546,9 @@ class Zend_Loader_Autoloader
 
     /**
      * Get available versions for the version type requested
-     * 
-     * @param  string $path 
-     * @param  string $version 
+     *
+     * @param  string $path
+     * @param  string $version
      * @return array
      */
     protected function _getAvailableVersions($path, $version)

+ 4 - 4
library/Zend/Queue/Adapter/Memcacheq.php

@@ -54,7 +54,7 @@ class Zend_Queue_Adapter_Memcacheq extends Zend_Queue_Adapter_AdapterAbstract
      * @var integer
      */
     protected $_port = null;
-    
+
     /**
      * @var resource
      */
@@ -139,7 +139,7 @@ class Zend_Queue_Adapter_Memcacheq extends Zend_Queue_Adapter_AdapterAbstract
         if (empty($this->_queues)) {
             $this->getQueues();
         }
-        
+
         return in_array($name, $this->_queues);
     }
 
@@ -171,7 +171,7 @@ class Zend_Queue_Adapter_Memcacheq extends Zend_Queue_Adapter_AdapterAbstract
         // depend on the current name.
         $result = $this->_cache->set($name, 'creating queue', 0, 15);
         $result = $this->_cache->get($name);
-        
+
         $this->_queues[] = $name;
 
         return true;
@@ -214,7 +214,7 @@ class Zend_Queue_Adapter_Memcacheq extends Zend_Queue_Adapter_AdapterAbstract
     public function getQueues()
     {
         $this->_queues = array();
-        
+
         $response = $this->_sendCommand('stats queue', array('END'));
 
         foreach ($response as $i => $line) {

+ 1 - 1
library/Zend/Reflection/Docblock.php

@@ -101,7 +101,7 @@ class Zend_Reflection_Docblock implements Reflector
 
         $str .= "  }".PHP_EOL;
         $str .= "}".PHP_EOL;
-        
+
         return $str;
     }
 

+ 5 - 5
library/Zend/Rest/Route.php

@@ -201,10 +201,10 @@ class Zend_Rest_Route extends Zend_Controller_Router_Route_Module
         $this->_values = $values + $params;
 
         $result = $this->_values + $this->_defaults;
-        
+
         if ($partial && $result)
-        	$this->setMatchedPath($request->getPathInfo());
-        	
+            $this->setMatchedPath($request->getPathInfo());
+
         return $result;
     }
 
@@ -340,7 +340,7 @@ class Zend_Rest_Route extends Zend_Controller_Router_Route_Module
         if ($this->_fullRestfulModule($moduleName)) {
             return true;
         }
-        if ($this->_checkRestfulModule($moduleName) 
+        if ($this->_checkRestfulModule($moduleName)
             && $this->_restfulControllers
             && (false !== array_search($controllerName, $this->_restfulControllers[$moduleName]))
         ) {
@@ -368,7 +368,7 @@ class Zend_Rest_Route extends Zend_Controller_Router_Route_Module
     private function _fullRestfulModule($moduleName)
     {
         return (
-            $this->_restfulModules 
+            $this->_restfulModules
             && (false !==array_search($moduleName, $this->_restfulModules))
         );
     }

+ 1 - 1
library/Zend/Service/Amazon/Abstract.php

@@ -95,7 +95,7 @@ abstract class Zend_Service_Amazon_Abstract extends Zend_Service_Abstract
         $this->_secretKey = $secretKey;
     }
 
-    
+
 
     /**
      * Method to fetch the Access Key

+ 9 - 9
library/Zend/Service/Amazon/Ec2/Abstract.php

@@ -70,12 +70,12 @@ abstract class Zend_Service_Amazon_Ec2_Abstract extends Zend_Service_Amazon_Abst
      * Period after which HTTP request will timeout in seconds
      */
     protected $_httpTimeout = 10;
-    
+
     /**
      * @var string Amazon Region
      */
     protected static $_defaultRegion = null;
-    
+
     /**
      * @var string Amazon Region
      */
@@ -87,8 +87,8 @@ abstract class Zend_Service_Amazon_Ec2_Abstract extends Zend_Service_Amazon_Abst
      * @var array
      */
     protected static $_validEc2Regions = array('eu-west-1', 'us-east-1');
-    
-	/**
+
+    /**
      * Create Amazon client.
      *
      * @param  string $access_key       Override the default Access Key
@@ -109,11 +109,11 @@ abstract class Zend_Service_Amazon_Ec2_Abstract extends Zend_Service_Amazon_Abst
         }
 
         $this->_region = $region;
-        
+
         parent::__construct($accessKey, $secretKey);
     }
-    
-	/**
+
+    /**
      * Set which region you are working in.  It will append the
      * end point automaticly
      *
@@ -128,8 +128,8 @@ abstract class Zend_Service_Amazon_Ec2_Abstract extends Zend_Service_Amazon_Abst
             throw new Zend_Service_Amazon_Exception('Invalid Amazon Ec2 Region');
         }
     }
-    
-	/**
+
+    /**
      * Method to fetch the AWS Region
      *
      * @return string

+ 2 - 2
library/Zend/Service/Amazon/Ec2/CloudWatch.php

@@ -313,8 +313,8 @@ class Zend_Service_Amazon_Ec2_CloudWatch extends Zend_Service_Amazon_Ec2_Abstrac
      * Return the Metrics that are aviable for your current monitored instances
      *
      * @param string $nextToken     The NextToken parameter is an optional parameter
-     * 								that allows you to retrieve the next set of results
-     * 								for your ListMetrics query.
+     *                                 that allows you to retrieve the next set of results
+     *                                 for your ListMetrics query.
      * @return array
      */
     public function listMetrics($nextToken = null)

+ 2 - 2
library/Zend/Service/Amazon/Offer.php

@@ -87,8 +87,8 @@ class Zend_Service_Amazon_Offer
         $this->OfferListingId = (string) $xpath->query('./az:OfferListing/az:OfferListingId/text()', $dom)->item(0)->data;
         $Price = $xpath->query('./az:OfferListing/az:Price/az:Amount', $dom);
         if ($Price->length == 1) {
-        	$this->Price = (int) $xpath->query('./az:OfferListing/az:Price/az:Amount/text()', $dom)->item(0)->data;
-        	$this->CurrencyCode = (string) $xpath->query('./az:OfferListing/az:Price/az:CurrencyCode/text()', $dom)->item(0)->data;
+            $this->Price = (int) $xpath->query('./az:OfferListing/az:Price/az:Amount/text()', $dom)->item(0)->data;
+            $this->CurrencyCode = (string) $xpath->query('./az:OfferListing/az:Price/az:CurrencyCode/text()', $dom)->item(0)->data;
         }
         $availability = $xpath->query('./az:OfferListing/az:Availability/text()', $dom)->item(0);
         if($availability instanceof DOMText) {

+ 3 - 3
library/Zend/Service/Amazon/S3.php

@@ -283,9 +283,9 @@ class Zend_Service_Amazon_S3 extends Zend_Service_Amazon_Abstract
      *
      * Provides the list of object keys that are contained in the bucket.  Valid params include the following.
      * prefix - Limits the response to keys which begin with the indicated prefix. You can use prefixes to separate a bucket into different sets of keys in a way similar to how a file system uses folders.
-	 * marker - Indicates where in the bucket to begin listing. The list will only include keys that occur lexicographically after marker. This is convenient for pagination: To get the next page of results use the last key of the current page as the marker.
-	 * max-keys - The maximum number of keys you'd like to see in the response body. The server might return fewer than this many keys, but will not return more.
-	 * delimiter - Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response.
+     * marker - Indicates where in the bucket to begin listing. The list will only include keys that occur lexicographically after marker. This is convenient for pagination: To get the next page of results use the last key of the current page as the marker.
+     * max-keys - The maximum number of keys you'd like to see in the response body. The server might return fewer than this many keys, but will not return more.
+     * delimiter - Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response.
      *
      * @param  string $bucket
      * @param array $params S3 GET Bucket Paramater

+ 23 - 23
library/Zend/Service/Twitter.php

@@ -36,7 +36,7 @@ require_once 'Zend/Rest/Client/Result.php';
  */
 class Zend_Service_Twitter extends Zend_Rest_Client
 {
-    
+
     /**
      * 246 is the current limit for a status message, 140 characters are displayed
      * initially, with the remainder linked from the web UI or client. The limit is
@@ -46,7 +46,7 @@ class Zend_Service_Twitter extends Zend_Rest_Client
      * This should be reviewed in the future...
      */
     const STATUS_MAX_CHARACTERS = 246;
-    
+
     /**
      * Whether or not authorization has been initialized for the current user.
      * @var bool
@@ -81,7 +81,7 @@ class Zend_Service_Twitter extends Zend_Rest_Client
      * @var array
      */
     protected $_methodTypes = array('status', 'user', 'directMessage', 'friendship', 'account', 'favorite', 'block');
-    
+
     /**
      * Local HTTP Client cloned from statically set client
      * @var Zend_Http_Client
@@ -214,7 +214,7 @@ class Zend_Service_Twitter extends Zend_Rest_Client
             include_once 'Zend/Service/Twitter/Exception.php';
             throw new Zend_Service_Twitter_Exception('Invalid method "' . $test . '"');
         }
-        
+
         return call_user_func_array(array($this, $test), $params);
     }
 
@@ -475,7 +475,7 @@ class Zend_Service_Twitter extends Zend_Rest_Client
         $this->_init();
         $path = '/statuses/friends';
         $_params = array();
-        
+
         foreach ($params as $key => $value) {
             switch (strtolower($key)) {
                 case 'id':
@@ -489,7 +489,7 @@ class Zend_Service_Twitter extends Zend_Rest_Client
             }
         }
         $path .= '.xml';
-        
+
         $response = $this->_get($path, $_params);
         return new Zend_Rest_Client_Result($response->getBody());
     }
@@ -795,8 +795,8 @@ class Zend_Service_Twitter extends Zend_Rest_Client
     /**
      * Blocks the user specified in the ID parameter as the authenticating user.
      * Destroys a friendship to the blocked user if it exists.
-     * 
-     * @param integer|string $id       The ID or screen name of a user to block. 
+     *
+     * @param integer|string $id       The ID or screen name of a user to block.
      * @return Zend_Rest_Client_Result
      */
     public function blockCreate($id)
@@ -809,8 +809,8 @@ class Zend_Service_Twitter extends Zend_Rest_Client
 
     /**
      * Un-blocks the user specified in the ID parameter for the authenticating user
-     * 
-     * @param integer|string $id       The ID or screen_name of the user to un-block. 
+     *
+     * @param integer|string $id       The ID or screen_name of the user to un-block.
      * @return Zend_Rest_Client_Result
      */
     public function blockDestroy($id)
@@ -822,9 +822,9 @@ class Zend_Service_Twitter extends Zend_Rest_Client
     }
 
     /**
-     * Returns if the authenticating user is blocking a target user. 
-     * 
-     * @param string|integer $id    The ID or screen_name of the potentially blocked user.    
+     * Returns if the authenticating user is blocking a target user.
+     *
+     * @param string|integer $id    The ID or screen_name of the potentially blocked user.
      * @param boolean $returnResult Instead of returning a boolean return the rest response from twitter
      * @return Boolean|Zend_Rest_Client_Result
      */
@@ -833,23 +833,23 @@ class Zend_Service_Twitter extends Zend_Rest_Client
         $this->_init();
         $path = '/blocks/exists/' . $id . '.xml';
         $response = $this->_get($path);
-        
+
         $cr = new Zend_Rest_Client_Result($response->getBody());
-        
+
         if ($returnResult === true)
             return $cr;
-        
+
         if (!empty($cr->request)) {
             return false;
         }
-        
+
         return true;
     }
 
     /**
      * Returns an array of user objects that the authenticating user is blocking
-     * 
-     * @param integer $page         Optional. Specifies the page number of the results beginning at 1. A single page contains 20 ids. 
+     *
+     * @param integer $page         Optional. Specifies the page number of the results beginning at 1. A single page contains 20 ids.
      * @param boolean $returnUserIds  Optional. Returns only the userid's instead of the whole user object
      * @return Zend_Rest_Client_Result
      */
@@ -909,15 +909,15 @@ class Zend_Service_Twitter extends Zend_Rest_Client
             require_once 'Zend/Rest/Client/Exception.php';
             throw new Zend_Rest_Client_Exception('URI object must be set before performing call');
         }
-        
+
         $uri = $this->_uri->getUri();
-        
+
         if ($path[0] != '/' && $uri[strlen($uri) - 1] != '/') {
             $path = '/' . $path;
         }
-        
+
         $this->_uri->setPath($path);
-        
+
         /**
          * Get the HTTP client and configure it for the endpoint URI.  Do this each time
          * because the Zend_Http_Client instance is shared among all Zend_Service_Abstract subclasses.

+ 2 - 2
library/Zend/Service/Yahoo.php

@@ -837,10 +837,10 @@ class Zend_Service_Yahoo
         $this->_validateInArray('format', $options['format'], array('any', 'html', 'msword', 'pdf', 'ppt', 'rss',
                                                                     'txt', 'xls'));
         if (isset($options['license'])) {
-        	$this->_validateInArray('license', $options['license'], array('any', 'cc_any', 'cc_commercial',
+            $this->_validateInArray('license', $options['license'], array('any', 'cc_any', 'cc_commercial',
                                                                       'cc_modifiable'));
         }
-        
+
         if (isset($options['region'])){
             $this->_validateInArray('region', $options['region'], array('ar', 'au', 'at', 'br', 'ca', 'ct', 'dk', 'fi',
                                                                           'fr', 'de', 'in', 'id', 'it', 'my', 'mx',

+ 1 - 1
library/Zend/Test/DbAdapter.php

@@ -228,7 +228,7 @@ class Zend_Test_DbAdapter extends Zend_Db_Adapter_Abstract
         } else {
             $stmt = new Zend_Test_DbStatement();
         }
-        
+
         if($this->getProfiler()->getEnabled() == true) {
             $qp = $this->getProfiler()->getQueryProfile($queryId);
             $stmt->setQueryProfile($qp);

+ 1 - 1
library/Zend/Test/PHPUnit/Db/Operation/Truncate.php

@@ -110,7 +110,7 @@ class Zend_Test_PHPUnit_Db_Operation_Truncate implements PHPUnit_Extensions_Data
 
     /**
      * Detect if an adapter is for Mssql or Oracle Databases.
-     * 
+     *
      * @param  Zend_Db_Adapter_Abstract $db
      * @return bool
      */

+ 1 - 1
library/Zend/Uri.php

@@ -158,7 +158,7 @@ abstract class Zend_Uri
         } elseif (!is_array($config)) {
             throw new Zend_Uri_Exception("Config must be an array or an instance of Zend_Config.");
         }
-        
+
         foreach ($config as $k => $v) {
             self::$_config[$k] = $v;
         }

+ 1 - 1
library/Zend/Validate/CreditCard.php

@@ -16,7 +16,7 @@
  * @package    Zend_Validate
  * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id:$
+ * @version    $Id$
  */
 
 /**

+ 8 - 8
library/Zend/Validate/Ip.php

@@ -67,10 +67,10 @@ class Zend_Validate_Ip extends Zend_Validate_Abstract
 
         return true;
     }
-    
+
     /**
      * Validates an IPv4 address
-     * 
+     *
      * @param string $value
      */
     protected function _validateIPv4($value) {
@@ -78,13 +78,13 @@ class Zend_Validate_Ip extends Zend_Validate_Abstract
         if($ip2long === false) {
             return false;
         }
-        
-        return $value == long2ip($ip2long); 
+
+        return $value == long2ip($ip2long);
     }
-    
+
     /**
      * Validates an IPv6 address
-     * 
+     *
      * @param string $value Value to check against
      * @return boolean True when $value is a valid ipv6 address
      *                 False otherwise
@@ -115,13 +115,13 @@ class Zend_Validate_Ip extends Zend_Validate_Abstract
             return preg_match('/\A(?::|(?:[a-f0-9]{1,4}:)+):(?:(?:[a-f0-9]{1,4}:)*[a-f0-9]{1,4})?\Z/i', $value);
         }
 
-        // special case with ending or starting double colon 
+        // special case with ending or starting double colon
         if ($colonCount == 8)
         {
             return preg_match('/\A(?:::)?(?:[a-f0-9]{1,4}:){6}[a-f0-9]{1,4}(?:::)?\Z/i', $value);
         }
 
-        return false; 
+        return false;
     }
 
 }

+ 1 - 1
library/Zend/View/Helper/FormCheckbox.php

@@ -87,7 +87,7 @@ class Zend_View_Helper_FormCheckbox extends Zend_View_Helper_FormElement
             $endTag= '>';
         }
 
-        // build the element 
+        // build the element
         $xhtml = '';
         if (!$disable && !strstr($name, '[]')) {
             $xhtml = $this->_hidden($name, $checkedOptions['uncheckedValue']);

+ 1 - 1
library/Zend/View/Helper/HeadTitle.php

@@ -63,7 +63,7 @@ class Zend_View_Helper_HeadTitle extends Zend_View_Helper_Placeholder_Container_
      */
     public function headTitle($title = null, $setType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND)
     {
-    	$title = (string) $title;
+        $title = (string) $title;
         if ($title !== '') {
             if ($setType == Zend_View_Helper_Placeholder_Container_Abstract::SET) {
                 $this->set($title);

+ 1 - 1
library/Zend/XmlRpc/Server/System.php

@@ -137,7 +137,7 @@ class Zend_XmlRpc_Server_System
                     $request->setMethod($method['methodName']);
                     $request->setParams($method['params']);
                     $response = $this->_server->handle($request);
-                    if ($response instanceof Zend_XmlRpc_Fault 
+                    if ($response instanceof Zend_XmlRpc_Fault
                         || $response->isFault()
                     ) {
                         $fault = $response;

+ 2 - 2
tests/AllTests.php

@@ -71,7 +71,7 @@ class AllTests
      *
      * These tests require no output be sent prior to running as they rely
      * on internal PHP functions.
-     * 
+     *
      * @return PHPUnit_Framework_TestSuite
      */
     public static function suiteBuffered()
@@ -87,7 +87,7 @@ class AllTests
      * Regular suite
      *
      * All tests except those that require output buffering.
-     * 
+     *
      * @return PHPUnit_Framework_TestSuite
      */
     public static function suite()

+ 51 - 51
tests/Zend/Acl/AclTest.php

@@ -98,7 +98,7 @@ class Zend_Acl_AclTest extends PHPUnit_Framework_TestCase
         $this->assertType('Zend_Acl_Role', $role);
         $this->assertEquals('area', $role->getRoleId());
     }
-    
+
     /**
      * Ensures that basic removal of a single Role works
      *
@@ -291,7 +291,7 @@ class Zend_Acl_AclTest extends PHPUnit_Framework_TestCase
         $resource = $this->_acl->get($resourceArea);
         $this->assertTrue($resourceArea === $resource);
     }
-    
+
     /**
      * Ensures that basic addition and retrieval of a single Resource works
      */
@@ -302,7 +302,7 @@ class Zend_Acl_AclTest extends PHPUnit_Framework_TestCase
         $this->assertType('Zend_Acl_Resource', $resource);
         $this->assertEquals('area', $resource->getResourceId());
     }
-    
+
     /**
      * Ensures that basic addition and retrieval of a single Resource works
      *
@@ -1090,7 +1090,7 @@ class Zend_Acl_AclTest extends PHPUnit_Framework_TestCase
      */
     public function testAclInternalDFSMethodsBehaveProperly()
     {
-    	require_once dirname(__FILE__) . '/_files/ExtendedAclZF2234.php';
+        require_once dirname(__FILE__) . '/_files/ExtendedAclZF2234.php';
         $acl = new Zend_Acl_ExtendedAclZF2234();
 
         $someResource = new Zend_Acl_Resource('someResource');
@@ -1130,72 +1130,72 @@ class Zend_Acl_AclTest extends PHPUnit_Framework_TestCase
             $this->assertEquals('$dfs parameter may not be null', $e->getMessage());
         }
     }
-    
-    
+
+
     /**
      * @group ZF-1721
      */
     public function testAclAssertionsGetProperRoleWhenInheritenceIsUsed()
     {
         $acl = $this->_loadUseCase1();
-        
+
         $user = new Zend_Acl_Role('publisher');
         $blogPost = new Zend_Acl_Resource('blogPost');
-        
+
         /**
          * @var Zend_Acl_UseCase1_UserIsBlogPostOwnerAssertion
          */
         $assertion = $acl->customAssertion;
-        
+
         $this->assertTrue($acl->isAllowed($user, $blogPost, 'modify'));
 
         $this->assertEquals('publisher', $assertion->lastAssertRole->getRoleId());
-        
+
     }
-    
+
     /**
-     * 
+     *
      * @group ZF-1722
      */
     public function testAclAssertionsGetOriginalIsAllowedObjects()
     {
-    	$acl = $this->_loadUseCase1();
-    	
-    	$user = new Zend_Acl_UseCase1_User();
-    	$blogPost = new Zend_Acl_UseCase1_BlogPost();
-    	
-    	$this->assertTrue($acl->isAllowed($user, $blogPost, 'view'));
-    	
-    	/**
-    	 * @var Zend_Acl_UseCase1_UserIsBlogPostOwnerAssertion
-    	 */
-    	$assertion = $acl->customAssertion;
-    	
-    	$assertion->assertReturnValue = true;
-    	$user->role = 'contributor';
-    	$this->assertTrue($acl->isAllowed($user, $blogPost, 'modify'), 'Assertion should return true');
-    	$assertion->assertReturnValue = false;
-    	$this->assertFalse($acl->isAllowed($user, $blogPost, 'modify'), 'Assertion should return false');
-
-    	// check to see if the last assertion has the proper objets
-    	$this->assertType('Zend_Acl_UseCase1_User', $assertion->lastAssertRole, 'Assertion did not recieve proper role object');
-    	$this->assertType('Zend_Acl_UseCase1_BlogPost', $assertion->lastAssertResource, 'Assertion did not recieve proper resource object');
-
-    }
-
-    /**
-     * 
+        $acl = $this->_loadUseCase1();
+
+        $user = new Zend_Acl_UseCase1_User();
+        $blogPost = new Zend_Acl_UseCase1_BlogPost();
+
+        $this->assertTrue($acl->isAllowed($user, $blogPost, 'view'));
+
+        /**
+         * @var Zend_Acl_UseCase1_UserIsBlogPostOwnerAssertion
+         */
+        $assertion = $acl->customAssertion;
+
+        $assertion->assertReturnValue = true;
+        $user->role = 'contributor';
+        $this->assertTrue($acl->isAllowed($user, $blogPost, 'modify'), 'Assertion should return true');
+        $assertion->assertReturnValue = false;
+        $this->assertFalse($acl->isAllowed($user, $blogPost, 'modify'), 'Assertion should return false');
+
+        // check to see if the last assertion has the proper objets
+        $this->assertType('Zend_Acl_UseCase1_User', $assertion->lastAssertRole, 'Assertion did not recieve proper role object');
+        $this->assertType('Zend_Acl_UseCase1_BlogPost', $assertion->lastAssertResource, 'Assertion did not recieve proper resource object');
+
+    }
+
+    /**
+     *
      * @return Zend_Acl_UseCase1_Acl
      */
     protected function _loadUseCase1()
     {
-    	if (!class_exists('Zend_Acl_UseCase1_Acl')) {
-	    	require_once dirname(__FILE__) . '/_files/UseCase1/User.php';
-	    	require_once dirname(__FILE__) . '/_files/UseCase1/BlogPost.php';
-	    	require_once dirname(__FILE__) . '/_files/UseCase1/UserIsBlogPostOwnerAssertion.php';
-	    	require_once dirname(__FILE__) . '/_files/UseCase1/Acl.php';
-    	}    	
-    	return new Zend_Acl_UseCase1_Acl();
+        if (!class_exists('Zend_Acl_UseCase1_Acl')) {
+            require_once dirname(__FILE__) . '/_files/UseCase1/User.php';
+            require_once dirname(__FILE__) . '/_files/UseCase1/BlogPost.php';
+            require_once dirname(__FILE__) . '/_files/UseCase1/UserIsBlogPostOwnerAssertion.php';
+            require_once dirname(__FILE__) . '/_files/UseCase1/Acl.php';
+        }
+        return new Zend_Acl_UseCase1_Acl();
     }
 
     /**
@@ -1233,10 +1233,10 @@ class Zend_Acl_AclTest extends PHPUnit_Framework_TestCase
         // Check after fix
         $this->assertFalse($acl->hasRole('test0'));
     }
-    
+
     /**
      * @group ZF-8039
-     * 
+     *
      * Meant to test for the (in)existance of this notice:
      * "Notice: Undefined index: allPrivileges in lib/Zend/Acl.php on line 682"
      */
@@ -1247,14 +1247,14 @@ class Zend_Acl_AclTest extends PHPUnit_Framework_TestCase
         $acl->allow('admin', 'blog', 'read');
         $acl->removeAllow(array('admin'), array('blog'), null);
     }
-    
+
     public function testRoleObjectImplementsToString() {
-        $role = new Zend_Acl_Role('_fooBar_');	
+        $role = new Zend_Acl_Role('_fooBar_');
         $this->assertEquals('_fooBar_',(string)$role);
     }
-    
+
     public function testResourceObjectImplementsToString() {
-        $resource = new Zend_Acl_Resource('_fooBar_');  
+        $resource = new Zend_Acl_Resource('_fooBar_');
         $this->assertEquals('_fooBar_',(string)$resource);
     }
 

+ 5 - 5
tests/Zend/Acl/_files/AssertionZF7973.php

@@ -7,10 +7,10 @@ class Zend_Acl_AclTest_AssertionZF7973 implements Zend_Acl_Assert_Interface {
                 Zend_Acl_Resource_Interface $resource = null,
                 $privilege = null)
     {
-    	if($privilege != 'privilege') {
-    		return false;
-    	}
-    	
-    	return true;
+        if($privilege != 'privilege') {
+            return false;
+        }
+
+        return true;
     }
 }

+ 7 - 7
tests/Zend/Acl/_files/MockAssertion.php

@@ -2,13 +2,13 @@
 
 class Zend_Acl_MockAssertion implements Zend_Acl_Assert_Interface
 {
-	protected $_returnValue;
-	
-	public function __construct($returnValue)
-	{
-		$this->_returnValue = (bool) $returnValue;
-	}
-	
+    protected $_returnValue;
+
+    public function __construct($returnValue)
+    {
+        $this->_returnValue = (bool) $returnValue;
+    }
+
     public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null, Zend_Acl_Resource_Interface $resource = null,
                            $privilege = null)
     {

+ 18 - 18
tests/Zend/Acl/_files/UseCase1/Acl.php

@@ -2,22 +2,22 @@
 
 class Zend_Acl_UseCase1_Acl extends Zend_Acl
 {
-	
-	public $customAssertion = null;
-	
-	public function __construct()
-	{
-		$this->customAssertion = new Zend_Acl_UseCase1_UserIsBlogPostOwnerAssertion();
-		
-		$this->addRole(new Zend_Acl_Role('guest'));                    // $acl->addRole('guest');
-		$this->addRole(new Zend_Acl_Role('contributor'), 'guest');     // $acl->addRole('contributor', 'guest');
-		$this->addRole(new Zend_Acl_Role('publisher'), 'contributor'); // $acl->addRole('publisher', 'contributor'); 
-		$this->addRole(new Zend_Acl_Role('admin'));                    // $acl->addRole('admin');
-		$this->add(new Zend_Acl_Resource('blogPost'));                 // $acl->addResource('blogPost');
-		$this->allow('guest', 'blogPost', 'view');
-		$this->allow('contributor', 'blogPost', 'contribute');
-		$this->allow('contributor', 'blogPost', 'modify', $this->customAssertion);
-		$this->allow('publisher', 'blogPost', 'publish');
-	}
-	
+
+    public $customAssertion = null;
+
+    public function __construct()
+    {
+        $this->customAssertion = new Zend_Acl_UseCase1_UserIsBlogPostOwnerAssertion();
+
+        $this->addRole(new Zend_Acl_Role('guest'));                    // $acl->addRole('guest');
+        $this->addRole(new Zend_Acl_Role('contributor'), 'guest');     // $acl->addRole('contributor', 'guest');
+        $this->addRole(new Zend_Acl_Role('publisher'), 'contributor'); // $acl->addRole('publisher', 'contributor');
+        $this->addRole(new Zend_Acl_Role('admin'));                    // $acl->addRole('admin');
+        $this->add(new Zend_Acl_Resource('blogPost'));                 // $acl->addResource('blogPost');
+        $this->allow('guest', 'blogPost', 'view');
+        $this->allow('contributor', 'blogPost', 'contribute');
+        $this->allow('contributor', 'blogPost', 'modify', $this->customAssertion);
+        $this->allow('publisher', 'blogPost', 'publish');
+    }
+
 }

+ 6 - 6
tests/Zend/Acl/_files/UseCase1/UserIsBlogPostOwnerAssertion.php

@@ -2,12 +2,12 @@
 
 class Zend_Acl_UseCase1_UserIsBlogPostOwnerAssertion implements Zend_Acl_Assert_Interface
 {
-	
-	public $lastAssertRole = null;
-	public $lastAssertResource = null;
-	public $lastAssertPrivilege = null;
-	public $assertReturnValue = true;
-	
+
+    public $lastAssertRole = null;
+    public $lastAssertResource = null;
+    public $lastAssertPrivilege = null;
+    public $assertReturnValue = true;
+
     public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $user = null, Zend_Acl_Resource_Interface $blogPost = null, $privilege = null)
     {
         $this->lastAssertRole = $user;

+ 4 - 4
tests/Zend/AllTests.php

@@ -127,14 +127,14 @@ class Zend_AllTests
      *
      * These tests require no output be sent prior to running as they rely
      * on internal PHP functions.
-     * 
+     *
      * @return PHPUnit_Framework_TestSuite
      */
     public static function suiteBuffered()
     {
         $suite = new PHPUnit_Framework_TestSuite('Zend Framework - Zend - Buffered Test Suites');
 
-        // These tests require no output be sent prior to running as they rely 
+        // These tests require no output be sent prior to running as they rely
         // on internal PHP functions
         $suite->addTestSuite('Zend_OpenIdTest');
         $suite->addTest(Zend_OpenId_AllTests::suite());
@@ -148,14 +148,14 @@ class Zend_AllTests
      * Regular suite
      *
      * All tests except those that require output buffering.
-     * 
+     *
      * @return PHPUnit_Framework_TestSuite
      */
     public static function suite()
     {
         $suite = new PHPUnit_Framework_TestSuite('Zend Framework - Zend');
 
-        // Running this early to ensure that the test suite hasn't used too 
+        // Running this early to ensure that the test suite hasn't used too
         // much memory by the time it gets to this test.
         $suite->addTest(Zend_Memory_AllTests::suite());
 

+ 6 - 6
tests/Zend/Application/ApplicationTest.php

@@ -296,10 +296,10 @@ class Zend_Application_ApplicationTest extends PHPUnit_Framework_TestCase
         $this->assertTrue($application->hasOption('bar'));
     }
 
-	/**
-	 * This was changed to have the passed in array always overwrite the config file.
-	 * @group ZF-6811
-	 */
+    /**
+     * This was changed to have the passed in array always overwrite the config file.
+     * @group ZF-6811
+     */
     public function testPassingArrayOptionsWithConfigKeyShouldLoadOptionsAndNotOverride()
     {
         $application = new Zend_Application('testing', array('foo' => 'baz', 'config' => dirname(__FILE__) . '/_files/appconfig.inc'));
@@ -392,11 +392,11 @@ class Zend_Application_ApplicationTest extends PHPUnit_Framework_TestCase
     public function testSetOptionsShouldProperlyMergeTwoConfigFileOptions()
     {
         $application = new Zend_Application(
-            'production', dirname(__FILE__) . 
+            'production', dirname(__FILE__) .
             '/_files/zf-6679-1.inc'
         );
         $options = $application->getOptions();
-		var_dump($options);
+        var_dump($options);
         $this->assertEquals(array('includePaths', 'config'), array_keys($options));
     }
 

+ 1 - 1
tests/Zend/Application/Bootstrap/BootstrapAbstractTest.php

@@ -538,7 +538,7 @@ class Zend_Application_Bootstrap_BootstrapAbstractTest extends PHPUnit_Framework
         $resource = $bootstrap->getResource('baz');
         $this->assertEquals('Baz', $resource->baz);
     }
-    
+
     public function testMagicMethodsForPluginResources()
     {
         require_once dirname(__FILE__) . '/../_files/ZfAppBootstrap.php';

+ 1 - 1
tests/Zend/Application/Resource/AllTests.php

@@ -62,7 +62,7 @@ class Zend_Application_Resource_AllTests
 
         $suite->addTestSuite('Zend_Application_Resource_ResourceAbstractTest');
         $suite->addTestSuite('Zend_Application_Resource_DbTest');
-        $suite->addTestSuite('Zend_Application_Resource_DojoTest');        
+        $suite->addTestSuite('Zend_Application_Resource_DojoTest');
         $suite->addTestSuite('Zend_Application_Resource_FrontcontrollerTest');
         $suite->addTestSuite('Zend_Application_Resource_LayoutTest');
         $suite->addTestSuite('Zend_Application_Resource_LocaleTest');

+ 1 - 1
tests/Zend/Application/Resource/DojoTest.php

@@ -115,7 +115,7 @@ class Zend_Application_Resource_DojoTest extends PHPUnit_Framework_TestCase
         $resource->init();
         $resource->getBootstrap()->bootstrap('view');
         $dojo = $resource->getBootstrap()->view->dojo();
-        
+
         $test = array(
             'requireModules' => $dojo->getModules(),
             'localPath'      => $dojo->getLocalPath()

+ 43 - 43
tests/Zend/Application/Resource/NavigationTest.php

@@ -88,31 +88,31 @@ class Zend_Application_Resource_NavigationTest extends PHPUnit_Framework_TestCas
 
     public function testInitializationInitializesNavigationObject()
     {
-		$this->bootstrap->registerPluginResource('view');
+        $this->bootstrap->registerPluginResource('view');
         $resource = new Zend_Application_Resource_Navigation(array());
         $resource->setBootstrap($this->bootstrap);
         $resource->init();
         $this->assertTrue($resource->getContainer() instanceof Zend_Navigation_Container);
-		$this->bootstrap->unregisterPluginResource('view');
+        $this->bootstrap->unregisterPluginResource('view');
     }
 
     public function testInitializationReturnsNavigationObject()
     {
-   		$this->bootstrap->registerPluginResource('view');
+           $this->bootstrap->registerPluginResource('view');
         $resource = new Zend_Application_Resource_Navigation(array());
         $resource->setBootstrap($this->bootstrap);
         $test = $resource->init();
         $this->assertTrue($test instanceof Zend_Navigation);
-		$this->bootstrap->unregisterPluginResource('view');
+        $this->bootstrap->unregisterPluginResource('view');
     }
 
     public function testContainerIsStoredInViewhelper()
     {
-   		$options = array('pages'=> array(new Zend_Navigation_Page_Mvc(array(
-		    'action'     => 'index',
-		    'controller' => 'index'))));
+           $options = array('pages'=> array(new Zend_Navigation_Page_Mvc(array(
+            'action'     => 'index',
+            'controller' => 'index'))));
 
-    	$this->bootstrap->registerPluginResource('view');
+        $this->bootstrap->registerPluginResource('view');
         $resource = new Zend_Application_Resource_Navigation($options);
         $resource->setBootstrap($this->bootstrap)->init();
 
@@ -120,68 +120,68 @@ class Zend_Application_Resource_NavigationTest extends PHPUnit_Framework_TestCas
         $number = $view->getHelper('navigation')->navigation()->count();
 
         $this->assertEquals($number,1);
-		$this->bootstrap->unregisterPluginResource('view');
+        $this->bootstrap->unregisterPluginResource('view');
     }
 
     public function testContainerIsStoredInRegistry()
     {
-   		$options = array('pages'=> array(new Zend_Navigation_Page_Mvc(array(
-		    'action'     => 'index',
-		    'controller' => 'index'))), 'storage' => array('registry' => true));
+           $options = array('pages'=> array(new Zend_Navigation_Page_Mvc(array(
+            'action'     => 'index',
+            'controller' => 'index'))), 'storage' => array('registry' => true));
 
         $resource = new Zend_Application_Resource_Navigation($options);
         $resource->setBootstrap($this->bootstrap)->init();
 
         $key = Zend_Application_Resource_Navigation::DEFAULT_REGISTRY_KEY;
-		$this->assertEquals(Zend_Registry::isRegistered($key),true);
-		$container = Zend_Registry::get($key);
+        $this->assertEquals(Zend_Registry::isRegistered($key),true);
+        $container = Zend_Registry::get($key);
         $number = $container->count();
 
         $this->assertEquals($number,1);
     }
-    
+
     /**
-	 * @group ZF-6747
-	 */
+     * @group ZF-6747
+     */
     public function testViewMethodIsUsedWhenAvailableInsteadOfResourcePlugin()
     {
         require_once '_files/ZfAppBootstrapCustomView.php';
-    
-    	$bootstrap = new ZfAppBootstrapCustomView($this->application);
-    	$bootstrap->registerPluginResource('view');
- 		$view = $bootstrap->bootstrap('view')->view;
- 		
- 		$this->assertEquals($view->setInMethodByTest,true);
+
+        $bootstrap = new ZfAppBootstrapCustomView($this->application);
+        $bootstrap->registerPluginResource('view');
+         $view = $bootstrap->bootstrap('view')->view;
+
+         $this->assertEquals($view->setInMethodByTest,true);
     }
-    
+
     /**
      * @group ZF-7461
      */
     public function testRegistryIsUsedWhenNumericRegistryValueIsGiven()
     {
-    	// Register view for cases where registry should/is not (be) used
-    	$this->bootstrap->registerPluginResource('view');
-    	$this->bootstrap->getPluginResource('view')->getView(); 
-    	
-    	$options1 = array(
-    	   'pages'=> array(new Zend_Navigation_Page_Mvc(array(
+        // Register view for cases where registry should/is not (be) used
+        $this->bootstrap->registerPluginResource('view');
+        $this->bootstrap->getPluginResource('view')->getView();
+
+        $options1 = array(
+           'pages'=> array(new Zend_Navigation_Page_Mvc(array(
             'action'     => 'index',
-            'controller' => 'index'))), 
+            'controller' => 'index'))),
            'storage' => array('registry' => true));
-    	$options = array($options1, 
-    	                 array_merge($options1, array('storage' => array('registry' => '1'))), // Original culprit here
-    	                 array_merge($options1, array('storage' => array('registry' => 1))),
-    	                 array_merge($options1, array('storage' => array('registry' => false))));
-    	                 
-    	$results = array();
-    	$key = Zend_Application_Resource_Navigation::DEFAULT_REGISTRY_KEY;
-    	foreach($options as $option) {
-	        $resource = new Zend_Application_Resource_Navigation($option);
-	        $resource->setBootstrap($this->bootstrap)->init();
+        $options = array($options1,
+                         array_merge($options1, array('storage' => array('registry' => '1'))), // Original culprit here
+                         array_merge($options1, array('storage' => array('registry' => 1))),
+                         array_merge($options1, array('storage' => array('registry' => false))));
+
+        $results = array();
+        $key = Zend_Application_Resource_Navigation::DEFAULT_REGISTRY_KEY;
+        foreach($options as $option) {
+            $resource = new Zend_Application_Resource_Navigation($option);
+            $resource->setBootstrap($this->bootstrap)->init();
             $results[] = Zend_Registry::get($key) instanceof Zend_Navigation;;
-	        Zend_Registry::set($key,null);
+            Zend_Registry::set($key,null);
         }
-    
+
         $this->assertEquals(array(true,true,true,false),$results);
         $this->bootstrap->unregisterPluginResource('view');
     }

+ 1 - 1
tests/Zend/Application/Resource/RouterTest.php

@@ -99,7 +99,7 @@ class Zend_Application_Resource_RouterTest extends PHPUnit_Framework_TestCase
         $test = $resource->init();
         $this->assertTrue($test instanceof Zend_Controller_Router_Rewrite);
     }
-    
+
     public function testChainNameSeparatorIsParsedOnToRouter()
     {
         $resource = new Zend_Application_Resource_Router(array('chainNameSeparator' => '_unitTestSep_'));

+ 20 - 20
tests/Zend/Application/Resource/TranslateTest.php

@@ -44,11 +44,11 @@ require_once 'Zend/Loader/Autoloader.php';
  */
 class Zend_Application_Resource_TranslateTest extends PHPUnit_Framework_TestCase
 {
-	private $_translationOptions = array('data' => array(
-	    'message1' => 'message1',
-	    'message2' => 'message2',
-	    'message3' => 'message3'
-	));
+    private $_translationOptions = array('data' => array(
+        'message1' => 'message1',
+        'message2' => 'message2',
+        'message3' => 'message3'
+    ));
 
     public static function main()
     {
@@ -102,8 +102,8 @@ class Zend_Application_Resource_TranslateTest extends PHPUnit_Framework_TestCase
 
     public function testInitializationReturnsLocaleObject()
     {
-    	$resource = new Zend_Application_Resource_Translate($this->_translationOptions);
-    	$resource->setBootstrap($this->bootstrap);
+        $resource = new Zend_Application_Resource_Translate($this->_translationOptions);
+        $resource->setBootstrap($this->bootstrap);
         $test = $resource->init();
         $this->assertTrue($test instanceof Zend_Translate);
     }
@@ -120,28 +120,28 @@ class Zend_Application_Resource_TranslateTest extends PHPUnit_Framework_TestCase
 
     public function testResourceThrowsExceptionWithoutData()
     {
-    	try {
-    	    $resource = new Zend_Application_Resource_Translate();
-    	    $resource->getTranslate();
-    	    $this->fail('Expected Zend_Application_Resource_Exception');
-    	} catch (Zend_Application_Resource_Exception $e) {
-    		$this->assertType('Zend_Application_Resource_Exception', $e);
-    	}
+        try {
+            $resource = new Zend_Application_Resource_Translate();
+            $resource->getTranslate();
+            $this->fail('Expected Zend_Application_Resource_Exception');
+        } catch (Zend_Application_Resource_Exception $e) {
+            $this->assertType('Zend_Application_Resource_Exception', $e);
+        }
     }
-    
+
     /**
      * @group ZF-7352
      */
     public function testTranslationIsAddedIfRegistryKeyExistsAlready()
     {
-    	$options1 = array('foo' => 'bar');
-    	$options2 = array_merge_recursive($this->_translationOptions,
-    	                                  array('data' => array('message4' => 'bericht4')));
+        $options1 = array('foo' => 'bar');
+        $options2 = array_merge_recursive($this->_translationOptions,
+                                          array('data' => array('message4' => 'bericht4')));
 
         $translate = new Zend_Translate(Zend_Translate::AN_ARRAY, $options1);
         Zend_Registry::set('Zend_Translate', $translate);
-        
-    	$resource = new Zend_Application_Resource_Translate($options2);
+
+        $resource = new Zend_Application_Resource_Translate($options2);
 
         $this->assertTrue($translate === $resource->getTranslate());
         $this->assertEquals('bar', $translate->translate('foo'));

+ 3 - 3
tests/Zend/Application/Resource/_files/ZfAppBootstrapCustomView.php

@@ -30,8 +30,8 @@
 class ZfAppBootstrapCustomView extends Zend_Application_Bootstrap_Bootstrap {
     public function _initView()
     {
-		$view = new Zend_View();
-		$view->setInMethodByTest = true;
-		return $view;
+        $view = new Zend_View();
+        $view->setInMethodByTest = true;
+        return $view;
     }
 }

+ 1 - 1
tests/Zend/Application/_files/ZfAppBootstrap.php

@@ -35,7 +35,7 @@ class ZfAppBootstrap extends Zend_Application_Bootstrap_BootstrapAbstract
     public $executedFooBarResource = false;
 
     protected $_arbitraryValue;
-    
+
     public function run()
     {
     }

部分文件因文件數量過多而無法顯示