replaced deprecated split with explode

This commit is contained in:
Christian Walde 2010-07-30 22:28:31 +02:00
parent a5fa809335
commit cd6015203e
6 changed files with 13 additions and 13 deletions

View File

@ -316,7 +316,7 @@ class SimpleHttpHeaders {
$this->_cookies = array(); $this->_cookies = array();
$this->_authentication = false; $this->_authentication = false;
$this->_realm = false; $this->_realm = false;
foreach (split("\r\n", $headers) as $header_line) { foreach (explode("\r\n", $headers) as $header_line) {
$this->_parseHeaderLine($header_line); $this->_parseHeaderLine($header_line);
} }
} }
@ -457,7 +457,7 @@ class SimpleHttpHeaders {
* @access private * @access private
*/ */
function _parseCookie($cookie_line) { function _parseCookie($cookie_line) {
$parts = split(";", $cookie_line); $parts = explode(";", $cookie_line);
$cookie = array(); $cookie = array();
preg_match('/\s*(.*?)\s*=(.*)/', array_shift($parts), $cookie); preg_match('/\s*(.*?)\s*=(.*)/', array_shift($parts), $cookie);
foreach ($parts as $part) { foreach ($parts as $part) {
@ -521,7 +521,7 @@ class SimpleHttpResponse extends SimpleStickyError {
$this->_setError('Could not split headers from content'); $this->_setError('Could not split headers from content');
$this->_headers = &new SimpleHttpHeaders($raw); $this->_headers = &new SimpleHttpHeaders($raw);
} else { } 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); $this->_headers = &new SimpleHttpHeaders($headers);
} }
} }

View File

@ -106,7 +106,7 @@ class SimpleUrl {
} }
if (preg_match('/^([^\/]*)@(.*)/', $url, $matches)) { if (preg_match('/^([^\/]*)@(.*)/', $url, $matches)) {
$url = $prefix . $matches[2]; $url = $prefix . $matches[2];
$parts = split(":", $matches[1]); $parts = explode(":", $matches[1]);
return array( return array(
urldecode($parts[0]), urldecode($parts[0]),
isset($parts[1]) ? urldecode($parts[1]) : false); isset($parts[1]) ? urldecode($parts[1]) : false);
@ -184,7 +184,7 @@ class SimpleUrl {
function _parseRequest($raw) { function _parseRequest($raw) {
$this->_raw = $raw; $this->_raw = $raw;
$request = new SimpleGetEncoding(); $request = new SimpleGetEncoding();
foreach (split("&", $raw) as $pair) { foreach (explode("&", $raw) as $pair) {
if (preg_match('/(.*?)=(.*)/', $pair, $matches)) { if (preg_match('/(.*?)=(.*)/', $pair, $matches)) {
$request->add($matches[1], urldecode($matches[2])); $request->add($matches[1], urldecode($matches[2]));
} elseif ($pair) { } elseif ($pair) {

View File

@ -190,7 +190,7 @@ class HttpHeaderExpectation extends SimpleExpectation {
* @access protected * @access protected
*/ */
function _findHeader($compare) { function _findHeader($compare) {
$lines = split("\r\n", $compare); $lines = explode("\r\n", $compare);
foreach ($lines as $line) { foreach ($lines as $line) {
if ($this->_testHeaderLine($line)) { if ($this->_testHeaderLine($line)) {
return $line; return $line;
@ -206,7 +206,7 @@ class HttpHeaderExpectation extends SimpleExpectation {
* @access private * @access private
*/ */
function _testHeaderLine($line) { function _testHeaderLine($line) {
if (count($parsed = split(':', $line, 2)) < 2) { if (count($parsed = explode(':', $line, 2)) < 2) {
return false; return false;
} }
list($header, $value) = $parsed; list($header, $value) = $parsed;

View File

@ -37,7 +37,7 @@ class WordFilter implements Extension {
$lines = explode("\n", $raw); $lines = explode("\n", $raw);
$map = array(); $map = array();
foreach($lines as $line) { foreach($lines as $line) {
$parts = split(",", $line); $parts = explode(",", $line);
if(count($parts) == 2) { if(count($parts) == 2) {
$map[$parts[0]] = $parts[1]; $map[$parts[0]] = $parts[1];
} }

View File

@ -183,7 +183,7 @@ class MemcacheCache implements CacheEngine {
var $memcache=null, $hits=0, $misses=0; var $memcache=null, $hits=0, $misses=0;
public function __construct($args) { public function __construct($args) {
$hp = split(":", $args); $hp = explode(":", $args);
if(class_exists("Memcache")) { if(class_exists("Memcache")) {
$this->memcache = new Memcache; $this->memcache = new Memcache;
@$this->memcache->pconnect($hp[0], $hp[1]); @$this->memcache->pconnect($hp[0], $hp[1]);

View File

@ -859,7 +859,7 @@ function _get_page_request() {
$args = _get_query_parts(); $args = _get_query_parts();
if(count($args) == 0 || strlen($args[0]) == 0) { if(count($args) == 0 || strlen($args[0]) == 0) {
$args = split('/', $config->get_string('front_page')); $args = explode('/', $config->get_string('front_page'));
} }
return new PageRequestEvent($args); return new PageRequestEvent($args);