mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +02:00
#47 Replaced every occurence of deprecated verb split() by explode()
SVN:trunk[224]
This commit is contained in:
@@ -70,7 +70,7 @@ class CSVParser
|
||||
$aStatsBySeparator[$sSep] = array();
|
||||
}
|
||||
|
||||
foreach(split("\n", $this->m_sCSVData) as $sLine)
|
||||
foreach(explode("\n", $this->m_sCSVData) as $sLine)
|
||||
{
|
||||
$sLine = trim($sLine);
|
||||
if (substr($sLine, 0, 1) == '#') continue;
|
||||
@@ -106,13 +106,13 @@ class CSVParser
|
||||
// Take the FIRST -valuable- LINE ONLY
|
||||
// If there is a number, then for sure this is not a header line
|
||||
// Otherwise, we may consider that there is one line to skip
|
||||
foreach(split("\n", $this->m_sCSVData) as $sLine)
|
||||
foreach(explode("\n", $this->m_sCSVData) as $sLine)
|
||||
{
|
||||
$sLine = trim($sLine);
|
||||
if (substr($sLine, 0, 1) == '#') continue;
|
||||
if (empty($sLine)) continue;
|
||||
|
||||
foreach (split($this->m_sSep, $sLine) as $value)
|
||||
foreach (explode($this->m_sSep, $sLine) as $value)
|
||||
{
|
||||
if (is_numeric($value))
|
||||
{
|
||||
@@ -133,7 +133,7 @@ class CSVParser
|
||||
|
||||
$iCount = 0;
|
||||
$iSkipped = 0;
|
||||
foreach(split("\n", $this->m_sCSVData) as $sLine)
|
||||
foreach(explode("\n", $this->m_sCSVData) as $sLine)
|
||||
{
|
||||
$sLine = trim($sLine);
|
||||
if (substr($sLine, 0, 1) == '#') continue;
|
||||
@@ -145,7 +145,7 @@ class CSVParser
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (split($this->m_sSep, $sLine) as $iCol=>$sValue)
|
||||
foreach (explode($this->m_sSep, $sLine) as $iCol=>$sValue)
|
||||
{
|
||||
if (is_array($aFieldMap)) $sColRef = $aFieldMap[$iCol];
|
||||
else $sColRef = $iCol;
|
||||
|
||||
@@ -206,7 +206,7 @@ class cmdbDataGenerator
|
||||
function GenerateString($sTemplate)
|
||||
{
|
||||
$sResult = "";
|
||||
$aParts = split("\|", $sTemplate);
|
||||
$aParts = explode("\|", $sTemplate);
|
||||
foreach($aParts as $sPart)
|
||||
{
|
||||
if (preg_match("/domain\(\)/", $sPart, $aMatches))
|
||||
@@ -216,7 +216,7 @@ class cmdbDataGenerator
|
||||
elseif (preg_match("/enum\((.+)\)/", $sPart, $aMatches))
|
||||
{
|
||||
$sEnumValues = $aMatches[1];
|
||||
$aEnumValues = split(",", $sEnumValues);
|
||||
$aEnumValues = explode(",", $sEnumValues);
|
||||
$sResult .= $aEnumValues[rand(0, count($aEnumValues) - 1)];
|
||||
}
|
||||
elseif (preg_match("/number\((\d+)-(\d+)\)/", $sPart, $aMatches))
|
||||
|
||||
@@ -163,7 +163,14 @@ class DBObjectSearch
|
||||
|
||||
public function __DescribeHTML()
|
||||
{
|
||||
$sConditionDesc = $this->DescribeConditions();
|
||||
try
|
||||
{
|
||||
$sConditionDesc = $this->DescribeConditions();
|
||||
}
|
||||
catch (MissingQueryArgument $e)
|
||||
{
|
||||
$sConditionDesc = '?missing query argument?';
|
||||
}
|
||||
if (!empty($sConditionDesc))
|
||||
{
|
||||
return "Objects of class '$this->m_sClass', $sConditionDesc";
|
||||
@@ -525,14 +532,14 @@ class DBObjectSearch
|
||||
// -> return (unserialize(base64_decode($sValue)));
|
||||
|
||||
$sClearText = base64_decode($sValue);
|
||||
$aValues = split("\n", $sClearText);
|
||||
$aValues = explode("\n", $sClearText);
|
||||
$i = 0;
|
||||
$sClass = $aValues[$i++];
|
||||
$sClassAlias = $aValues[$i++];
|
||||
$oFilter = new DBObjectSearch($sClass, $sClassAlias);
|
||||
while($i < count($aValues) && !empty($aValues[$i]))
|
||||
{
|
||||
$aCondition = split(":", $aValues[$i++]);
|
||||
$aCondition = explode(":", $aValues[$i++]);
|
||||
switch ($aCondition[0])
|
||||
{
|
||||
case "A":
|
||||
@@ -940,7 +947,7 @@ class DBObjectSearch
|
||||
{
|
||||
$sClass = trim(substr($sQuery, 0, $iSepPos));
|
||||
$sConds = trim(substr($sQuery, $iSepPos + 1));
|
||||
$aValues = split(" AND ", $sConds);
|
||||
$aValues = explode(" AND ", $sConds);
|
||||
|
||||
$oFilter = new DBObjectSearch($sClass);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user