Просмотр исходного кода

ZF-7325: Replace calls to split() in Zend_Gdata with calls to explode() or preg_spllit().

The split() function is depreciated as of PHP 5.3.0.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@16937 44c647ce-9c0f-0410-b52a-842ac1e357ba
tjohns 16 лет назад
Родитель
Сommit
bf564502b0

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

@@ -109,7 +109,7 @@ class SimpleCRUD
         $input = getInput("\nSelection");
 
         //id text is of the form: tag:blogger.com,1999:user-blogID.blogs
-        $idText = split('-', $feed->entries[$input]->id->text);
+        $idText = explode('-', $feed->entries[$input]->id->text);
         $this->blogID = $idText[2];
     }
     
@@ -145,7 +145,7 @@ class SimpleCRUD
 
         $createdPost = $this->gdClient->insertEntry($entry, $uri);
         //format of id text: tag:blogger.com,1999:blog-blogID.post-postID 
-        $idText = split('-', $createdPost->id->text);
+        $idText = explode('-', $createdPost->id->text);
         $postID = $idText[2];
 
         return $postID; 
@@ -234,7 +234,7 @@ class SimpleCRUD
         
         echo 'Added new comment: ' . $createdComment->content->text . "\n";
         // Edit link follows format: /feeds/blogID/postID/comments/default/commentID 
-        $editLink = split('/', $createdComment->getEditLink()->href);
+        $editLink = explode('/', $createdComment->getEditLink()->href);
         $commentID = $editLink[8];      
  
         return $commentID; 
@@ -357,7 +357,7 @@ $pass = null;
 
 // process command line options
 foreach ($argv as $argument) {
-    $argParts = split('=', $argument);
+    $argParts = explode('=', $argument);
     if ($argParts[0] == '--user') {
         $user = $argParts[1];
     } else if ($argParts[0] == '--pass') {

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

@@ -418,7 +418,7 @@ function showEditMenu() {
       if ($editLink == $_POST['edit']) {
         $baseAttributeArr = $feed_entry->getGbaseAttribute('cooking_time');
         if (isset($baseAttributeArr[0]) && is_object($baseAttributeArr[0])) {
-          $splitCookingTime = split(' ', $baseAttributeArr[0]->text);
+          $splitCookingTime = explode(' ', $baseAttributeArr[0]->text);
         }
         
         $baseAttributeArr = $feed_entry->getGbaseAttribute('cuisine');

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

@@ -207,7 +207,7 @@ $pass = null;
 
 // process command line options
 foreach ($argv as $argument) {
-    $argParts = split('=', $argument);
+    $argParts = explode('=', $argument);
     if ($argParts[0] == '--email') {
         $email = $argParts[1];
     } else if ($argParts[0] == '--pass') {

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

@@ -96,7 +96,7 @@ class SimpleCRUD
         print "== Available Spreadsheets ==\n";
         $this->printFeed($feed);
         $input = getInput("\nSelection");
-        $currKey = split('/', $feed->entries[$input]->id->text);
+        $currKey = explode('/', $feed->entries[$input]->id->text);
         $this->currKey = $currKey[5];
     }
 
@@ -113,7 +113,7 @@ class SimpleCRUD
         print "== Available Worksheets ==\n";
         $this->printFeed($feed);
         $input = getInput("\nSelection");
-        $currWkshtId = split('/', $feed->entries[$input]->id->text);
+        $currWkshtId = explode('/', $feed->entries[$input]->id->text);
         $this->currWkshtId = $currWkshtId[8];
 
     }
@@ -128,7 +128,7 @@ class SimpleCRUD
         echo "Pick a command:\n";
         echo "\ndump -- dump cell information\nupdate {row} {col} {input_value} -- update cell information\n";
         $input = getInput('Command');
-        $command = split(' ', $input);
+        $command = explode(' ', $input);
         if ($command[0] == 'dump') {
             $this->cellsGetAction();
         } else if (($command[0] == 'update') && (count($command) > 2)) {
@@ -196,7 +196,7 @@ class SimpleCRUD
               "delete {row_index} -- delete a row\n\n";
         
         $input = getInput('Command');
-        $command = split(' ', $input);
+        $command = explode(' ', $input);
         if ($command[0] == 'dump') {
             $this->listGetAction();
         } else if ($command[0] == 'insert') {
@@ -328,7 +328,7 @@ class SimpleCRUD
     {
         $arr = array();
         foreach ($rowData as $row) {
-            $temp = split('=', $row);
+            $temp = explode('=', $row);
             $arr[$temp[0]] = $temp[1];
         }
         return $arr;
@@ -437,7 +437,7 @@ $pass = null;
 
 // process command line options
 foreach ($argv as $argument) {
-    $argParts = split('=', $argument);
+    $argParts = explode('=', $argument);
     if ($argParts[0] == '--email') {
         $email = $argParts[1];
     } else if ($argParts[0] == '--pass') {

+ 1 - 1
library/Zend/Gdata/YouTube/VideoEntry.php

@@ -836,7 +836,7 @@ class Zend_Gdata_YouTube_VideoEntry extends Zend_Gdata_YouTube_MediaEntry
             $keywords = $this->getMediaGroup()->getKeywords();
             $keywordsString = $keywords->getText();
             if (strlen(trim($keywordsString)) > 0) {
-                return split('(, *)|,', $keywordsString);
+                return preg_split('/(, *)|,/', $keywordsString);
             }
         }
         return array();

+ 2 - 2
tests/Zend/Gdata/YouTube/VideoEntryTest.php

@@ -540,7 +540,7 @@ class Zend_Gdata_YouTube_VideoEntryTest extends PHPUnit_Framework_TestCase
         $keywordsString = (string) $keywords;
 
         if (strlen(trim($keywordsString)) > 0) {
-            $keywordArray = split('(, *)|,', $keywordsString);
+            $keywordArray = preg_split('/(, *)|,/', $keywordsString);
         }
 
         $tagArray = $videoEntry->getVideoTags();
@@ -565,7 +565,7 @@ class Zend_Gdata_YouTube_VideoEntryTest extends PHPUnit_Framework_TestCase
         $videoEntry->setVideoTags($newKeywordsString);
 
         if (strlen(trim($newKeywordsString)) > 0) {
-            $keywordArray = split('(, *)|,', $newKeywordsString);
+            $keywordArray = preg_split('/(, *)|,/', $newKeywordsString);
         }
 
         $tagArray = $videoEntry->getVideoTags();