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->_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);
}
}
@ -457,7 +457,7 @@ class SimpleHttpHeaders {
* @access private
*/
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) {
@ -521,7 +521,7 @@ class SimpleHttpResponse extends SimpleStickyError {
$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);
}
}

View file

@ -106,7 +106,7 @@ class SimpleUrl {
}
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);
@ -184,7 +184,7 @@ class SimpleUrl {
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) {

View file

@ -190,7 +190,7 @@ class HttpHeaderExpectation extends SimpleExpectation {
* @access 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 @@ class HttpHeaderExpectation extends SimpleExpectation {
* @access private
*/
function _testHeaderLine($line) {
if (count($parsed = split(':', $line, 2)) < 2) {
if (count($parsed = explode(':', $line, 2)) < 2) {
return false;
}
list($header, $value) = $parsed;

View file

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

View file

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

View file

@ -859,7 +859,7 @@ function _get_page_request() {
$args = _get_query_parts();
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);