/** * Zamienia niedozwolone znaki w tagach. */ protected function _parseTags($aTags) { if (is_string($aTags)) { $aTags = array($aTags); } $aNewTags = array(); foreach ($aTags as $sTag) { $aNewTags[] = Common_String::replaceSpecialChars($sTag); } return $aNewTags; }
/** * Generuje klucz dla cache. * * @param string $sMethodName * @param array $aArgs * * @return string */ public function getId($sClassName, $sMethodName, $aArgs) { foreach ($aArgs as $sArgs) { if (is_object($sArgs)) { if ($sArgs instanceof Common_Db_Row_Abstract) { $sArgs = $sArgs->id; } else { throw new Exception("Klasa nie jest instancją Common_Db_Row_Abstract"); } } } /** * @todo Jeśli dla jednej domeny będa używane różne configi to klucz cache * tego nie obsłuży */ $sId = $_SERVER['HTTP_HOST'] . '_' . $sClassName . '_' . $sMethodName . '_' . serialize($aArgs); //$sId = substr(Common_String::replaceSpecialChars($sId),0,221); $sId = Common_String::replaceSpecialChars($sId); if (strlen($sId) > 221) { throw new Exception("Klucz wygenerowany dla metody {$sMethodName} jest dłuższy niż 221 znaków."); } return $sId; }
public function i2t(array $aFields, $sFormat = "H:i") { foreach ($this->aList as $iKey => &$aRow) { Common_String::i2d($aRow, $aFields, $sFormat); } }