Permalink
Browse files

Convert deprecated split() usage to explode()

  • Loading branch information...
1 parent 30fd03c commit 7a2e4f505ee3d5f0dbf19bb01196d37c45b8be33 edwardzyang committed Dec 8, 2008
Showing with 10 additions and 10 deletions.
  1. +4 −4 http.php
  2. +3 −3 url.php
  3. +3 −3 web_tester.php
View
@@ -317,7 +317,7 @@ function __construct($headers) {
$this->cookies = array();
$this->authentication = false;
$this->realm = false;
- foreach (split("\r\n", $headers) as $header_line) {
+ foreach (explode("\r\n", $headers) as $header_line) {
$this->parseHeaderLine($header_line);
}
}
@@ -458,7 +458,7 @@ protected function parseHeaderLine($header_line) {
* @access private
*/
protected function parseCookie($cookie_line) {
- $parts = split(";", $cookie_line);
+ $parts = explode(";", $cookie_line);
$cookie = array();
preg_match('/\s*(.*?)\s*=(.*)/', array_shift($parts), $cookie);
foreach ($parts as $part) {
@@ -525,7 +525,7 @@ protected function parse($raw) {
$this->setError('Could not split headers from content');
$this->headers = new SimpleHttpHeaders($raw);
} else {
- list($headers, $this->content) = split("\r\n\r\n", $raw, 2);
+ list($headers, $this->content) = explode("\r\n\r\n", $raw, 2);
$this->headers = new SimpleHttpHeaders($headers);
}
}
@@ -625,4 +625,4 @@ protected function isLastPacket($packet) {
return ! $packet;
}
}
-?>
+?>
View
@@ -120,7 +120,7 @@ protected function chompLogin(&$url) {
}
if (preg_match('#^([^/]*)@(.*)#', $url, $matches)) {
$url = $prefix . $matches[2];
- $parts = split(":", $matches[1]);
+ $parts = explode(":", $matches[1]);
return array(
urldecode($parts[0]),
isset($parts[1]) ? urldecode($parts[1]) : false);
@@ -198,7 +198,7 @@ protected function chompRequest(&$url) {
protected function parseRequest($raw) {
$this->raw = $raw;
$request = new SimpleGetEncoding();
- foreach (split("&", $raw) as $pair) {
+ foreach (explode("&", $raw) as $pair) {
if (preg_match('/(.*?)=(.*)/', $pair, $matches)) {
$request->add($matches[1], urldecode($matches[2]));
} elseif ($pair) {
@@ -547,4 +547,4 @@ static function getAllTopLevelDomains() {
return 'com|edu|net|org|gov|mil|int|biz|info|name|pro|aero|coop|museum';
}
}
-?>
+?>
View
@@ -190,7 +190,7 @@ function test($compare) {
* @access protected
*/
protected function findHeader($compare) {
- $lines = split("\r\n", $compare);
+ $lines = explode("\r\n", $compare);
foreach ($lines as $line) {
if ($this->testHeaderLine($line)) {
return $line;
@@ -206,7 +206,7 @@ protected function findHeader($compare) {
* @access private
*/
protected function testHeaderLine($line) {
- if (count($parsed = split(':', $line, 2)) < 2) {
+ if (count($parsed = explode(':', $line, 2)) < 2) {
return false;
}
list($header, $value) = $parsed;
@@ -1492,4 +1492,4 @@ function getAssertionLine() {
return $trace->traceMethod();
}
}
-?>
+?>

0 comments on commit 7a2e4f5

Please sign in to comment.