mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 14:37:02 +03:00
More functions without type hinting found and fixt
Use PECL yaml (else Spyc) Upgrade Spyc (with removed dump code)
This commit is contained in:
parent
cd3d8b94b2
commit
75b4b64118
43 changed files with 893 additions and 1482 deletions
|
|
@ -251,10 +251,10 @@ class Utils
|
|||
{
|
||||
if (\file_exists($sFileName))
|
||||
{
|
||||
$isYml = '.yml' === substr($sFileName, -4);
|
||||
if ($isYml)
|
||||
if ('.yml' === substr($sFileName, -4))
|
||||
{
|
||||
$aLang = \spyc_load(\str_replace(array(': >-', ': |-', ': |+'), array(': >', ': |', ': |'), \file_get_contents($sFileName)));
|
||||
//- $aLang = \yaml_parse(\str_replace(array(': >-', ': |-', ': |+'), array(': >', ': |', ': |'), \file_get_contents($sFileName)));
|
||||
$aLang = \yaml_parse_file($sFileName);
|
||||
if (\is_array($aLang))
|
||||
{
|
||||
\reset($aLang);
|
||||
|
|
@ -434,21 +434,16 @@ class Utils
|
|||
{
|
||||
$aResult = array();
|
||||
|
||||
if (is_array($aSuggestions))
|
||||
foreach ($aSuggestions as $aItem)
|
||||
{
|
||||
$aCache = array();
|
||||
foreach ($aSuggestions as $aItem)
|
||||
$sLine = \implode('~~', $aItem);
|
||||
if (!isset($aResult[$sLine]))
|
||||
{
|
||||
$sLine = \implode('~~', $aItem);
|
||||
if (!isset($aCache[$sLine]))
|
||||
{
|
||||
$aCache[$sLine] = true;
|
||||
$aResult[] = $aItem;
|
||||
}
|
||||
$aResult[$sLine] = $aItem;
|
||||
}
|
||||
}
|
||||
|
||||
return $aResult;
|
||||
return array_values($aResult);
|
||||
}
|
||||
|
||||
public static function CustomParseIniFile(string $sFileName, bool $bProcessSections = false) : array
|
||||
|
|
@ -458,8 +453,7 @@ class Utils
|
|||
// return \parse_ini_file($sFileName, !!$bProcessSections);
|
||||
// }
|
||||
|
||||
$sData = \file_get_contents($sFileName);
|
||||
return \is_string($sData) ? \parse_ini_string($sData, !!$bProcessSections) : null;
|
||||
return @\parse_ini_string(\file_get_contents($sFileName), $bProcessSections) ?: array();
|
||||
}
|
||||
|
||||
public static function CustomBaseConvert(string $sNumberInput, string $sFromBaseInput = '0123456789', string $sToBaseInput = '0123456789')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue