Performance improvements to the CSV Reader and Writer

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@64769 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker
2010-12-03 17:48:10 +00:00
parent 5917b8c9b0
commit f1e413bcc1
4 changed files with 21 additions and 20 deletions
+9 -12
View File
@@ -322,6 +322,15 @@ class PHPExcel_Shared_String
return true;
}
public static function buildCharacterSets() {
if(empty(self::$_controlCharacters)) {
self::_buildControlCharacters();
}
if(empty(self::$_SYLKCharacters)) {
self::_buildSYLKCharacters();
}
}
/**
* Convert from OpenXML escaped control character to PHP control character
*
@@ -337,10 +346,6 @@ class PHPExcel_Shared_String
* @return string
*/
public static function ControlCharacterOOXML2PHP($value = '') {
if(empty(self::$_controlCharacters)) {
self::_buildControlCharacters();
}
return str_replace( array_keys(self::$_controlCharacters), array_values(self::$_controlCharacters), $value );
}
@@ -359,10 +364,6 @@ class PHPExcel_Shared_String
* @return string
*/
public static function ControlCharacterPHP2OOXML($value = '') {
if(empty(self::$_controlCharacters)) {
self::_buildControlCharacters();
}
return str_replace( array_values(self::$_controlCharacters), array_keys(self::$_controlCharacters), $value );
}
@@ -657,10 +658,6 @@ class PHPExcel_Shared_String
return $pValue;
}
if(empty(self::$_SYLKCharacters)) {
self::_buildSYLKCharacters();
}
foreach (self::$_SYLKCharacters as $k => $v) {
$pValue = str_replace($k, $v, $pValue);
}